diff --git a/src/test/ks-core/scripts/post-delete.sh b/src/test/ks-core/scripts/post-delete.sh index 414bc0a96..f6a2a10e0 100755 --- a/src/test/ks-core/scripts/post-delete.sh +++ b/src/test/ks-core/scripts/post-delete.sh @@ -1,11 +1,13 @@ #!/usr/bin/env bash -set -x +# set -x + +CRD_NAMES=$1 # delete crds for crd in `kubectl get crds -o jsonpath="{.items[*].metadata.name}"` do - if [[ $crd == *kubesphere.io ]]; then + if [[ ${CRD_NAMES[@]/${crd}/} != ${CRD_NAMES[@]} ]]; then scop=$(eval echo $(kubectl get crd ${crd} -o jsonpath="{.spec.scope}")) if [[ $scop =~ "Namespaced" ]] ; then kubectl get $crd -A --no-headers | awk '{print $1" "$2" ""'$crd'"}' | xargs -n 3 sh -c 'kubectl patch $2 -n $0 $1 -p "{\"metadata\":{\"finalizers\":null}}" --type=merge 2>/dev/null && kubectl delete $2 -n $0 $1 2>/dev/null' diff --git a/src/test/ks-core/templates/extension-categories.yaml b/src/test/ks-core/templates/extension-categories.yaml index 3e8d3f807..517e692c9 100644 --- a/src/test/ks-core/templates/extension-categories.yaml +++ b/src/test/ks-core/templates/extension-categories.yaml @@ -33,11 +33,11 @@ spec: apiVersion: kubesphere.io/v1alpha1 kind: Category metadata: - name: monitoring-logging + name: observability spec: displayName: - en: Monitoring and logging - zh: 监控和日志 + en: Observability + zh: 可观测性 --- apiVersion: kubesphere.io/v1alpha1 diff --git a/src/test/ks-core/templates/globalrolebingings.yaml b/src/test/ks-core/templates/globalrolebingings.yaml index 503a4d80f..cf52b1b11 100644 --- a/src/test/ks-core/templates/globalrolebingings.yaml +++ b/src/test/ks-core/templates/globalrolebingings.yaml @@ -4,7 +4,7 @@ metadata: labels: iam.kubesphere.io/role-ref: platform-admin iam.kubesphere.io/user-ref: admin - name: admin-platform-admin + name: admin roleRef: apiGroup: iam.kubesphere.io kind: GlobalRole diff --git a/src/test/ks-core/templates/globalroles.yaml b/src/test/ks-core/templates/globalroles.yaml index 0d299f3a9..41f7646dd 100644 --- a/src/test/ks-core/templates/globalroles.yaml +++ b/src/test/ks-core/templates/globalroles.yaml @@ -7,11 +7,17 @@ rules: - /dist/* verbs: - GET + - nonResourceURLs: + - /static/images/* + verbs: + - GET --- apiVersion: iam.kubesphere.io/v1beta1 kind: GlobalRole metadata: + labels: + iam.kubesphere.io/auto-aggregate: "true" annotations: iam.kubesphere.io/rego-override: |- package authz @@ -39,6 +45,11 @@ metadata: allowedVerbs[_] == input.Verb } name: authenticated +aggregationRoleTemplates: + roleSelector: + matchLabels: + iam.kubesphere.io/aggregate-to-authenticated: "" + iam.kubesphere.io/scope: "global" rules: - apiGroups: - config.kubesphere.io @@ -115,6 +126,10 @@ rules: verbs: - get - list + - nonResourceURLs: + - /static/images/* + verbs: + - GET --- apiVersion: iam.kubesphere.io/v1beta1 @@ -164,7 +179,7 @@ metadata: kubesphere.io/description: '{"zh": "被邀请加入企业空间之前无法访问任何资源。", "en": "Cannot access any resources before joining a workspace."}' kubesphere.io/creator: admin name: platform-regular -rules: [] +rules: [ ] --- apiVersion: iam.kubesphere.io/v1beta1 @@ -173,8 +188,6 @@ metadata: annotations: kubesphere.io/creator: admin kubesphere.io/description: '{"zh": "创建企业空间并成为所创建的企业空间的管理员。", "en": "Create workspaces and become an administrator of the created workspaces."}' - labels: - iam.kubesphere.io/auto-aggregate: "true" name: platform-self-provisioner aggregationRoleTemplates: templateNames: diff --git a/src/test/ks-core/templates/kubesphere-config.yaml b/src/test/ks-core/templates/kubesphere-config.yaml index 7616d8d78..f2f985ed3 100644 --- a/src/test/ks-core/templates/kubesphere-config.yaml +++ b/src/test/ks-core/templates/kubesphere-config.yaml @@ -32,9 +32,14 @@ data: image: {{ template "kubectl.image" . }} node: image: {{ template "nodeShell.image" . }} - helmImage: {{ template "helm.image" . }} + helmExecutor: + image: {{ template "helm.image" . }} + extension: + imageRegistry: {{- .Values.extension.imageRegistry }} + nodeSelector: {{- toYaml .Values.extension.nodeSelector | nindent 8 }} + {{- if .Values.devMode }} telemetry: - ksCloudUrl: "https://clouddev.kubesphere.io" + ksCloudURL: "https://clouddev.kubesphere.io" {{- end }} {{- end }} diff --git a/src/test/ks-core/templates/oauthclient-config.yaml b/src/test/ks-core/templates/oauthclient-config.yaml index c00a625c2..5539f59a8 100644 --- a/src/test/ks-core/templates/oauthclient-config.yaml +++ b/src/test/ks-core/templates/oauthclient-config.yaml @@ -14,7 +14,7 @@ stringData: accessTokenInactivityTimeout: 7200 kind: Secret metadata: - name: kubesphere + name: oauthclient-kubesphere namespace: kubesphere-system labels: config.kubesphere.io/type: oauthclient diff --git a/src/test/ks-core/templates/post-delete-job.yaml b/src/test/ks-core/templates/post-delete-job.yaml index cacb32d37..4a7e7d9ea 100644 --- a/src/test/ks-core/templates/post-delete-job.yaml +++ b/src/test/ks-core/templates/post-delete-job.yaml @@ -41,6 +41,12 @@ subjects: --- +{{- $crdNameList := list }} +{{- range $path, $_ := .Files.Glob "crds/**" }} +{{- $crd := $.Files.Get $path | fromYaml }} +{{- $crdNameList = append $crdNameList $crd.metadata.name }} +{{- end }} + apiVersion: batch/v1 kind: Job metadata: @@ -60,6 +66,7 @@ spec: command: - /bin/bash - /scripts/post-delete.sh + - '{{ join " " $crdNameList }}' volumeMounts: - mountPath: /scripts name: scripts diff --git a/src/test/ks-core/templates/webhook.yaml b/src/test/ks-core/templates/webhook.yaml index 9bfb348e8..d9aeb0685 100644 --- a/src/test/ks-core/templates/webhook.yaml +++ b/src/test/ks-core/templates/webhook.yaml @@ -77,9 +77,9 @@ webhooks: objectSelector: {} rules: - apiGroups: - - '*' + - '' apiVersions: - - '*' + - v1 operations: - CREATE resources: diff --git a/src/test/ks-core/values.yaml b/src/test/ks-core/values.yaml index 27e616008..fc0c44c5a 100644 --- a/src/test/ks-core/values.yaml +++ b/src/test/ks-core/values.yaml @@ -283,12 +283,17 @@ nodeShell: tag: "3.18.4" pullPolicy: IfNotPresent + +extension: + imageRegistry: "" + nodeSelector: {} + upgrade: disabled: false image: registry: "" repository: kse/ks-upgrade - tag: "" + tag: "latest" pullPolicy: IfNotPresent storage: s3: @@ -314,3 +319,5 @@ upgrade: disabled: false priority: 11 dynamicOptions: {} + +