Skip to content

Commit b153f54

Browse files
authored
[Bugfix] Fix missing Pod Status case in the RuntimeContainerImageUpdateAction (#1454)
1 parent 66d6dca commit b153f54

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- (Documentation) Move documentation from ArangoDB into this repo, update and improve structure
99
- (Documentation) Update ArangoDeployment CR auto-generated docs
1010
- (Documentation) Update ArangoBackup and ArangoBackupPolicy CR auto-generated docs
11+
- (Bugfix) Fix missing Pod Status case in the RuntimeContainerImageUpdateAction
1112

1213
## [1.2.34](https://github.com/arangodb/kube-arangodb/tree/1.2.34) (2023-10-16)
1314
- (Bugfix) Fix make manifests-crd-file command

pkg/deployment/reconcile/action_runtime_container_image_update.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -227,13 +227,8 @@ func (a actionRuntimeContainerImageUpdate) Start(ctx context.Context) (bool, err
227227
return true, nil
228228
}
229229

230-
spec := member.Spec.Template.PodSpec
231-
status := member.Status.Template.PodSpec
232-
233230
for id := range pod.Spec.Containers {
234-
if pod.Spec.Containers[id].Name != spec.Spec.Containers[id].Name ||
235-
pod.Spec.Containers[id].Name != status.Spec.Containers[id].Name ||
236-
pod.Spec.Containers[id].Name != name {
231+
if pod.Spec.Containers[id].Name != name {
237232
continue
238233
}
239234

@@ -249,10 +244,14 @@ func (a actionRuntimeContainerImageUpdate) Start(ctx context.Context) (bool, err
249244
return false, nil
250245
}
251246

247+
a.log.Info("Image is UpToDate")
248+
252249
return true, nil
253250
}
254251

255-
return true, nil
252+
a.log.Str("container", name).Str("pod", pod.GetName()).Warn("Container not found")
253+
254+
return false, errors.Newf("Container %s not found in Pod %s", name, pod.GetName())
256255
}
257256

258257
func (a actionRuntimeContainerImageUpdate) CheckProgress(ctx context.Context) (bool, bool, error) {

0 commit comments

Comments
 (0)