From b450df0cde7b2249d1d1f9eedffed842196cff4a Mon Sep 17 00:00:00 2001 From: ci-bot Date: Wed, 13 Mar 2024 04:14:11 +0000 Subject: [PATCH] update ks-core helm chart --- src/test/ks-core/Chart.yaml | 2 +- ...ion.kubesphere.io_applicationreleases.yaml | 9 ++--- ...ion.kubesphere.io_applicationversions.yaml | 2 ++ .../crds/kubesphere.io_extensions.yaml | 4 +++ .../crds/kubesphere.io_extensionversions.yaml | 2 +- .../crds/kubesphere.io_installplans.yaml | 2 ++ src/test/ks-core/scripts/post-delete.sh | 16 +++++++++ src/test/ks-core/templates/ks-agent.yml | 3 ++ .../ks-core/templates/post-delete-job.yaml | 11 +++++++ src/test/ks-core/templates/webhook.yaml | 33 ------------------- 10 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/test/ks-core/Chart.yaml b/src/test/ks-core/Chart.yaml index 4378bb5a6..4d6819d9e 100644 --- a/src/test/ks-core/Chart.yaml +++ b/src/test/ks-core/Chart.yaml @@ -7,7 +7,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.6.10 +version: 0.6.11 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/src/test/ks-core/crds/application.kubesphere.io_applicationreleases.yaml b/src/test/ks-core/crds/application.kubesphere.io_applicationreleases.yaml index de13b99cc..9d27b83de 100644 --- a/src/test/ks-core/crds/application.kubesphere.io_applicationreleases.yaml +++ b/src/test/ks-core/crds/application.kubesphere.io_applicationreleases.yaml @@ -83,10 +83,7 @@ spec: status: description: ApplicationReleaseStatus defines the observed state of ApplicationRelease properties: - jobName: - type: string - lastDeployed: - format: date-time + installJobName: type: string lastUpdate: format: date-time @@ -103,11 +100,11 @@ spec: type: string type: array specHash: - description: This is used to compare whether the spec has been modified - to determine if an upgrade is needed. type: string state: type: string + uninstallJobName: + type: string required: - state type: object diff --git a/src/test/ks-core/crds/application.kubesphere.io_applicationversions.yaml b/src/test/ks-core/crds/application.kubesphere.io_applicationversions.yaml index ce416aae9..020bcb967 100644 --- a/src/test/ks-core/crds/application.kubesphere.io_applicationversions.yaml +++ b/src/test/ks-core/crds/application.kubesphere.io_applicationversions.yaml @@ -84,6 +84,8 @@ spec: type: string type: object type: array + pullUrl: + type: string versionName: type: string required: diff --git a/src/test/ks-core/crds/kubesphere.io_extensions.yaml b/src/test/ks-core/crds/kubesphere.io_extensions.yaml index 655d2fec3..9579c30e1 100644 --- a/src/test/ks-core/crds/kubesphere.io_extensions.yaml +++ b/src/test/ks-core/crds/kubesphere.io_extensions.yaml @@ -252,6 +252,10 @@ spec: - type type: object type: array + enabled: + type: boolean + installedVersion: + type: string plannedInstallVersion: type: string recommendedVersion: diff --git a/src/test/ks-core/crds/kubesphere.io_extensionversions.yaml b/src/test/ks-core/crds/kubesphere.io_extensionversions.yaml index 294938832..0ca41e9f4 100644 --- a/src/test/ks-core/crds/kubesphere.io_extensionversions.yaml +++ b/src/test/ks-core/crds/kubesphere.io_extensionversions.yaml @@ -95,7 +95,7 @@ spec: description: Indicates if the dependency is required type: boolean type: - description: Type of dependency, default to extension + description: Type of dependency, defaults to extension type: string version: description: SemVer diff --git a/src/test/ks-core/crds/kubesphere.io_installplans.yaml b/src/test/ks-core/crds/kubesphere.io_installplans.yaml index 442471d49..cd163f4a2 100644 --- a/src/test/ks-core/crds/kubesphere.io_installplans.yaml +++ b/src/test/ks-core/crds/kubesphere.io_installplans.yaml @@ -300,6 +300,8 @@ spec: - type type: object type: array + enabled: + type: boolean jobName: type: string releaseName: diff --git a/src/test/ks-core/scripts/post-delete.sh b/src/test/ks-core/scripts/post-delete.sh index c5d5f6184..fb4666438 100755 --- a/src/test/ks-core/scripts/post-delete.sh +++ b/src/test/ks-core/scripts/post-delete.sh @@ -3,6 +3,22 @@ # set -x CRD_NAMES=$1 +MAPPING_CONFIG=$2 + +for extension in `kubectl get extension | grep 'Installed' | awk '{print $1}'` +do + version=$(kubectl get extension $extension -o=jsonpath='{.status.installedVersion}') + extensionversion=$extension-$version + echo "Found extension $extensionversion installed" + helm status $extension --namespace extension-$extension + if [ $? -eq 0 ]; then + helm mapkubeapis $extension --namespace extension-$extension --mapfile $MAPPING_CONFIG + fi + helm status $extension-agent --namespace extension-$extension + if [ $? -eq 0 ]; then + helm mapkubeapis $extension-agent --namespace extension-$extension --mapfile $MAPPING_CONFIG + fi +done # delete crds for crd in `kubectl get crds -o jsonpath="{.items[*].metadata.name}"` diff --git a/src/test/ks-core/templates/ks-agent.yml b/src/test/ks-core/templates/ks-agent.yml index c187f9486..0bb0efe92 100644 --- a/src/test/ks-core/templates/ks-agent.yml +++ b/src/test/ks-core/templates/ks-agent.yml @@ -22,6 +22,9 @@ spec: tier: backend template: metadata: + annotations: + # force restart ks-agent after the upgrade is complete (even if there is no update) + kubesphere.io/update-time: {{ dateInZone "2006-01-02T15:05:05Z" (now) "UTC"| quote }} labels: app: ks-agent tier: backend diff --git a/src/test/ks-core/templates/post-delete-job.yaml b/src/test/ks-core/templates/post-delete-job.yaml index 4a7e7d9ea..79096dd73 100644 --- a/src/test/ks-core/templates/post-delete-job.yaml +++ b/src/test/ks-core/templates/post-delete-job.yaml @@ -1,3 +1,4 @@ +{{- $kubeVersion := .Capabilities.KubeVersion }} apiVersion: v1 kind: ConfigMap metadata: @@ -7,6 +8,15 @@ metadata: "helm.sh/hook-weight": "-1" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed data: + map.yaml: | + mappings: + {{- range $path, $_ := .Files.Glob "crds/**" }} + {{- $crd := $.Files.Get $path | fromYaml }} + {{- range $_, $version := $crd.spec.versions }} + - deprecatedAPI: "apiVersion: {{ $crd.spec.group }}/{{ $version.name }}\nkind: {{ $crd.spec.names.kind }}\n" + removedInVersion: "{{ $kubeVersion }}" + {{- end }} + {{- end }} {{ (.Files.Glob "scripts/post-delete.sh").AsConfig | indent 2 }} --- @@ -67,6 +77,7 @@ spec: - /bin/bash - /scripts/post-delete.sh - '{{ join " " $crdNameList }}' + - /scripts/map.yaml volumeMounts: - mountPath: /scripts name: scripts diff --git a/src/test/ks-core/templates/webhook.yaml b/src/test/ks-core/templates/webhook.yaml index 0349452db..0c3d05113 100644 --- a/src/test/ks-core/templates/webhook.yaml +++ b/src/test/ks-core/templates/webhook.yaml @@ -249,40 +249,7 @@ webhooks: timeoutSeconds: 30 --- -apiVersion: admissionregistration.k8s.io/v1 -kind: MutatingWebhookConfiguration -metadata: - name: applicationreleases.application.kubesphere.io -webhooks: - - admissionReviewVersions: - - v1 - clientConfig: - caBundle: {{ b64enc $ca.Cert | quote }} - service: - name: ks-controller-manager - namespace: kubesphere-system - path: /mutate-application-kubesphere-io-v2-applicationrelease - port: 443 - failurePolicy: Fail - matchPolicy: Exact - name: applicationreleases.application.kubesphere.io - namespaceSelector: {} - objectSelector: {} - rules: - - apiGroups: - - application.kubesphere.io - apiVersions: - - v2 - operations: - - CREATE - - UPDATE - resources: - - applicationreleases - scope: '*' - sideEffects: None - timeoutSeconds: 30 ---- apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: