diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 028320cb..5ed8a4bc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v2 - id: get_version run: | - RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p') + RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/v!!p') echo "::set-output name=release_version::$RELEASE_VERSION" - name: Prepare all release files for the provider run: | diff --git a/README.md b/README.md index c95a1b1c..9b25d9f2 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ In the example commands below, the HELM_VALUES variable will be populated with t ```shell export CLUSTER_NAME=vcluster export CLUSTER_NAMESPACE=vcluster -export KUBERNETES_VERSION=1.24 +export KUBERNETES_VERSION=1.24.0 export HELM_VALUES=$(cat devvalues.yaml | sed -z 's/\n/\\n/g') kubectl create namespace ${CLUSTER_NAMESPACE} clusterctl generate cluster ${CLUSTER_NAME} \ @@ -95,7 +95,7 @@ In the example commands below, the HELM_VALUES variable will be populated with t ```shell export CLUSTER_NAME=test export CLUSTER_NAMESPACE=test -export KUBERNETES_VERSION=1.24 +export KUBERNETES_VERSION=1.24.0 export HELM_VALUES=$(cat devvalues.yaml | sed -z 's/\n/\\n/g') kubectl create namespace ${CLUSTER_NAMESPACE} cat templates/cluster-template.yaml | ./bin/envsubst | kubectl apply -n ${CLUSTER_NAMESPACE} -f - diff --git a/config/default/manager_image_patch.yaml b/config/default/manager_image_patch.yaml index 84c13c92..0f998681 100644 --- a/config/default/manager_image_patch.yaml +++ b/config/default/manager_image_patch.yaml @@ -8,5 +8,5 @@ spec: spec: containers: # Change the value of image field below to your controller image URL - - image: loftsh/cluster-api-provider-vcluster:main + - image: docker.io/loftsh/cluster-api-provider-vcluster:main name: manager diff --git a/controllers/vcluster_controller.go b/controllers/vcluster_controller.go index 6a093a63..ce23e578 100644 --- a/controllers/vcluster_controller.go +++ b/controllers/vcluster_controller.go @@ -264,6 +264,10 @@ func (r *VClusterReconciler) redeployIfNeeded(ctx context.Context, vCluster *v1a if len(v) == 2 { kVersion.Major = v[0] kVersion.Minor = v[1] + } else if len(v) == 3 { + kVersion.Major = v[0] + kVersion.Minor = v[1] + r.Log.Infof("vclusters %s/%s patch version defined in .spec.kubernetesVersion field will be ignored, latest supported patch version will be used", vCluster.Namespace, vCluster.Name) } else { return fmt.Errorf("invalid value of the .spec.kubernetesVersion field: %s", *vCluster.Spec.KubernetesVersion) } diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 49b96550..8e2db6f0 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -15,7 +15,7 @@ metadata: spec: kubernetesVersion: "${KUBERNETES_VERSION:=}" helmRelease: - values: "${HELM_VALUES:=""}" + values: "${HELM_VALUES:=}" chart: name: ${CHART_NAME:=null} repo: ${CHART_REPO:=null}