Skip to content

Commit

Permalink
update ks-core helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
ks-ci-bot committed Mar 13, 2024
1 parent 8ea1176 commit b450df0
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/test/ks-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ spec:
type: string
type: object
type: array
pullUrl:
type: string
versionName:
type: string
required:
Expand Down
4 changes: 4 additions & 0 deletions src/test/ks-core/crds/kubesphere.io_extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ spec:
- type
type: object
type: array
enabled:
type: boolean
installedVersion:
type: string
plannedInstallVersion:
type: string
recommendedVersion:
Expand Down
2 changes: 1 addition & 1 deletion src/test/ks-core/crds/kubesphere.io_extensionversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/test/ks-core/crds/kubesphere.io_installplans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ spec:
- type
type: object
type: array
enabled:
type: boolean
jobName:
type: string
releaseName:
Expand Down
16 changes: 16 additions & 0 deletions src/test/ks-core/scripts/post-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`
Expand Down
3 changes: 3 additions & 0 deletions src/test/ks-core/templates/ks-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/test/ks-core/templates/post-delete-job.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $kubeVersion := .Capabilities.KubeVersion }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -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 }}

---
Expand Down Expand Up @@ -67,6 +77,7 @@ spec:
- /bin/bash
- /scripts/post-delete.sh
- '{{ join " " $crdNameList }}'
- /scripts/map.yaml
volumeMounts:
- mountPath: /scripts
name: scripts
Expand Down
33 changes: 0 additions & 33 deletions src/test/ks-core/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b450df0

Please sign in to comment.