kubernetes-sigs / kubebuilder-declarative-pattern

A toolkit for building declarative operators with kubebuilder
Apache License 2.0
254 stars 84 forks source link

Introduce setters for name and namespace #212

Closed justinsb closed 2 years ago

justinsb commented 2 years ago

This allows changing them - in particular setting the namespace. Without this if the Namespace field was changed, it would not be reflected in the underlying object.

This is also more similar to unstructured.Unstructured, which we are modelling after.

Also proposing that we think of this as the first breaking change for 0.12. We can continue to cherry-pick back to 0.11 though!

k8s-ci-robot commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/OWNERS)~~ [justinsb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
atoato88 commented 2 years ago

CI test failed because we need update some place to use new getter. I checked this codebase on my local, and create commit on my fork to fix test failure. So please check that.

atoato88 commented 2 years ago

Except for my comment above, it's LGTM :smile:

justinsb commented 2 years ago

Thanks @atoato88 - I merged in your changes and marked you as a co-author :-)

atoato88 commented 2 years ago

/lgtm Thank you to update!