Skip to content

Commit 59abfcf

Browse files
fix #432 don't compare when object kind doesn't match kind in last-applied-configuration (#542)
Co-authored-by: Ryan <ryanisfluffy@users.noreply.github.com>
1 parent 94d3aca commit 59abfcf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/discovery-api/discovery_api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ func (cl *DiscoveryClient) GetApiResources() error {
145145
klog.Errorf("failed to parse 'last-applied-configuration' annotation of resource %s/%s: %s", r.GetNamespace(), r.GetName(), err.Error())
146146
continue
147147
}
148+
if r.Object["kind"] != manifest["kind"] {
149+
klog.V(2).Infof("Object Kind %s does not match last-applied-configuration-kind %s. Skipping", r.Object["kind"], manifest["kind"])
150+
continue
151+
}
148152
data, err := json.Marshal(manifest)
149153
if err != nil {
150154
klog.Error("Failed to marshal data ", err.Error())

0 commit comments

Comments
 (0)