Skip to content

Commit 50e65ef

Browse files
committed
rename vSwitchID to vSwitchOptions
1 parent 8745bd1 commit 50e65ef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/controller/webhook/mutating.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ import (
2828
"github.com/AliyunContainerService/terway/pkg/utils"
2929
"github.com/AliyunContainerService/terway/types"
3030
"github.com/AliyunContainerService/terway/types/controlplane"
31-
"k8s.io/apimachinery/pkg/util/sets"
3231

3332
"gomodules.xyz/jsonpatch/v2"
3433
corev1 "k8s.io/api/core/v1"
3534
"k8s.io/apimachinery/pkg/api/errors"
3635
"k8s.io/apimachinery/pkg/api/resource"
3736
k8stypes "k8s.io/apimachinery/pkg/types"
3837
"k8s.io/apimachinery/pkg/util/json"
38+
"k8s.io/apimachinery/pkg/util/sets"
3939
ctrl "sigs.k8s.io/controller-runtime"
4040
"sigs.k8s.io/controller-runtime/pkg/client"
4141
"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -119,7 +119,7 @@ func podWebhook(ctx context.Context, req *webhook.AdmissionRequest, client clien
119119
pna := &controlplane.PodNetworksAnnotation{
120120
PodNetworks: []controlplane.PodNetworks{
121121
{
122-
VSwitchIDs: vsws,
122+
VSwitchOptions: vsws,
123123
SecurityGroupIDs: sgs,
124124
},
125125
},
@@ -133,7 +133,7 @@ func podWebhook(ctx context.Context, req *webhook.AdmissionRequest, client clien
133133
memberCount = 1
134134
} else {
135135
for _, n := range networks.PodNetworks {
136-
if len(n.VSwitchIDs) == 0 {
136+
if len(n.VSwitchOptions) == 0 {
137137
return admission.Denied("vSwitchID is not set")
138138
}
139139
if len(n.SecurityGroupIDs) == 0 {

types/controlplane/annotations_default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ limitations under the License.
2020
package controlplane
2121

2222
type PodNetworks struct {
23-
VSwitchIDs []string `json:"vSwitchIDs"`
23+
VSwitchOptions []string `json:"vSwitchOptions"`
2424
SecurityGroupIDs []string `json:"securityGroupIDs"`
2525
}

0 commit comments

Comments
 (0)