1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Bugfix] Fix missing Pod Status case in the RuntimeContainerImageUpdateAction (#1454)

This commit is contained in:
Adam Janikowski 2023-10-20 13:46:30 +02:00 committed by GitHub
parent 66d6dca7b9
commit b153f54fc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -8,6 +8,7 @@
- (Documentation) Move documentation from ArangoDB into this repo, update and improve structure
- (Documentation) Update ArangoDeployment CR auto-generated docs
- (Documentation) Update ArangoBackup and ArangoBackupPolicy CR auto-generated docs
- (Bugfix) Fix missing Pod Status case in the RuntimeContainerImageUpdateAction
## [1.2.34](https://github.com/arangodb/kube-arangodb/tree/1.2.34) (2023-10-16)
- (Bugfix) Fix make manifests-crd-file command

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// 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
return true, nil
}
spec := member.Spec.Template.PodSpec
status := member.Status.Template.PodSpec
for id := range pod.Spec.Containers {
if pod.Spec.Containers[id].Name != spec.Spec.Containers[id].Name ||
pod.Spec.Containers[id].Name != status.Spec.Containers[id].Name ||
pod.Spec.Containers[id].Name != name {
if pod.Spec.Containers[id].Name != name {
continue
}
@ -249,10 +244,14 @@ func (a actionRuntimeContainerImageUpdate) Start(ctx context.Context) (bool, err
return false, nil
}
a.log.Info("Image is UpToDate")
return true, nil
}
return true, nil
a.log.Str("container", name).Str("pod", pod.GetName()).Warn("Container not found")
return false, errors.Newf("Container %s not found in Pod %s", name, pod.GetName())
}
func (a actionRuntimeContainerImageUpdate) CheckProgress(ctx context.Context) (bool, bool, error) {