jfrog / charts

JFrog official Helm Charts
https://jfrog.com/integration/helm-repository/
Apache License 2.0
260 stars 447 forks source link

Invalid Stateful set label created if using non-default image registry port #1869

Closed lancew-q closed 3 months ago

lancew-q commented 7 months ago

Is this a request for help?:


Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug report

Version of Helm and Kubernetes: Helm Version:

version.BuildInfo{Version:"v3.12.1", GitCommit:"f32a527a060157990e2aa86bf45010dfb3cc8b8d", GitTreeState:"clean", GoVersion:"go1.20.5"}

K8s version: N/A

Which chart: stable/artifactory-ha

Which product license (Enterprise/Pro/oss): Enterprise

JFrog support reference (if already raised with support team): None

What happened: Using chart with a docker registry on non-standard port creates invalid statefulset metadata labels

What you expected to happen: I expect it to be able to handle registries that don't run on the default port.

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

artifactory:
  image: 
    registry: some-registry.com:5001
    repository: my-custom-repo

Helm Dry run output:

---
# Source: artifactory-ha/templates/artifactory-primary-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: my-artifactory-artifactory-ha-primary
  labels:
    app: artifactory-ha
    chart: artifactory-ha-107.77.5
    component: artifactory-ha
    version: 5001/my-custom-repo
    heritage: Helm

Helm Upgrade error:

Error: UPGRADE FAILED: cannot patch "my-artifactory-artifactory-ha-primary" with kind StatefulSet: StatefulSet.apps "my-artifactory-artifactory-ha-primary" is invalid: metadata.labels: Invalid value: "5001/my-custom-repo": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')

Anything else we need to know:

edit: Updated for accuracy

gitta-jfrog commented 3 months ago

Hi

This issue was fixed. It is available as part of Artifactory 7.84.16 (Chart version 107.84.16) release or 7.90.5 release. (chart version 107.90.5)