Skip to content

Commit

Permalink
fix: image tag and k8s version param
Browse files Browse the repository at this point in the history
  • Loading branch information
matskiv committed May 6, 2022
1 parent 4ed4be7 commit c08c88c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down Expand Up @@ -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 -
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions controllers/vcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit c08c88c

Please sign in to comment.