Add labels to all objects but not selectors

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2021-04-15 15:46:19 +08:00
parent ce4cfbee51
commit e88f83c167
2 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
FROM alpine:3.11
ARG HELM_VERSION=v3.5.2
ARG KUSTOMIZE_VERSION=v4.0.5
ARG KUSTOMIZE_VERSION=v4.1.0
RUN apk add --no-cache ca-certificates
# install helm

View File

@@ -35,7 +35,7 @@ import (
helmrelease "helm.sh/helm/v3/pkg/release"
"k8s.io/klog"
kpath "k8s.io/utils/path"
"sigs.k8s.io/kustomize/pkg/types"
"sigs.k8s.io/kustomize/api/types"
"kubesphere.io/kubesphere/pkg/server/errors"
"kubesphere.io/kubesphere/pkg/utils/idutils"
@@ -299,8 +299,8 @@ func (c *helmWrapper) setupPostRenderEnvironment() error {
kustomizationConfig := types.Kustomization{
Resources: []string{"./.local-helm-output.yaml"},
CommonAnnotations: c.annotations, // add extra annotations to output
CommonLabels: c.labels, // add extra labels to output
CommonAnnotations: c.annotations, // add extra annotations to output
Labels: []types.Label{types.Label{Pairs: c.labels}}, // Labels to add to all objects but not selectors.
}
err = yaml.NewEncoder(kustomization).Encode(kustomizationConfig)