Skip to content

Commit

Permalink
fix(k8s): handle AEC-paused resources properly
Browse files Browse the repository at this point in the history
This is a follow-up quickfix for #4846.
It reads a specific annotation and checks if it has a special value set by Cloud.
This needs to be changed to reply on a more generic and reliable way of k8s resource comparison.
  • Loading branch information
vvagaytsev committed Sep 25, 2023
1 parent c9225ef commit f41fc05
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/src/plugins/kubernetes/kubernetes-type/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,16 @@ async function getResourceStatuses({
metadata: { name: m.name, namespace: m.namespace },
}
return { resource: missingResource, state: "missing" } as ResourceStatus
} else {
return await resolveResourceStatus({ api, namespace, resource, log })
}

// Check if AEC has paused the resource
const manifestHashAnnotationKey = gardenAnnotationKey("manifest-hash")
const manifestHash = resource.metadata?.annotations?.[manifestHashAnnotationKey]
if (manifestHash === "paused-by-aec") {
return { resource, state: "outdated" } as ResourceStatus
}

return await resolveResourceStatus({ api, namespace, resource, log })
})
)
}
Expand Down

0 comments on commit f41fc05

Please sign in to comment.