kubernetes-sigs/cluster-api

Fields that are taking URLs or OCI registry paths should validate for correctness

オープン

#7,257 opened on 2022/09/21

 (16 件のコメント) (2 件のリアクション) (0 人の担当者)Go (1,532 件のフォーク)auto 404
help wantedkind/buglifecycle/frozenpriority/backlogtriage/accepted

Repository metrics

Stars
 (4,267 個のスター)
PR merge metrics
 (PR metrics pending)

説明

What steps did you take and what happened: [A clear and concise description on how to REPRODUCE the bug.]

Use a kubeadmControlPlane with the following

spec:
  kubeadmConfigSpec:
    clusterConfiguration:
        dns:
          imageRepository: |
            registry.contoso.com/kubernetes
                 s
       ...

The image repository then has a new line character in it. This is currently treated as valid, but should be rejected, and the end result is that the user may not know they've something wrong until the KCP machine fails to boot.

What did you expect to happen:

Anywhere we are reading an OCI registry or a http URL, we should verify that these are valid for URI paths. There's parsing functions in the Go std library under URL as well as functions in docker/distribution/reference.

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api version: v1.2.2
  • minikube/kind version: N/A
  • Kubernetes version: (use kubectl version): N/A
  • OS (e.g. from /etc/os-release): N/A

/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

コントリビューターガイド