Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cf): add location filtering to cloudfoundry #5088

Merged
merged 10 commits into from
Nov 12, 2020
Merged

feat(cf): add location filtering to cloudfoundry #5088

merged 10 commits into from
Nov 12, 2020

Conversation

zachsmith1
Copy link
Contributor

@zachsmith1 zachsmith1 commented Nov 10, 2020

This is a new feature for cloudfoundry accounts. This is similar to how the k8 provider has a namespace filter at the account credentials layer. The idea is that one can re-use the same underlying credentials that communicate with CF, and filter the results on the spinnaker side. This does two things: allows CF infrastructure teams to not have to manage the individual spinnaker accounts, and adds performance improvements because accounts (and their caching agents) will now only cache items in the locations they care about.

locationFilter is a Map<String, Set<String>>. For the account, it would look something like this:

...
spaceFilter:
	org1:
	 - space1
     - space2
    org2: []
...

This example covers the main two use-cases. First, a user would provide an Organization and a subset of Spaces for that org (org1 & space1/space2). Space1 and Space2 would be the filter applied across various functions in spinnaker. Meaning, the resources in those spaces are the only resources seen by the account. Second, a user would just provide an Organization with an empty list and spinnaker treats all the spaces under this Org as the filter. This is to help the situation in which all spaces under the org need to be added, but it's burdensome to statically type all of them.

In the example above, if space2 is deleted from the CF platform, spinnaker will continue to carry-on regardless. However, if a user tries to deploy to a space thats non-existent, they may receive an error message unless the space caching agent catches the deletion before the user tries the operation. The same goes for Organizations. The only time CD will fail is if the locationFilter has items in it, but it wasn't able to construct a filter object with any spaces. Meaning, the account had filters but CD couldn't find any spaces. In this situation, the inverse operation to allow all, would be problematic so its okay to fail.

NOTE: locationFilter was changed in favor of spaceFilter

@kevinawoo kevinawoo added the ready to merge Approved and ready for a merge label Nov 12, 2020
@mergify mergify bot added the auto merged Merged automatically by a bot label Nov 12, 2020
@mergify mergify bot merged commit 7f7b127 into spinnaker:master Nov 12, 2020
@zachsmith1 zachsmith1 deleted the feat/addLocationFilteringToCF branch November 12, 2020 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for a merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants