-
Notifications
You must be signed in to change notification settings - Fork 530
Remove all metadata fields but labels from targets of kf federate #1086
Remove all metadata fields but labels from targets of kf federate #1086
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marun 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:
Approvers can indicate their approval by writing |
@marun |
@xunpan Please see #1010. Annotations can no longer be set directly in the template of a federated resource due to the potential for conflict with controllers in local clusters. It's only possible to set annotations via override. To your point, though, it would make sense to log a warning indicating that annotations are being stripped so a user can take action to manually create overrides if desired. |
Updated to warn when annotations are present on the target resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previously `kubefedctl federate` removed a subset of metadata fields from the resource targeted for conversion to a federated resource. It wasn't removing annotations or finalizers despite those fields not being supported for propagation. This change ensures that all fields are removed except labels to ensure that fields set by the local cluster and its controllers are not included in the template of the new federated resource.
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Previously
kubefedctl federate
removed a subset of metadata fields from the resource targeted for conversion to a federated resource. It wasn't removingmetadata.annotations
ormetadata.finalizers
despite those fields not being supported for propagation. This change ensures that all metadata fields are removed except labels to ensure that fields set by the local cluster and its controllers are not included in the template of the new federated resource.