Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
extend antreaconfig crd
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Liu <[email protected]>
  • Loading branch information
liu4480 committed Nov 2, 2022
1 parent d0c3040 commit 284c294
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 3 deletions.
27 changes: 25 additions & 2 deletions addons/controllers/antrea/antreaconfig_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
25 changes: 24 additions & 1 deletion apis/addonconfigs/cni/v1alpha1/antreaconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
69 changes: 69 additions & 0 deletions apis/addonconfigs/cni/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 284c294

Please sign in to comment.