diff --git a/apis/management.cattle.io/v3/cluster_types.go b/apis/management.cattle.io/v3/cluster_types.go index 93da054e..bb0ba613 100644 --- a/apis/management.cattle.io/v3/cluster_types.go +++ b/apis/management.cattle.io/v3/cluster_types.go @@ -17,6 +17,7 @@ const ( ClusterConditionProvisioned condition.Cond = "Provisioned" ClusterConditionUpdated condition.Cond = "Updated" ClusterConditionRemoved condition.Cond = "Removed" + ClusterConditionRegistered condition.Cond = "Registered" // ClusterConditionNoDiskPressure true when all cluster nodes have sufficient disk ClusterConditionNoDiskPressure condition.Cond = "NoDiskPressure" // ClusterConditionNoMemoryPressure true when all cluster nodes have sufficient memory @@ -46,7 +47,8 @@ type ClusterSpec struct { DisplayName string `json:"displayName"` Description string `json:"description"` Internal bool `json:"internal" norman:"nocreate,noupdate"` - Embedded bool `json:"embedded"` + Imported bool `json:"imported" norman:"noupdate"` + Embedded bool `json:"embedded" norman:"noupdate"` EmbeddedConfig *K8sServerConfig `json:"embeddedConfig"` GoogleKubernetesEngineConfig *GoogleKubernetesEngineConfig `json:"googleKubernetesEngineConfig,omitempty"` AzureKubernetesServiceConfig *AzureKubernetesServiceConfig `json:"azureKubernetesServiceConfig,omitempty"` diff --git a/apis/management.cattle.io/v3/global_types.go b/apis/management.cattle.io/v3/global_types.go new file mode 100644 index 00000000..8d4c9f98 --- /dev/null +++ b/apis/management.cattle.io/v3/global_types.go @@ -0,0 +1,40 @@ +package v3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Setting struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Value string `json:"value" norman:"required"` + HideValue bool `json:"hideValue" norman:"noupdate"` + ReadOnly bool `json:"readOnly" norman:"nocreate,noupdate"` +} + +type ListenConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + Description string `json:"description,omitempty"` + Mode string `json:"mode,omitempty" norman:"type=enum,options=https|http|acme"` + CACerts string `json:"caCerts,omitempty"` + Cert string `json:"cert,omitempty"` + Key string `json:"key,omitempty" norman:"writeOnly"` + Domains []string `json:"domains,omitempty"` + TOS []string `json:"tos,omitempty" norman:"default=auto"` + Enabled bool `json:"enabled,omitempty" norman:"default=true"` + + CertFingerprint string `json:"certFingerprint,omitempty" norman:"nocreate,noupdate"` + CN string `json:"cn,omitempty" norman:"nocreate,noupdate"` + Version int `json:"version,omitempty" norman:"nocreate,noupdate"` + ExpiresAt string `json:"expiresAt,omitempty" norman:"nocreate,noupdate"` + Issuer string `json:"issuer,omitempty" norman:"nocreate,noupdate"` + IssuedAt string `json:"issuedAt,omitempty" norman:"nocreate,noupdate"` + Algorithm string `json:"algorithm,omitempty" norman:"nocreate,noupdate"` + SerialNumber string `json:"serialNumber,omitempty" norman:"nocreate,noupdate"` + KeySize int `json:"keySize,omitempty" norman:"nocreate,noupdate"` + SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty" norman:"nocreate,noupdate"` +} diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index b12b14ea..20b2da75 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -28,7 +28,8 @@ var ( Init(authnTypes). Init(schemaTypes). Init(stackTypes). - Init(userTypes) + Init(userTypes). + Init(globalTypes) ) func schemaTypes(schemas *types.Schemas) *types.Schemas { @@ -238,7 +239,6 @@ func stackTypes(schema *types.Schemas) *types.Schemas { func userTypes(schema *types.Schemas) *types.Schemas { return schema. - AddMapperForType(&Version, v3.Preference{}). MustImportAndCustomize(&Version, v3.Preference{}, func(schema *types.Schema) { schema.MustCustomizeField("name", func(f types.Field) types.Field { f.Required = true @@ -250,3 +250,15 @@ func userTypes(schema *types.Schemas) *types.Schemas { }) }) } + +func globalTypes(schema *types.Schemas) *types.Schemas { + return schema. + AddMapperForType(&Version, v3.ListenConfig{}, m.DisplayName{}). + MustImport(&Version, v3.ListenConfig{}). + MustImportAndCustomize(&Version, v3.Setting{}, func(schema *types.Schema) { + schema.MustCustomizeField("name", func(f types.Field) types.Field { + f.Required = true + return f + }) + }) +}