Skip to content
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

grafanaImage change breaks when repository on custom port #1439

Closed
vanveele opened this issue Oct 17, 2021 · 3 comments
Closed

grafanaImage change breaks when repository on custom port #1439

vanveele opened this issue Oct 17, 2021 · 3 comments
Labels

Comments

@vanveele
Copy link

What happened?

Change introduced in PR breaks when parsing image repositories which are using custom ports.
Images of the form dockerrepo.example.com:5000/grafana/grafana:8.1.1 are incorrectly parsed and result in a deployment manifest with image: dockerrepo.example.com:8.1.1
The change is splitting on all ':' characters (line 46) and selecting the first field. Correct parsing would split on the right-most ':' and then select the first field.

Did you expect to see some different?

A properly parsed image value would result in a deployment with image: dockerrepo.example.com:5000/grafana/grafana:8.1.1

How to reproduce it (as minimally and precisely as possible):

local kp = 
  (import 'kube-prometheus/main.libsonnet') +
  {
    values+:: {
      common+: {
        images+:: {
          grafana: 'dockerrepo.example.com:5000/grafana/grafana:8.1.1',
        },
      },
    },
  }

kp.grafana['deployment']

Environment

  • Prometheus Operator version:

    release-0.9

  • Kubernetes version information:

    v0.49.0

  • Kubernetes cluster kind:

    insert how you created your cluster: kops, bootkube, tectonic-installer, etc.

  • Manifests:

local kp =
  (import 'kube-prometheus/main.libsonnet') +
  {
    values+:: {
      common+: {
        images+:: {
          grafana: 'dockerrepo.example.com/grafana/grafana:8.1.1',
        },
      },
    },
  };

kp.grafana["deployment"]
  • Prometheus Operator Logs:

N/A

  • Prometheus Logs:

N/A

Anything else we need to know?:

@vanveele
Copy link
Author

An inelegant but functional fix:

      imageRepos+:: {
        grafana: std.join(":", (std.reverse(std.reverse(std.split(g._config.image, ':'))[1:]))),
      },

@paulfantom
Copy link
Member

Will be fixed by #1450

@philipgough
Copy link
Contributor

Closing since #1450 has merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants