Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Feature Route Domain in CRD Mode #1779

Merged
merged 1 commit into from Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/k8s-bigip-ctlr/main.go
Expand Up @@ -110,6 +110,7 @@ var (

// Custom Resource
customResourceMode *bool
defaultRouteDomain *int

pythonBaseDir *string
logLevel *string
Expand Down Expand Up @@ -222,6 +223,8 @@ func _init() {
// Custom Resource
customResourceMode = globalFlags.Bool("custom-resource-mode", false,
"Optional, When set to true, controller processes only F5 Custom Resources.")
defaultRouteDomain = globalFlags.Int("default-route-domain", 0,
"Optional, CIS uses this value as default Route Domain in BIG-IP ")

globalFlags.Usage = func() {
fmt.Fprintf(os.Stderr, " Global:\n%s\n", globalFlags.FlagUsagesWrapped(width))
Expand Down Expand Up @@ -781,6 +784,7 @@ func initCustomResourceManager(
NodeLabelSelector: *nodeLabelSelector,
IPAM: *ipam,
ShareNodes: *shareNodes,
DefaultRouteDomain: *defaultRouteDomain,
},
)

Expand Down
1 change: 1 addition & 0 deletions pkg/crmanager/backend.go
Expand Up @@ -219,6 +219,7 @@ func createAS3ADC(config ResourceConfigWrapper) as3ADC {
// Create AS3 Tenant
tenant := as3Tenant{
"class": "Tenant",
"defaultRouteDomain": config.defaultRouteDomain,
as3SharedApplication: sharedApp,
}
as3JSONDecl := as3ADC{
Expand Down
1 change: 1 addition & 0 deletions pkg/crmanager/crManager.go
Expand Up @@ -98,6 +98,7 @@ func NewCRManager(params Params) *CRManager {
dgPath: strings.Join([]string{DEFAULT_PARTITION, "Shared"}, "/"),
shareNodes: params.ShareNodes,
eventNotifier: apm.NewEventNotifier(nil),
defaultRouteDomain: params.DefaultRouteDomain,
}

log.Debug("Custom Resource Manager Created")
Expand Down
3 changes: 3 additions & 0 deletions pkg/crmanager/types.go
Expand Up @@ -60,6 +60,7 @@ type (
shareNodes bool
ipamCli *ipammachinery.IPAMClient
ipamCR string
defaultRouteDomain int
}
// Params defines parameters
Params struct {
Expand All @@ -77,6 +78,7 @@ type (

ShareNodes bool
IPAM bool
DefaultRouteDomain int
}
// CRInformer defines the structure of Custom Resource Informer
CRInformer struct {
Expand Down Expand Up @@ -209,6 +211,7 @@ type (
customProfiles *CustomProfileStore
shareNodes bool
dnsConfig DNSConfig
defaultRouteDomain int
}

// Pool config
Expand Down
1 change: 1 addition & 0 deletions pkg/crmanager/worker.go
Expand Up @@ -258,6 +258,7 @@ func (crMgr *CRManager) processResource() bool {
customProfiles: crMgr.customProfiles,
shareNodes: crMgr.shareNodes,
dnsConfig: crMgr.resources.dnsConfig,
defaultRouteDomain: crMgr.defaultRouteDomain,
}
crMgr.Agent.PostConfig(config)
crMgr.initState = false
Expand Down