1
0
mirror of https://github.com/rancher/types.git synced 2025-09-20 01:22:31 +00:00

Add secret fields for cluster templates

This commit is contained in:
Colleen Murphy
2022-03-28 09:40:58 -07:00
parent d5878900d1
commit 9a257d32c6
2 changed files with 39 additions and 2 deletions

View File

@@ -1,10 +1,31 @@
package v3
import (
"github.com/rancher/norman/condition"
"github.com/rancher/norman/types"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const ClusterTemplateRevisionConditionSecretsMigrated condition.Cond = "SecretsMigrated"
type ClusterTemplateRevisionConditionType string
type ClusterTemplateRevisionCondition struct {
// Type of cluster template revision condition.
Type ClusterTemplateRevisionConditionType `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status"`
// The last time this condition was updated.
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason string `json:"reason,omitempty"`
// Human-readable message indicating details about last transition
Message string `json:"message,omitempty"`
}
type ClusterTemplate struct {
types.Namespaced
@@ -33,7 +54,8 @@ type ClusterTemplateRevision struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Spec ClusterTemplateRevisionSpec `json:"spec"`
Spec ClusterTemplateRevisionSpec `json:"spec"`
Status ClusterTemplateRevisionStatus `json:"status"`
}
type ClusterTemplateRevisionSpec struct {
@@ -45,6 +67,18 @@ type ClusterTemplateRevisionSpec struct {
ClusterConfig *ClusterSpecBase `json:"clusterConfig" norman:"required"`
}
type ClusterTemplateRevisionStatus struct {
PrivateRegistrySecret string `json:"privateRegistrySecret,omitempty" norman:"nocreate,noupdate"`
S3CredentialSecret string `json:"s3CredentialSecret,omitempty" norman:"nocreate,noupdate"`
WeavePasswordSecret string `json:"weavePasswordSecret,omitempty" norman:"nocreate,noupdate"`
VsphereSecret string `json:"vsphereSecret,omitempty" norman:"nocreate,noupdate"`
VirtualCenterSecret string `json:"virtualCenterSecret,omitempty" norman:"nocreate,noupdate"`
OpenStackSecret string `json:"openStackSecret,omitempty" norman:"nocreate,noupdate"`
AADClientSecret string `json:"aadClientSecret,omitempty" norman:"nocreate,noupdate"`
AADClientCertSecret string `json:"aadClientCertSecret,omitempty" norman:"nocreate,noupdate"`
Conditions []ClusterTemplateRevisionCondition `json:"conditions,omitempty"`
}
type ClusterTemplateQuestionsOutput struct {
Questions []Question `json:"questions,omitempty"`
}

View File

@@ -907,7 +907,10 @@ func clusterTemplateTypes(schemas *types.Schemas) *types.Schemas {
TypeName("clusterTemplate", v3.ClusterTemplate{}).
TypeName("clusterTemplateRevision", v3.ClusterTemplateRevision{}).
AddMapperForType(&Version, v3.ClusterTemplate{}, m.Drop{Field: "namespaceId"}, m.DisplayName{}).
AddMapperForType(&Version, v3.ClusterTemplateRevision{}, m.Drop{Field: "namespaceId"}, m.DisplayName{}).
AddMapperForType(&Version, v3.ClusterTemplateRevision{},
m.Drop{Field: "namespaceId"},
&m.Embed{Field: "status"},
m.DisplayName{}).
MustImport(&Version, v3.ClusterTemplateQuestionsOutput{}).
MustImport(&Version, v3.ClusterTemplate{}).
MustImportAndCustomize(&Version, v3.ClusterTemplateRevision{}, func(schema *types.Schema) {