From ead316d07a2944c41d8e4e61e71dfc305c61629d Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Thu, 17 Feb 2022 15:27:53 -0800 Subject: [PATCH] Add new fields for secret references --- apis/management.cattle.io/v3/alerting_types.go | 3 +++ apis/management.cattle.io/v3/catalog_types.go | 10 ++++++---- apis/management.cattle.io/v3/cluster_types.go | 4 ++++ apis/management.cattle.io/v3/schema/schema.go | 1 + apis/project.cattle.io/v3/pipeline_types.go | 7 ++++--- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/apis/management.cattle.io/v3/alerting_types.go b/apis/management.cattle.io/v3/alerting_types.go index 8e68c87c..46e6ded7 100755 --- a/apis/management.cattle.io/v3/alerting_types.go +++ b/apis/management.cattle.io/v3/alerting_types.go @@ -404,6 +404,9 @@ type WechatConfig struct { } type NotifierStatus struct { + SMTPCredentialSecret string `json:"smtpCredentialSecret,omitempty" norman:"nocreate,noupdate"` + WechatCredentialSecret string `json:"wechatCredentialSecret,omitempty" norman:"nocreate,noupdate"` + DingtalkCredentialSecret string `json:"dingtalkCredentialSecret,omitempty" norman:"nocreate,noupdate"` } // HTTPClientConfig configures an HTTP client. diff --git a/apis/management.cattle.io/v3/catalog_types.go b/apis/management.cattle.io/v3/catalog_types.go index 7f47ab0a..1da2931a 100644 --- a/apis/management.cattle.io/v3/catalog_types.go +++ b/apis/management.cattle.io/v3/catalog_types.go @@ -36,13 +36,15 @@ type CatalogStatus struct { // helmVersionCommits records hash of each helm template version HelmVersionCommits map[string]VersionCommits `json:"helmVersionCommits,omitempty"` Conditions []CatalogCondition `json:"conditions,omitempty"` + CredentialSecret string `json:"credentialSecret,omitempty" norman:"nocreate,noupdate"` } var ( - CatalogConditionRefreshed condition.Cond = "Refreshed" - CatalogConditionUpgraded condition.Cond = "Upgraded" - CatalogConditionDiskCached condition.Cond = "DiskCached" - CatalogConditionProcessed condition.Cond = "Processed" + CatalogConditionRefreshed condition.Cond = "Refreshed" + CatalogConditionUpgraded condition.Cond = "Upgraded" + CatalogConditionDiskCached condition.Cond = "DiskCached" + CatalogConditionProcessed condition.Cond = "Processed" + CatalogConditionSecretsMigrated condition.Cond = "SecretsMigrated" ) type CatalogCondition struct { diff --git a/apis/management.cattle.io/v3/cluster_types.go b/apis/management.cattle.io/v3/cluster_types.go index 1a6607bb..fded0d4a 100644 --- a/apis/management.cattle.io/v3/cluster_types.go +++ b/apis/management.cattle.io/v3/cluster_types.go @@ -66,6 +66,7 @@ const ( ClusterConditionPrometheusOperatorDeployed condition.Cond = "PrometheusOperatorDeployed" ClusterConditionMonitoringEnabled condition.Cond = "MonitoringEnabled" ClusterConditionAlertingEnabled condition.Cond = "AlertingEnabled" + ClusterConditionSecretsMigrated condition.Cond = "SecretsMigrated" ClusterDriverImported = "imported" ClusterDriverLocal = "local" @@ -159,6 +160,9 @@ type ClusterStatus struct { CertificatesExpiration map[string]CertExpiration `json:"certificatesExpiration,omitempty"` ScheduledClusterScanStatus *ScheduledClusterScanStatus `json:"scheduledClusterScanStatus,omitempty"` CurrentCisRunName string `json:"currentCisRunName,omitempty"` + PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" norman:"nocreate,noupdate"` + S3CredentialSecret string `json:"s3CredentialSecret,omitempty" norman:"nocreate,noupdate"` + WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" norman:"nocreate,noupdate"` } type ClusterComponentStatus struct { diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 7190bab4..82cfafc5 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -692,6 +692,7 @@ func globalTypes(schema *types.Schemas) *types.Schemas { func alertTypes(schema *types.Schemas) *types.Schemas { return schema. AddMapperForType(&Version, v3.Notifier{}, + &m.Embed{Field: "status"}, m.DisplayName{}). MustImport(&Version, v3.ClusterAlert{}). MustImport(&Version, v3.ProjectAlert{}). diff --git a/apis/project.cattle.io/v3/pipeline_types.go b/apis/project.cattle.io/v3/pipeline_types.go index e330dfce..73f92392 100644 --- a/apis/project.cattle.io/v3/pipeline_types.go +++ b/apis/project.cattle.io/v3/pipeline_types.go @@ -65,9 +65,10 @@ type SourceCodeProviderConfig struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - ProjectName string `json:"projectName" norman:"required,type=reference[project]"` - Type string `json:"type" norman:"noupdate,options=github|gitlab|bitbucketcloud|bitbucketserver"` - Enabled bool `json:"enabled,omitempty"` + ProjectName string `json:"projectName" norman:"required,type=reference[project]"` + Type string `json:"type" norman:"noupdate,options=github|gitlab|bitbucketcloud|bitbucketserver"` + Enabled bool `json:"enabled,omitempty"` + CredentialSecret string `json:"credentialSecret,omitempty" norman:"nocreate,noupdate"` } func (s *SourceCodeProviderConfig) ObjClusterName() string {