File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ kubectl run --image nginx nginx-1
9595vs
9696
9797``` bash
98- kubectl run --image nope nginx-1
98+ kubectl run --image nope nginx-2
9999```
100100
101101You're now done! 🧞
Original file line number Diff line number Diff line change @@ -87,13 +87,13 @@ func imagineHandler(imageName string) http.HandlerFunc {
8787 return
8888 }
8989
90- var allowed bool
91- reason := fmt . Sprintf ( "image name contains disallowed string: %s" , imageName )
90+ allowed := true
91+ reason := "Image name is allowed"
9292
9393 for _ , container := range imageReview .Spec .Containers {
94- if ! strings .Contains (container .Image , imageName ) {
95- allowed = true
96- reason = ""
94+ if strings .Contains (container .Image , imageName ) {
95+ allowed = false
96+ reason = fmt . Sprintf ( "image name contains disallowed string: %s" , imageName )
9797 break
9898 }
9999 }
You can’t perform that action at this time.
0 commit comments