diff --git a/addons/controllers/antrea/antreaconfig_util.go b/addons/controllers/antrea/antreaconfig_util.go index b95326675df..ccadd7c4af6 100644 --- a/addons/controllers/antrea/antreaconfig_util.go +++ b/addons/controllers/antrea/antreaconfig_util.go @@ -21,14 +21,37 @@ import ( // AntreaConfigSpec defines the desired state of AntreaConfig type antreaConfigSpec struct { - InfraProvider string `yaml:"infraProvider"` - Antrea antrea `yaml:"antrea,omitempty"` + InfraProvider string `yaml:"infraProvider"` + Antrea antrea `yaml:"antrea,omitempty"` + AntreaNsx antreaNsx `yaml:"antreaNsx,omitempty"` } type antrea struct { AntreaConfigDataValue antreaConfigDataValue `yaml:"config,omitempty"` } +type antreaNsx struct { + Enable bool `yaml:"enable,omitempty"` + BootstrapFrom string `yaml:"bootstrapFrom,omitempty"` + AntreaNsxProvider antreaNsxProvider `yaml:"provider,omitempty"` + AntreaNsxInline antreaNsxInline `yaml:"inline,omitempty"` + AntreaNsxConfig antreaNsxConfig `yaml:"config,omitempty"` +} + +type antreaNsxProvider struct { + ApiGroup string `yaml:"apiGroup,omitempty"` + kind string `yaml:"kind,omitempty"` +} + +type antreaNsxInline struct { + NsxManagers []string `yaml:"nsxManagers,omitempty"` + ClusterName string `yaml:"ClusterName,omitempty"` + NsxCertRef string `yaml:"NsxCertRef,omitempty"` +} + +type antreaNsxConfig struct { +} + type antreaEgress struct { EgressExceptCIDRs []string `yaml:"exceptCIDRs,omitempty"` } diff --git a/apis/addonconfigs/cni/v1alpha1/antreaconfig_types.go b/apis/addonconfigs/cni/v1alpha1/antreaconfig_types.go index f45951e9662..9bd0760e778 100644 --- a/apis/addonconfigs/cni/v1alpha1/antreaconfig_types.go +++ b/apis/addonconfigs/cni/v1alpha1/antreaconfig_types.go @@ -11,7 +11,8 @@ type AntreaProxyNodePortAddress []string // AntreaConfigSpec defines the desired state of AntreaConfig type AntreaConfigSpec struct { - Antrea Antrea `json:"antrea,omitempty"` + Antrea Antrea `json:"antrea,omitempty"` + AntreaNsx AntreaNsx `json:"antreaNsx,omitempty"` } type Antrea struct { @@ -198,6 +199,28 @@ type AntreaConfigStatus struct { SecretRef string `json:"secretRef,omitempty"` } +type AntreaNsx struct { + Enable bool `json:"enable,omitempty"` + BootstrapFrom string `json:"bootstrapFrom,omitempty"` + AntreaNsxProvider AntreaNsxProvider `json:"provider,omitempty"` + AntreaNsxInline AntreaNsxInline `json:"inline,omitempty"` + AntreaNsxConfig AntreaNsxConfig `json:"config,omitempty"` +} + +type AntreaNsxProvider struct { + ApiGroup string `json:"apiGroup,omitempty"` + kind string `json:"kind,omitempty"` +} + +type AntreaNsxInline struct { + NsxManagers []string `json:"nsxManagers,omitempty"` + ClusterName string `json:"ClusterName,omitempty"` + NsxCertRef string `json:"NsxCertRef,omitempty"` +} + +type AntreaNsxConfig struct { +} + // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:path=antreaconfigs,shortName=antreaconf,scope=Namespaced diff --git a/apis/addonconfigs/cni/v1alpha1/zz_generated.deepcopy.go b/apis/addonconfigs/cni/v1alpha1/zz_generated.deepcopy.go index d4927a534dc..dcaab3b7119 100644 --- a/apis/addonconfigs/cni/v1alpha1/zz_generated.deepcopy.go +++ b/apis/addonconfigs/cni/v1alpha1/zz_generated.deepcopy.go @@ -122,6 +122,7 @@ func (in *AntreaConfigList) DeepCopyObject() runtime.Object { func (in *AntreaConfigSpec) DeepCopyInto(out *AntreaConfigSpec) { *out = *in in.Antrea.DeepCopyInto(&out.Antrea) + in.AntreaNsx.DeepCopyInto(&out.AntreaNsx) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AntreaConfigSpec. @@ -214,6 +215,74 @@ func (in *AntreaNodePortLocal) DeepCopy() *AntreaNodePortLocal { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AntreaNsx) DeepCopyInto(out *AntreaNsx) { + *out = *in + out.AntreaNsxProvider = in.AntreaNsxProvider + in.AntreaNsxInline.DeepCopyInto(&out.AntreaNsxInline) + out.AntreaNsxConfig = in.AntreaNsxConfig +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AntreaNsx. +func (in *AntreaNsx) DeepCopy() *AntreaNsx { + if in == nil { + return nil + } + out := new(AntreaNsx) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AntreaNsxConfig) DeepCopyInto(out *AntreaNsxConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AntreaNsxConfig. +func (in *AntreaNsxConfig) DeepCopy() *AntreaNsxConfig { + if in == nil { + return nil + } + out := new(AntreaNsxConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AntreaNsxInline) DeepCopyInto(out *AntreaNsxInline) { + *out = *in + if in.NsxManagers != nil { + in, out := &in.NsxManagers, &out.NsxManagers + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AntreaNsxInline. +func (in *AntreaNsxInline) DeepCopy() *AntreaNsxInline { + if in == nil { + return nil + } + out := new(AntreaNsxInline) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AntreaNsxProvider) DeepCopyInto(out *AntreaNsxProvider) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AntreaNsxProvider. +func (in *AntreaNsxProvider) DeepCopy() *AntreaNsxProvider { + if in == nil { + return nil + } + out := new(AntreaNsxProvider) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AntreaProxy) DeepCopyInto(out *AntreaProxy) { *out = *in diff --git a/apis/addonconfigs/config/crd/bases/cni.tanzu.vmware.com_antreaconfigs.yaml b/apis/addonconfigs/config/crd/bases/cni.tanzu.vmware.com_antreaconfigs.yaml index dec6c92f3aa..4b66e16e87d 100644 --- a/apis/addonconfigs/config/crd/bases/cni.tanzu.vmware.com_antreaconfigs.yaml +++ b/apis/addonconfigs/config/crd/bases/cni.tanzu.vmware.com_antreaconfigs.yaml @@ -227,6 +227,33 @@ spec: type: object type: object type: object + antreaNsx: + properties: + bootstrapFrom: + type: string + config: + type: object + enable: + type: boolean + inline: + properties: + ClusterName: + type: string + NsxCertRef: + type: string + nsxManagers: + items: + type: string + type: array + type: object + provider: + properties: + apiGroup: + type: string + kind: + type: string + type: object + type: object type: object status: description: AntreaConfigStatus defines the observed state of AntreaConfig diff --git a/packages/addons-manager/bundle/config/upstream/addonconfigscrds/cni.tanzu.vmware.com_antreaconfigs.yaml b/packages/addons-manager/bundle/config/upstream/addonconfigscrds/cni.tanzu.vmware.com_antreaconfigs.yaml index dec6c92f3aa..b7b12f36585 100644 --- a/packages/addons-manager/bundle/config/upstream/addonconfigscrds/cni.tanzu.vmware.com_antreaconfigs.yaml +++ b/packages/addons-manager/bundle/config/upstream/addonconfigscrds/cni.tanzu.vmware.com_antreaconfigs.yaml @@ -227,10 +227,40 @@ spec: type: object type: object type: object + antreaNsx: + properties: + bootstrapFrom: + type: string + config: + type: object + enable: + type: boolean + inline: + properties: + ClusterName: + type: string + NsxCertRef: + type: string + nsxManagers: + items: + type: string + type: array + type: object + provider: + properties: + apiGroup: + type: string + kind: + type: string + type: object + type: object type: object status: description: AntreaConfigStatus defines the observed state of AntreaConfig properties: + message: + description: Message to indicate failure reason + type: string secretRef: description: Reference to the data value secret created by controller type: string