From 2d5dcebc2441b5f8a1a69f304760150e039e4298 Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Mon, 19 Nov 2018 20:44:14 +0200 Subject: [PATCH] Add rotate certificate type --- apis/management.cattle.io/v3/cluster_types.go | 4 ++++ apis/management.cattle.io/v3/rke_types.go | 9 +++++++++ apis/management.cattle.io/v3/schema/schema.go | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/apis/management.cattle.io/v3/cluster_types.go b/apis/management.cattle.io/v3/cluster_types.go index f1c69fe1..8f604725 100644 --- a/apis/management.cattle.io/v3/cluster_types.go +++ b/apis/management.cattle.io/v3/cluster_types.go @@ -231,3 +231,7 @@ type IngressCapabilities struct { type MonitoringInput struct { Answers map[string]string `json:"answers,omitempty"` } +type RotateCertificateInput struct { + CACertificates bool `json:"caCertificates,omitempty"` + Services []string `json:"services,omitempty" norman:"type=enum,options=etcd|kubelet|kube-apiserver|kube-proxy|kube-scheduler|kube-controller-manager"` +} diff --git a/apis/management.cattle.io/v3/rke_types.go b/apis/management.cattle.io/v3/rke_types.go index 69713e0a..2b2b270d 100644 --- a/apis/management.cattle.io/v3/rke_types.go +++ b/apis/management.cattle.io/v3/rke_types.go @@ -41,6 +41,8 @@ type RancherKubernetesEngineConfig struct { BastionHost BastionHost `yaml:"bastion_host" json:"bastionHost,omitempty"` // Monitoring Config Monitoring MonitoringConfig `yaml:"monitoring" json:"monitoring,omitempty"` + // Rotating Certificates Option + RotateCertificates *RotateCertificates `yaml:"-" json:"rotateCertificates,omitempty"` } type BastionHost struct { @@ -573,3 +575,10 @@ type MonitoringConfig struct { // Metrics server options Options map[string]string `yaml:"options" json:"options,omitempty"` } + +type RotateCertificates struct { + // Rotate CA Certificates + CACertificates bool `json:"caCertificates,omitempty"` + // Services to rotate their certs + Services []string `json:"services,omitempty" norman:"type=enum,options=etcd|kubelet|kube-apiserver|kube-proxy|kube-scheduler|kube-controller-manager"` +} diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 2d207f3e..2d437b06 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -145,6 +145,7 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas { MustImport(&Version, v3.ClusterRegistrationToken{}). MustImport(&Version, v3.GenerateKubeConfigOutput{}). MustImport(&Version, v3.ImportClusterYamlInput{}). + MustImport(&Version, v3.RotateCertificateInput{}). MustImport(&Version, v3.ImportYamlOutput{}). MustImport(&Version, v3.ExportOutput{}). MustImport(&Version, v3.MonitoringInput{}). @@ -177,6 +178,9 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas { Input: "monitoringInput", } schema.ResourceActions["disableMonitoring"] = types.Action{} + schema.ResourceActions["rotateCertificates"] = types.Action{ + Input: "rotateCertificateInput", + } }) }