Skip to content

Commit

Permalink
fix #432 don't compare when object kind doesn't match kind in last-ap…
Browse files Browse the repository at this point in the history
…plied-configuration (#542)

Co-authored-by: Ryan <ryanisfluffy@users.noreply.github.com>
  • Loading branch information
bbensky and ryanisfluffy authored Jun 14, 2024
1 parent 94d3aca commit 59abfcf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/discovery-api/discovery_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (cl *DiscoveryClient) GetApiResources() error {
klog.Errorf("failed to parse 'last-applied-configuration' annotation of resource %s/%s: %s", r.GetNamespace(), r.GetName(), err.Error())
continue
}
if r.Object["kind"] != manifest["kind"] {
klog.V(2).Infof("Object Kind %s does not match last-applied-configuration-kind %s. Skipping", r.Object["kind"], manifest["kind"])
continue
}
data, err := json.Marshal(manifest)
if err != nil {
klog.Error("Failed to marshal data ", err.Error())
Expand Down

0 comments on commit 59abfcf

Please sign in to comment.