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

Extract tags from ManagedClusters as labels. #22

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

bigkevmcd
Copy link
Collaborator

This pulls the tags from an AKS ManagerCluster and converts them to Labels on the generated GitOpsClusters.

@bigkevmcd bigkevmcd marked this pull request as ready for review November 22, 2023 10:27
@bigkevmcd bigkevmcd requested a review from a team November 22, 2023 10:28
These labels are then applied to the GeneratedClusters.

This functionality can be disabled by setting `spec.disableTags` on the
AutomatedClusterDiscovery to true.
@foot
Copy link
Collaborator

foot commented Nov 22, 2023

Does what it says on the 🥫!

image

@foot
Copy link
Collaborator

foot commented Nov 22, 2023

Does not delete labels. But I'm not sure if we can pull that off? (without risking deleting user added labels?)

Copy link
Collaborator

@foot foot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bigkevmcd
Copy link
Collaborator Author

Yeah, it's tricky deleting them, we could prefix them with something that would let us know that we had applied them tho'

And then find the ones we knew we'd applied.

@foot
Copy link
Collaborator

foot commented Nov 22, 2023

Yeah, true. Which would work for a lot of cases if the user can control the labelSelector (which would probably be true for cluster-bootstrap-controller / gitopssets.cluster-gen).

Other things that jump to mind..

  • storing them in the specstatus?
  • last applied JSON blob in annotation?

Happy to do this incrementally too, great first step.

@bigkevmcd
Copy link
Collaborator Author

bigkevmcd commented Nov 22, 2023

  • last applied JSON blob in annotation?

This would definitely work, the irony of the "can we turn off applying the labels from upstream" was that it could lead to massive Labels...I'm not quite convinced of this, but obviously it would lead to doubling of the storage :-)

@bigkevmcd bigkevmcd merged commit e2687cc into main Nov 22, 2023
3 checks passed
@bigkevmcd bigkevmcd deleted the labels-from-tags branch November 22, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants