Skip to content

Commit

Permalink
feat: override bundle registry with environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
boulc committed May 14, 2024
1 parent a9a5fba commit bf4fdea
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion apis/infrastructure/v1beta1/byocluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ByoClusterSpec struct {
ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"`

// BundleLookupBaseRegistry is the base Registry URL that is used for pulling byoh bundle images,
// if not set, the default will be set to docker.io/thegnoucommunity/cluster-api-byoh-bundles
// if not set, the default will be set to docker.io/thegnoucommunity/cluster-api-byoh-bundle
// +optional
BundleLookupBaseRegistry string `json:"bundleLookupBaseRegistry,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
description: ByoClusterSpec defines the desired state of ByoCluster
properties:
bundleLookupBaseRegistry:
description: BundleLookupBaseRegistry is the base Registry URL that is used for pulling byoh bundle images, if not set, the default will be set to docker.io/thegnoucommunity/cluster-api-byoh-bundles
description: BundleLookupBaseRegistry is the base Registry URL that is used for pulling byoh bundle images, if not set, the default will be set to docker.io/thegnoucommunity/cluster-api-byoh-bundle
type: string
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
description: ByoClusterSpec defines the desired state of ByoCluster
properties:
bundleLookupBaseRegistry:
description: BundleLookupBaseRegistry is the base Registry URL that is used for pulling byoh bundle images, if not set, the default will be set to docker.io/thegnoucommunity/cluster-api-byoh-bundles
description: BundleLookupBaseRegistry is the base Registry URL that is used for pulling byoh bundle images, if not set, the default will be set to docker.io/thegnoucommunity/cluster-api-byoh-bundle
type: string
controlPlaneEndpoint:
description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
Expand Down
2 changes: 1 addition & 1 deletion docs/cluster_class.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
schema:
openAPIV3Schema:
type: string
default: "docker.io/thegnoucommunity/cluster-api-byoh-bundles"
default: "docker.io/thegnoucommunity/cluster-api-byoh-bundle"
- name: controlPlaneIpAddr
required: true
schema:
Expand Down
6 changes: 3 additions & 3 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ $ cat /etc/hosts
```

If you are trying this on your own hosts, then for each host
1. Download the [byoh-hostagent-linux-amd64](https://github.com/thegnoucommunity/cluster-api-provider-bringyourownhost/releases/download/v0.3.0/byoh-hostagent-linux-amd64)
1. Download the [byoh-hostagent-linux-amd64](https://github.com/thegnoucommunity/cluster-api-provider-bringyourownhost/releases/download/v0.5.9/byoh-hostagent-linux-amd64)
2. Copy the bootstrap-kubeconfig file as `bootstrap-kubeconfig.conf`
3. Start the agent
```shell
Expand Down Expand Up @@ -206,7 +206,7 @@ Generate the cluster.yaml for workload cluster
- for vms as byohosts
```shell
CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 \
BUNDLE_LOOKUP_BASE_REGISTRY=docker.io/thegnoucommunity/cluster-api-byoh-bundles \
BUNDLE_LOOKUP_BASE_REGISTRY=docker.io/thegnoucommunity/cluster-api-byoh-bundle \
clusterctl generate cluster byoh-cluster \
--infrastructure byoh \
--kubernetes-version v1.26.6 \
Expand All @@ -217,7 +217,7 @@ Generate the cluster.yaml for workload cluster
- for docker hosts use the --flavor argument
```shell
CONTROL_PLANE_ENDPOINT_IP=10.10.10.10 \
BUNDLE_LOOKUP_BASE_REGISTRY=docker.io/thegnoucommunity/cluster-api-byoh-bundles \
BUNDLE_LOOKUP_BASE_REGISTRY=docker.io/thegnoucommunity/cluster-api-byoh-bundle \
clusterctl generate cluster byoh-cluster \
--infrastructure byoh \
--kubernetes-version v1.26.6 \
Expand Down
2 changes: 1 addition & 1 deletion docs/local_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ The current list of supported tuples of OS, kubernetes Version, BYOH Bundle Name
An example output looks like:

The corresponding bundles (particular to a patch version) should be pushed to the OCI registry of choice
By default, BYOH uses docker.io/thegnoucommunity/cluster-api-byoh-bundles
By default, BYOH uses docker.io/thegnoucommunity/cluster-api-byoh-bundle

Note: It may happen that a specific patch version of a k8s minor release is not available in the OCI registry

Expand Down
2 changes: 1 addition & 1 deletion hack/getting_started.sh
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ function createWorkloadCluster() {
calcControlPlaneIP

CONTROL_PLANE_ENDPOINT_IP=${controlPlaneEndPointIp} \
BUNDLE_LOOKUP_BASE_REGISTRY=docker.io/thegnoucommunity/cluster-api-byoh-bundles \
BUNDLE_LOOKUP_BASE_REGISTRY=docker.io/thegnoucommunity/cluster-api-byoh-bundle \
clusterctl generate cluster ${workerClusterName} \
--infrastructure byoh \
--kubernetes-version ${kubernetesVersion} \
Expand Down
1 change: 1 addition & 0 deletions test/e2e/byohost_reuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ var _ = Describe("When BYO Host rejoins the capacity pool", func() {
By("Creating a cluster")

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/cluster_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var _ = Describe("Cluster upgrade test [K8s-upgrade]", func() {
By("creating a workload cluster with one control plane node and one worker node")

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundles")
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/clusterclass_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var _ = Describe("Clusterclass upgrade test [K8s-upgrade]", func() {
By("creating a workload cluster with one control plane node and one worker node")

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundles")
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/config/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ variables:
# NOTE: INIT_WITH_BINARY is used only by the clusterctl upgrade test to initialize the management cluster to be upgraded
INIT_WITH_BINARY: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.4/clusterctl-{OS}-{ARCH}"
BUNDLE_LOOKUP_TAG: "v1.26.6"
BUNDLE_LOOKUP_BASE_REGISTRY: "docker.io/thegnoucommunity/cluster-api-byoh-bundles"
BUNDLE_LOOKUP_BASE_REGISTRY: "docker.io/thegnoucommunity/cluster-api-byoh-bundle"
CONTROL_PLANE_ENDPOINT_IP: ""
MANUAL_CSR_APPROVAL: "disable"

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_clusterclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var _ = Describe("When BYOH joins existing cluster [Cluster-Class]", func() {
}()

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundles")
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ var _ = Describe("When BYOH joins existing cluster [Installer]", func() {
}()

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundles")
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var _ = Describe("When BYOH joins existing cluster [PR-Blocking]", func() {
}()

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundles")
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/md_scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var _ = Describe("When testing MachineDeployment scale out/in", func() {
By("creating a workload cluster with one control plane node and one worker node")

setControlPlaneIP(context.Background(), dockerClient)
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundles")
os.Setenv("BUNDLE_LOOKUP_BASE_REGISTRY", "docker.io/thegnoucommunity/cluster-api-byoh-bundle")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
Expand Down

0 comments on commit bf4fdea

Please sign in to comment.