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 7, 2024
1 parent b3eccb4 commit 5858acf
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 80 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.7
version: 0.6.8

# 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 @@ -17,11 +17,17 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.AppID
name: App Name
type: string
- jsonPath: .metadata.labels.kubesphere\.io/workspace
name: Workspace
name: workspace
type: string
- jsonPath: .metadata.labels.application\.kubesphere\.io/app-id
name: app
type: string
- jsonPath: .metadata.labels.application\.kubesphere\.io/appversion-id
name: appversion
type: string
- jsonPath: .spec.appType
name: appType
type: string
- jsonPath: .metadata.labels.kubesphere\.io/cluster
name: Cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .metadata.labels.application\.kubesphere\.io/repo-name
name: repo
type: string
- jsonPath: .metadata.labels.kubesphere\.io/workspace
name: workspace
type: string
- jsonPath: .spec.appType
name: appType
type: string
- jsonPath: .status.state
name: State
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .metadata.labels.application\.kubesphere\.io/repo-name
name: repo
type: string
- jsonPath: .metadata.labels.kubesphere\.io/workspace
name: workspace
type: string
- jsonPath: .metadata.labels.application\.kubesphere\.io/app-id
name: app
type: string
- jsonPath: .spec.appType
name: appType
type: string
- jsonPath: .status.state
name: State
type: string
Expand Down
2 changes: 0 additions & 2 deletions src/test/ks-core/crds/application.kubesphere.io_repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ spec:
type: object
description:
type: string
global:
type: boolean
syncPeriod:
type: integer
url:
Expand Down
2 changes: 0 additions & 2 deletions src/test/ks-core/crds/kubesphere.io_extensionversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ spec:
additionalProperties:
type: string
type: object
docs:
type: string
externalDependencies:
description: ExternalDependencies
items:
Expand Down
72 changes: 72 additions & 0 deletions src/test/ks-core/files/extensions.customresourcefilters.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package filter

import rego.v1

default match := false

match if {
not listAvailableExtension
not fuzzySearch
not installStatusSearch
not enabledStatusSearch
}

match if {
listAvailableExtension
isSubscribed
}

match if {
listAvailableExtension
alreadyInstalled
}

match if {
listAvailableExtension
not hasExtensionID
}

match if {
fuzzySearch
displayNameMatch
}

match if {
installStatusSearch
installStatusMatch
}

match if {
enabledStatusSearch
enabledStatusMatch
}

fuzzySearch if "q" == input.filter.field

installStatusSearch if "status" == input.filter.field

enabledStatusSearch if "enabled" == input.filter.field

listAvailableExtension if "available" == input.filter.field

isSubscribed if input.object.metadata.labels["marketplace.kubesphere.io/subscribed"] == "true"

alreadyInstalled if input.object.status.state != ""

hasExtensionID if input.object.metadata.labels["marketplace.kubesphere.io/extension-id"] != ""

displayNameMatch if {
contains(lower(input.object.spec.displayName[_]), lower(input.filter.value))
}

nameMatch if {
contains(lower(input.object.metadata.name), lower(input.filter.value))
}

installStatusMatch if {
lower(input.object.status.state) == lower(input.filter.value)
}

enabledStatusMatch if {
input.filter.value == "true" == input.object.status.enabled
}
8 changes: 8 additions & 0 deletions src/test/ks-core/scripts/post-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ do
kubectl delete crd $crd 2>/dev/null;
fi
done


EXTENSION_RELATED_RESOURCES='jobs.batch roles.rbac.authorization.k8s.io rolebindings.rbac.authorization.k8s.io clusterroles.rbac.authorization.k8s.io clusterrolebindings.rbac.authorization.k8s.io'

for resource in $EXTENSION_RELATED_RESOURCES;do
echo "kubectl delete $resource -l kubesphere.io/extension-ref --all-namespaces"
kubectl delete $resource -l kubesphere.io/managed=true --all-namespaces
done
33 changes: 1 addition & 32 deletions src/test/ks-core/templates/customresourcefilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,7 @@ stringData:
version: "v1alpha1"
kind: "Extension"
regoPolicy: |
package filter
import rego.v1
default match := false
match if {
not listAvailableExtension
}
match if {
listAvailableExtension
isSubscribed
}
match if {
listAvailableExtension
isInstalled
}
match if {
listAvailableExtension
not hasExtensionID
}
listAvailableExtension if ["available"][_] == input.filter.field
isSubscribed if input.object.metadata.labels["marketplace.kubesphere.io/subscribed"] == "true"
isInstalled if input.object.status.state != ""
hasExtensionID if input.object.metadata.labels["marketplace.kubesphere.io/extension-id"] != ""
{{ .Files.Get "files/extensions.customresourcefilters.rego" | indent 6 }}
kind: Secret
metadata:
name: extensions.customresourcefilters.kubesphere
Expand Down
7 changes: 0 additions & 7 deletions src/test/ks-core/templates/globalroles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- license.kubesphere.io
resources:
- licenses
verbs:
- get
- list
- apiGroups:
- cluster.kubesphere.io
resources:
Expand Down
32 changes: 0 additions & 32 deletions src/test/ks-core/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,38 +317,6 @@ webhooks:

---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: license.kubesphere.io
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ b64enc $ca.Cert | quote }}
service:
name: ks-controller-manager
namespace: kubesphere-system
path: /license-cluster-checker
port: 443
name: license-cluster-checker.kubesphere.io
failurePolicy: Ignore
matchPolicy: Exact
namespaceSelector: {}
objectSelector: {}
rules:
- apiGroups:
- cluster.kubesphere.io
apiVersions:
- v1alpha1
operations:
- CREATE
resources:
- clusters
scope: '*'
sideEffects: None
timeoutSeconds: 30
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: defaulter.config.kubesphere.io
Expand Down

0 comments on commit 5858acf

Please sign in to comment.