From 5fa48624b53575d834ab4f5212f3653cd73e36e1 Mon Sep 17 00:00:00 2001 From: rajashree Date: Tue, 5 Nov 2019 15:57:27 -0800 Subject: [PATCH] Accept extra env vars, volume and volumeMounts for ingress addon --- apis/management.cattle.io/v3/rke_types.go | 18 ++++++++++++++++++ apis/management.cattle.io/v3/schema/schema.go | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/apis/management.cattle.io/v3/rke_types.go b/apis/management.cattle.io/v3/rke_types.go index 11a0312c..033b72e2 100644 --- a/apis/management.cattle.io/v3/rke_types.go +++ b/apis/management.cattle.io/v3/rke_types.go @@ -400,6 +400,24 @@ type IngressConfig struct { ExtraArgs map[string]string `yaml:"extra_args" json:"extraArgs,omitempty"` // DNS Policy DNSPolicy string `yaml:"dns_policy" json:"dnsPolicy,omitempty"` + // Extra Env vars + ExtraEnvs []ExtraEnv `yaml:"extra_envs" json:"extraEnvs,omitempty" norman:"type=array[json]"` + // Extra volumes + ExtraVolumes []ExtraVolume `yaml:"extra_volumes" json:"extraVolumes,omitempty" norman:"type=array[json]"` + // Extra volume mounts + ExtraVolumeMounts []ExtraVolumeMount `yaml:"extra_volume_mounts" json:"extraVolumeMounts,omitempty" norman:"type=array[json]"` +} + +type ExtraEnv struct { + v1.EnvVar +} + +type ExtraVolume struct { + v1.Volume +} + +type ExtraVolumeMount struct { + v1.VolumeMount } type RKEPlan struct { diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 062c70eb..5ee2e836 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -67,7 +67,10 @@ func rkeTypes(schemas *types.Schemas) *types.Schemas { "key", }}, m.ReadOnly{Field: "timeAdded"}, - ) + ). + MustImport(&Version, v3.ExtraEnv{}). + MustImport(&Version, v3.ExtraVolume{}). + MustImport(&Version, v3.ExtraVolumeMount{}) } func schemaTypes(schemas *types.Schemas) *types.Schemas {