Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3 from elioengcomp/fix_mutating_webhook
Browse files Browse the repository at this point in the history
Fixed image handing on mutating webhook for images with all 3 components
  • Loading branch information
rimusz authored Aug 26, 2019
2 parents bb95b8d + 32ef22a commit 7f809fc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/kubenab/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ func handleContainer(container *v1.Container, dockerRegistryUrl string) bool {
message := fmt.Sprintf("Image is not being pulled from Private Registry: %s", container.Image)
log.Printf(message)

newImage := dockerRegistryUrl + "/" + container.Image
imageParts := strings.Split(container.Image, "/")
newImage := ""
if len(imageParts) < 3 {
newImage = dockerRegistryUrl + "/" + container.Image
} else {
imageParts[0] = dockerRegistryUrl
newImage = strings.Join(imageParts, "/")
}
log.Printf("Changing image registry to: %s", newImage)

container.Image = newImage
Expand Down

0 comments on commit 7f809fc

Please # to comment.