Skip to content

Commit

Permalink
fix: provide log record for ImageSwapPolicyExists
Browse files Browse the repository at this point in the history
A log was written if the image existed, now a log is generated if the image does not exist.
  • Loading branch information
estahn committed Sep 30, 2021
1 parent 26bdc10 commit 179da70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/webhook/image_swapper.go
Expand Up @@ -241,6 +241,8 @@ func (p *ImageSwapper) Mutate(ctx context.Context, ar *kwhmodel.AdmissionReview,
if p.registryClient.ImageExists(targetImage) {
log.Ctx(lctx).Debug().Str("image", targetImage).Msg("set new container image")
pod.Spec.Containers[i].Image = targetImage
} else {
log.Ctx(lctx).Debug().Str("image", targetImage).Msg("container image not found in target registry, not swapping")
}
default:
panic("unknown imageSwapPolicy")
Expand Down

0 comments on commit 179da70

Please sign in to comment.