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

Create NS Annotation label Made a Constant #1533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented May 19, 2020

Signed-off-by: Ken Sipe [email protected]

@@ -28,4 +28,6 @@ const (

// Last applied state for three way merges
LastAppliedConfigAnnotation = "kudo.dev/last-applied-configuration"

CreatedByAnnotation = "kudo.dev/created-by"
Copy link
Contributor

Choose a reason for hiding this comment

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

The created-by semantics is somewhat strange: CLI also creates Instance, Operator, and OperatorVersion resources - should we now mark them too? Instance controller creates all other resources - should we then add kudo.dev/created-by: instance-controller?
Our labels (seen above) have been about what-this-is and not who-created-it. So maybe:

Suggested change
CreatedByAnnotation = "kudo.dev/created-by"
InstanceNamespaceAnnotation = "kudo.dev/instance-namespace"

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure we know that the namespace is for an instance... currently it is. The ns could be for an operator needs. I am simply looking for a convenient way to identify that this is a kudo managed (or created thing). This seems like the function of annotations.

I am for annotating a created-by for each of the resources you mention Instance, Operator, etc. However in these cases, there is less confusion over who created them... or more importantly who manages them. One could claim that an Instance can be created externally to kudo... with enough knowledge this would be true... but there wouldn't be any argument over who manages the Instance... it is created with the intent to have it managed by the kudo manager.

As we start to take on the creation of resources not owned by kudo. Cluster-wide resources, namespace, serviceaccount, crd, etc. It makes sense IMO to have a record as an annotation of "who" is managing or in joint management of these resources.

there could additionally be benefit in similar labels which can be used as selection... but that is a separate concern.

Copy link
Contributor

Choose a reason for hiding this comment

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

However in these cases, there is less confusion over who created them... or more importantly who manages them

Fair point though I disagree about "managing" part as things are generally created by the CLI and managed by the manager. In this case, we should stay consistent and also annotate I/O/OV resources.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've thought about it, and I like this annotation. Should we ever introduce kudo uninstall it might become very useful. However, let's do it consistently: we should annotate all resources created by the CLI with it:

  • all package resources such as Instance, Operator and OperatorVersion
  • all kudo init resources
    /cc @kensipe

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree... but it shouldn't need to be all in one PR right? I'll create an issue to track.
I completely agree that kudo should have an annotation on all created resources

Copy link
Contributor

@zen-dog zen-dog Jun 4, 2020

Choose a reason for hiding this comment

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

Is there a reason to split this functionality over multiple PRs? I imagine the whole thing being ~30 SLOCs

Copy link
Contributor

Choose a reason for hiding this comment

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

Just came by this PR. Why did we introduce new annotation, just wondering? Can't we use something that we already. use for all the other objects in enhancer? Like e.g. kudo.HeritageLabel ? 🤔 sorry if you already had this discussion in the past :)

Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

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

Well, as we currently add the annotation anyway, I approve this patch. Adding a constant and adding the prefix is certainly a good thing.

The general discussion about if we should add should probably happen but is unrelated to this PR

@kensipe kensipe changed the base branch from master to main June 24, 2020 00:43
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.

4 participants