oauth2-proxy / manifests

For hosting manifests to allow for the deployment of OAuth2-Proxy/OAuth2-Proxy
Apache License 2.0
170 stars 153 forks source link

initContainer generates `InvalidImageName` error with K8s 1.25+ #155

Closed zfalen-deloitte closed 1 year ago

zfalen-deloitte commented 1 year ago

Resultant error: Failed to apply default image tag "docker.io/bitnami/kubectl:1.25+": couldn't parse image reference "docker.io/bitnami/kubectl:1.25+": invalid reference format

https://github.com/oauth2-proxy/manifests/blob/0f70377fd2c07bce4588b2deefab71b76cadf83a/helm/oauth2-proxy/templates/deployment.yaml#L63

This line seems to be the culprit. The Capabilities.KubeVersion.Minor reference produces 1.25+ which results in the invalid image tag docker.io/bitnami/kubectl:1.25+

Suggest using something like the regexReplaceAll function to parse out invalid characters for edge cases like this. https://helm.sh/docs/chart_template_guide/function_list/#regexreplaceall-mustregexreplaceall


Using EKS 1.25. Output of kubectl version is as follows

Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.9", GitCommit:"a1a87a0a2bcd605820920c6b0e618a8ab7d117d4", GitTreeState:"clean", BuildDate:"2023-04-12T12:16:51Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.7

Server Version: version.Info{Major:"1", Minor:"25+", GitVersion:"v1.25.11-eks-a5565ad", GitCommit:"df109513ba589adaee235b4e658476275d1fde31", GitTreeState:"clean", BuildDate:"2023-06-16T17:35:00Z", GoVersion:"go1.19.10", Compiler:"gc", Platform:"linux/amd64"}
pierluigilenoci commented 1 year ago

@zfalen-deloitte this is an EKS bug that provides the wrong information. I'll try to create a workaround, but it isn't enjoyable. 😞

pierluigilenoci commented 1 year ago

@zfalen-deloitte, could you please test the newer version?

zfalen-deloitte commented 1 year ago

@pierluigilenoci confirmed working with 6.15.1