add exetra labels to application resource
Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
@@ -57,5 +57,7 @@ const (
|
||||
UncategorizedId = "ctg-uncategorized"
|
||||
AppStoreRepoId = "repo-helm"
|
||||
|
||||
ApplicationInstance = "app.kubesphere.io/instance"
|
||||
|
||||
OriginWorkspaceLabelKey = "kubesphere.io/workspace-origin"
|
||||
)
|
||||
|
||||
@@ -345,8 +345,10 @@ func (r *ReconcileHelmRelease) createOrUpgradeHelmRelease(rls *v1alpha1.HelmRele
|
||||
|
||||
// If clusterConfig is empty, this application will be installed in current host.
|
||||
hw := helmwrapper.NewHelmWrapper(clusterConfig, rls.GetRlsNamespace(), rls.Spec.Name,
|
||||
// We just add kubesphere.io/creator annotation now.
|
||||
helmwrapper.SetAnnotations(map[string]string{constants.CreatorAnnotationKey: rls.GetCreator()}),
|
||||
helmwrapper.SetLabels(map[string]string{
|
||||
v1alpha1.ApplicationInstance: rls.GetTrueName(),
|
||||
}),
|
||||
helmwrapper.SetMock(r.helmMock))
|
||||
|
||||
var currentState string
|
||||
|
||||
@@ -239,6 +239,13 @@ func SetAnnotations(annotations map[string]string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// extra labels added to all resources in chart
|
||||
func SetLabels(labels map[string]string) Option {
|
||||
return func(wrapper *helmWrapper) {
|
||||
wrapper.labels = labels
|
||||
}
|
||||
}
|
||||
|
||||
func SetMock(mock bool) Option {
|
||||
return func(wrapper *helmWrapper) {
|
||||
wrapper.mock = mock
|
||||
|
||||
Reference in New Issue
Block a user