Skip to content

Commit f55d53f

Browse files
committed
jobs: add comment for immutability error handling
1 parent 81ba612 commit f55d53f

File tree

1 file changed

+2
-0
lines changed
  • rust/stackable-cockpit/src/utils/k8s

1 file changed

+2
-0
lines changed

rust/stackable-cockpit/src/utils/k8s/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ impl Client {
162162
// If re-applying a Job fails due to immutability, print out the failed manifests instead of erroring out,
163163
// so the user can decide if the existing Job needs a deletion and recreation
164164
match (resource.kind.as_ref(), e) {
165+
// Errors for immutability in Kubernetes do not return meaningful `code`, `status`, or `reason` to filter on
166+
// Currently we have to check the `message` for the actual error we are looking for
165167
("Job", kube::Error::Api(e)) if e.message.contains("field is immutable") => {
166168
indicatif_eprintln!(
167169
"Deploying {kind}/{object_name} manifest failed due to immutability",

0 commit comments

Comments
 (0)