Skip to content

Commit ccff73a

Browse files
committed
publish-kubebuilder-tools: ensure we ask for a v prefix, and we check for it
1 parent b40e110 commit ccff73a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tools/publish-kubebuilder-tools/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The archives are then optionally published to the release buck `openshift-kubebu
1111

1212
`-pull-secret <string>`: The path to an OpenShift pull secret file that can pull from `registry.ci.openshift.org`
1313
`-payload <string>`: The payload image that should be used to create the artifacts. This should be from the CI stream. The format will be `registry.ci.openshift.org/ocp/release:<version>`
14-
`-version <string>`: The Kubernetes version to represent in the archives. This should be the Kubernetes release version from the payload, eg `1.29.1`.
14+
`-version <string>`: The Kubernetes version to represent in the archives. This should be the Kubernetes release version from the payload with the `v` prefix specified. eg `v1.29.1`.
1515
`-output-dir <string>`: A working directory to store the archives. The binaries will be extracted here and the archives will be created here.
1616
`-skip-upload <bool>`: Skip uploading the artifacts to the GCS bucket. This can be used if you are not authenticated to GCP.
1717
`-index-file <string>`: The path to the index file that should be updated with the new archives. This is optional and will default to `./envtest-releases.yaml`.

tools/publish-kubebuilder-tools/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ func main() {
4444
panic("output is required")
4545
}
4646

47+
// We only expect Kubernetes versions that begin with the v prefix.
48+
if !strings.HasPrefix(*version, "v") {
49+
panic("Kubernetes version must begin with the v prefix. Example: v1.33.2")
50+
}
51+
4752
// Decrypt the pull secret to get the bearer token.
4853
registryAuthToken, err := getRegistryAuthToken(*pullSecretFile)
4954
if err != nil {

0 commit comments

Comments
 (0)