-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loop over init containers as well #96
loop over init containers as well #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asad-awadia Thanks again for your contribution. Just some minor changes before I am going to merge it.
pkg/webhook/image_swapper.go
Outdated
|
||
for i, container := range pod.Spec.Containers { | ||
p.replaceContainerImages(lctx, ar, pod, pod.Spec.Containers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.replaceContainerImages(lctx, ar, pod, pod.Spec.Containers) | |
p.processContainers(lctx, ar, pod, pod.Spec.Containers) |
pkg/webhook/image_swapper.go
Outdated
|
||
for i, container := range pod.Spec.Containers { | ||
p.replaceContainerImages(lctx, ar, pod, pod.Spec.Containers) | ||
p.replaceContainerImages(lctx, ar, pod, pod.Spec.InitContainers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.replaceContainerImages(lctx, ar, pod, pod.Spec.InitContainers) | |
p.processContainers(lctx, ar, pod, pod.Spec.InitContainers) |
pkg/webhook/image_swapper.go
Outdated
return false, nil | ||
} | ||
|
||
func (p *ImageSwapper) replaceContainerImages(lctx context.Context, ar *v1beta1.AdmissionRequest, pod *corev1.Pod, containers []corev1.Container) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (p *ImageSwapper) replaceContainerImages(lctx context.Context, ar *v1beta1.AdmissionRequest, pod *corev1.Pod, containers []corev1.Container) { | |
func (p *ImageSwapper) processContainers(lctx context.Context, ar *v1beta1.AdmissionRequest, pod *corev1.Pod, containers []corev1.Container) { |
@estahn pushed |
Codecov Report
@@ Coverage Diff @@
## main #96 +/- ##
==========================================
- Coverage 14.81% 14.67% -0.14%
==========================================
Files 2 2
Lines 108 109 +1
==========================================
Hits 16 16
- Misses 90 91 +1
Partials 2 2
Continue to review full report at Codecov.
|
@asad-awadia CI fails with If you sync with latest |
@estahn yeah - idk what to do with the two returns of process container we need to return the response from the last one which has the updated pod |
should I just assign to _ ? |
make test doesn't work |
This says you're missing the devmapper libs. See what to install here:
|
Yes - I tried this before too
doesn't work either .. |
@estahn can you run CI again |
@asad-awadia Thanks for your contribution, however, I decided to implement it in a different way. The feature should be available in 1.1.x. |
# [1.1.0](v1.0.0...v1.1.0) (2021-10-02) ### Bug Fixes * provide log record for ImageSwapPolicyExists ([179da70](179da70)) * timeout for ECR client ([26bdc10](26bdc10)) * **deps:** update module github.com/alitto/pond to v1.5.1 ([504e2dd](504e2dd)) * **deps:** update module github.com/aws/aws-sdk-go to v1.38.47 ([#70](#70)) ([4f30053](4f30053)) * **deps:** update module github.com/aws/aws-sdk-go to v1.40.43 ([266ef01](266ef01)) * **deps:** update module github.com/containers/image/v5 to v5.11.0 ([#61](#61)) ([11d6d28](11d6d28)) * **deps:** update module github.com/containers/image/v5 to v5.16.0 ([5230b91](5230b91)) * **deps:** update module github.com/dgraph-io/ristretto to v0.1.0 ([#82](#82)) ([dff1cb1](dff1cb1)) * **deps:** update module github.com/go-co-op/gocron to v1.9.0 ([c0e9f11](c0e9f11)) * **deps:** update module github.com/rs/zerolog to v1.22.0 ([#76](#76)) ([c098326](c098326)) * **deps:** update module github.com/rs/zerolog to v1.23.0 ([#84](#84)) ([607d5bb](607d5bb)) * **deps:** update module github.com/rs/zerolog to v1.25.0 ([72822f4](72822f4)) * **deps:** update module github.com/slok/kubewebhook to v2 ([8bd73d4](8bd73d4)) * **deps:** update module github.com/spf13/cobra to v1.2.1 ([ea1e787](ea1e787)) * **deps:** update module github.com/spf13/viper to v1.8.1 ([8a055a2](8a055a2)) * **deps:** update module k8s.io/api to v0.22.1 ([ab6d898](ab6d898)) * **deps:** update module k8s.io/apimachinery to v0.21.1 ([#79](#79)) ([aeeeffb](aeeeffb)) * **deps:** update module k8s.io/apimachinery to v0.22.2 ([ef72c66](ef72c66)) ### Features * Support for imagePullSecrets ([#112](#112)) ([2d8cf77](2d8cf77)), closes [#92](#92) [#19](#19) * Support for pod.spec.initContainers ([#118](#118)) ([725ff2c](725ff2c)), closes [#73](#73) [#96](#96)
No description provided.