Skip to content

Commit 85ab438

Browse files
authored
fix: remove VnetName check from common cloudConfig package (#956)
VnetName check only on fleet-member-agent
1 parent e7ebd08 commit 85ab438

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

pkg/utils/cloudconfig/azure/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ func (cfg *CloudConfig) validate() error {
8888
return fmt.Errorf("resource group is empty")
8989
}
9090

91-
if cfg.VnetName == "" {
92-
return fmt.Errorf("virtual network name is empty")
93-
}
94-
9591
if cfg.VnetResourceGroup == "" {
9692
cfg.VnetResourceGroup = cfg.ResourceGroup
9793
}

pkg/utils/cloudconfig/azure/config_test.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@ func TestValidate(t *testing.T) {
133133
},
134134
wantPass: false,
135135
},
136-
"VnetName empty": {
137-
config: &CloudConfig{
138-
ARMClientConfig: azclient.ARMClientConfig{
139-
Cloud: "c",
140-
},
141-
AzureAuthConfig: azclient.AzureAuthConfig{
142-
UseManagedIdentityExtension: true,
143-
UserAssignedIdentityID: "a",
144-
},
145-
Location: "l",
146-
SubscriptionID: "s",
147-
ResourceGroup: "v",
148-
VnetName: "",
149-
},
150-
wantPass: false,
151-
},
152136
"VnetResourceGroup empty": {
153137
config: &CloudConfig{
154138
ARMClientConfig: azclient.ARMClientConfig{
@@ -559,8 +543,9 @@ func TestNewCloudConfigFromFile(t *testing.T) {
559543
filePath: "./test/azure_valid_config.json",
560544
wantConfig: &CloudConfig{
561545
ARMClientConfig: azclient.ARMClientConfig{
562-
Cloud: "AzurePublicCloud",
563-
TenantID: "00000000-0000-0000-0000-000000000000",
546+
Cloud: "AzurePublicCloud",
547+
TenantID: "00000000-0000-0000-0000-000000000000",
548+
UserAgent: "fleet-member-agent",
564549
},
565550
AzureAuthConfig: azclient.AzureAuthConfig{
566551
UseManagedIdentityExtension: true,

pkg/utils/cloudconfig/azure/test/azure_valid_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cloud": "AzurePublicCloud",
3+
"userAgent": "fleet-member-agent",
34
"tenantId": "00000000-0000-0000-0000-000000000000",
45
"subscriptionId": "00000000-0000-0000-0000-000000000000",
56
"useManagedIdentityExtension": true,

test/e2e/azure_valid_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config:
22
azureCloudConfig:
33
cloud: "AzurePublicCloud"
4+
userAgent: "fleet-member-agent"
45
tenantId: "00000000-0000-0000-0000-000000000000"
56
subscriptionId: "00000000-0000-0000-0000-000000000000"
67
useManagedIdentityExtension: true

0 commit comments

Comments
 (0)