Skip to content

Commit

Permalink
Merge pull request #184 from mrlihanbo/refactor/add-source-object-info
Browse files Browse the repository at this point in the history
feat: add resource gvk info in federatedobject label
  • Loading branch information
limhawjia authored Jul 28, 2023
2 parents 0e385a7 + adf4a07 commit d28244f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controllers/federate/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func newFederatedObjectForSourceObject(
// the FederatedObject's template.

federatedLabels, templateLabels := classifyLabels(sourceObj.GetLabels())
federatedLabels[sourceObj.GetAPIVersion()] = sourceObj.GetKind()

// Classify annotations into annotations that should be copied onto the FederatedObject and labels that should be
// copied onto the FederatedObject's template.
Expand Down Expand Up @@ -163,6 +164,7 @@ func updateFederatedObjectForSourceObject(
// the FederatedObject's template and update the FederatedObject's template.

federatedLabels, templateLabels := classifyLabels(sourceObject.GetLabels())
federatedLabels[sourceObject.GetAPIVersion()] = sourceObject.GetKind()
if !equality.Semantic.DeepEqual(federatedLabels, fedObject.GetLabels()) {
fedObject.SetLabels(federatedLabels)
isUpdated = true
Expand Down

0 comments on commit d28244f

Please sign in to comment.