Skip to content

Commit 6b6e265

Browse files
committed
Change config: .network.multusStatus to .network.multus.status
1 parent 50d9f59 commit 6b6e265

File tree

7 files changed

+41
-25
lines changed

7 files changed

+41
-25
lines changed

cmd/generate-config/config/config-openapi-spec.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@
470470
"type": "object",
471471
"required": [
472472
"clusterNetwork",
473+
"multus",
473474
"serviceNetwork",
474475
"serviceNodePortRange"
475476
],
@@ -493,13 +494,19 @@
493494
"ovnk"
494495
]
495496
},
496-
"multusStatus": {
497-
"description": "MultusStatus controls the deployment of the Multus CNI.\nChanging from \"Enabled\" to \"Disabled\" will not cause Multus CNI to be deleted.\nAllowed values are: unset (disabled), \"Enabled\", or \"Disabled\"",
498-
"type": "string",
499-
"enum": [
500-
"Enabled",
501-
"Disabled"
502-
]
497+
"multus": {
498+
"type": "object",
499+
"properties": {
500+
"status": {
501+
"description": "Status controls the deployment of the Multus CNI.\nChanging from \"Enabled\" to \"Disabled\" will not cause Multus CNI to be deleted.\nAllowed values are: unset (disabled), \"Enabled\", or \"Disabled\"",
502+
"type": "string",
503+
"default": "Disabled",
504+
"enum": [
505+
"Enabled",
506+
"Disabled"
507+
]
508+
}
509+
}
503510
},
504511
"serviceNetwork": {
505512
"description": "IP address pool for services.\nCurrently, we only support a single entry here.\nThis field is immutable after installation.",

docs/user/howto_config.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ manifests:
7575
network:
7676
clusterNetwork: []
7777
cniPlugin: ""
78-
multusStatus: ""
78+
multus:
79+
status: ""
7980
serviceNetwork: []
8081
serviceNodePortRange: ""
8182
node:
@@ -175,7 +176,8 @@ network:
175176
clusterNetwork:
176177
- 10.42.0.0/16
177178
cniPlugin: ""
178-
multusStatus: ""
179+
multus:
180+
status: Disabled
179181
serviceNetwork:
180182
- 10.43.0.0/16
181183
serviceNodePortRange: 30000-32767

packaging/microshift/config.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,11 @@ network:
521521
# assumes an empty string to mean the OVN-K should be deployed.
522522
# Allowed values are: unset or one of ["", "ovnk", "none"]
523523
cniPlugin: ""
524-
# MultusStatus controls the deployment of the Multus CNI.
525-
# Changing from "Enabled" to "Disabled" will not cause Multus CNI to be deleted.
526-
# Allowed values are: unset (disabled), "Enabled", or "Disabled"
527-
multusStatus: ""
524+
multus:
525+
# Status controls the deployment of the Multus CNI.
526+
# Changing from "Enabled" to "Disabled" will not cause Multus CNI to be deleted.
527+
# Allowed values are: unset (disabled), "Enabled", or "Disabled"
528+
status: Disabled
528529
# IP address pool for services.
529530
# Currently, we only support a single entry here.
530531
# This field is immutable after installation.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
network:
2-
multusStatus: Enabled
2+
multus:
3+
status: Enabled

pkg/components/networking.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func startCNIPlugin(ctx context.Context, cfg *config.Config, kubeconfigPath stri
122122
}
123123

124124
func deployMultus(ctx context.Context, cfg *config.Config, kubeconfigPath string) error {
125-
if !cfg.Network.IsMultusEnabled() {
125+
if !cfg.Network.Multus.IsEnabled() {
126126
klog.Warningf("Multus CNI is disabled. Uninstall is not supported if it was installed previously.")
127127
return nil
128128
}

pkg/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ func (c *Config) incorporateUserSettings(u *Config) {
215215
c.Network.DNS = u.Network.DNS
216216
}
217217

218-
if u.Network.MultusStatus != "" {
219-
c.Network.MultusStatus = u.Network.MultusStatus
218+
if u.Network.Multus.Status != "" {
219+
c.Network.Multus.Status = u.Network.Multus.Status
220220
}
221221

222222
if u.Etcd.MemoryLimitMB != 0 {

pkg/config/network.go

+13-8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ const (
3636
MultusDisabled MultusStatusEnum = "Disabled"
3737
)
3838

39+
type Multus struct {
40+
// Status controls the deployment of the Multus CNI.
41+
// Changing from "Enabled" to "Disabled" will not cause Multus CNI to be deleted.
42+
// Allowed values are: unset (disabled), "Enabled", or "Disabled"
43+
//
44+
// +kubebuilder:validation:Optional
45+
// +kubebuilder:default=Disabled
46+
Status MultusStatusEnum `json:"status"`
47+
}
48+
3949
type Network struct {
4050
// CNIPlugin is a user defined string value matching one of the above CNI values. MicroShift uses this
4151
// value to decide whether to deploy the OVN-K as default CNI. An unset field defaults to "" during yaml parsing, and thus
@@ -66,12 +76,7 @@ type Network struct {
6676
// +kubebuilder:default="30000-32767"
6777
ServiceNodePortRange string `json:"serviceNodePortRange"`
6878

69-
// MultusStatus controls the deployment of the Multus CNI.
70-
// Changing from "Enabled" to "Disabled" will not cause Multus CNI to be deleted.
71-
// Allowed values are: unset (disabled), "Enabled", or "Disabled"
72-
//
73-
// +kubebuilder:validation:Optional
74-
MultusStatus MultusStatusEnum `json:"multusStatus"`
79+
Multus Multus `json:"multus"`
7580

7681
// The DNS server to use
7782
DNS string `json:"-"`
@@ -119,6 +124,6 @@ func (n Network) IsEnabled() bool {
119124
return n.CNIPlugin != CniPluginNone
120125
}
121126

122-
func (n Network) IsMultusEnabled() bool {
123-
return n.MultusStatus == MultusEnabled
127+
func (m Multus) IsEnabled() bool {
128+
return m.Status == MultusEnabled
124129
}

0 commit comments

Comments
 (0)