Closed ultram4rine closed 4 months ago
Btw, what is going on here: https://github.com/k8sgpt-ai/k8sgpt-operator/blob/db04fbdf23bdeeaa1053af1f578a7f3bcf7e0ca0/controllers/k8sgpt_controller.go#L175-L179
If image repo is not the same as in K8sGPT
CRD, it leaves it as is and updates only version.
Maybe it should update image repo to k8sgptConfig.Spec.Repository
?
Btw, what is going on here:
If image repo is not the same as in
K8sGPT
CRD, it leaves it as is and updates only version.Maybe it should update image repo to
k8sgptConfig.Spec.Repository
?
yes that looks wrong :+1:
Checklist
Affected Components
K8sGPT Version
v0.3.8
Kubernetes Version
v1.28.0
Host OS and its Version
No response
Steps to reproduce
Include port in repository in
K8sGPT
object like<host>:<port>/<path>/<image>
.Expected behaviour
Operator will create a deployment with normal image.
Actual behaviour
Operator will turn image in
<host>:<tag>
, thus result intoImagePullBackOff
.Additional Information
I've found the lines were this happens: https://github.com/k8sgpt-ai/k8sgpt-operator/blob/db04fbdf23bdeeaa1053af1f578a7f3bcf7e0ca0/controllers/k8sgpt_controller.go#L168-L180
Quick solution is to parse image like this:
or
Possible better solution is to use maybe
net/url
or some other lib.Test: https://go.dev/play/p/nIFGk2QroT5