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

fix: remove VnetName check from common cloudConfig package #956

Merged
merged 3 commits into from
Nov 14, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pkg/utils/cloudconfig/azure/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ func (cfg *CloudConfig) validate() error {
return fmt.Errorf("resource group is empty")
}

if cfg.VnetName == "" {
return fmt.Errorf("virtual network name is empty")
}

if cfg.VnetResourceGroup == "" {
cfg.VnetResourceGroup = cfg.ResourceGroup
}
Expand Down
21 changes: 3 additions & 18 deletions pkg/utils/cloudconfig/azure/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,6 @@ func TestValidate(t *testing.T) {
},
wantPass: false,
},
"VnetName empty": {
config: &CloudConfig{
ARMClientConfig: azclient.ARMClientConfig{
Cloud: "c",
},
AzureAuthConfig: azclient.AzureAuthConfig{
UseManagedIdentityExtension: true,
UserAssignedIdentityID: "a",
},
Location: "l",
SubscriptionID: "s",
ResourceGroup: "v",
VnetName: "",
},
wantPass: false,
},
"VnetResourceGroup empty": {
config: &CloudConfig{
ARMClientConfig: azclient.ARMClientConfig{
Expand Down Expand Up @@ -559,8 +543,9 @@ func TestNewCloudConfigFromFile(t *testing.T) {
filePath: "./test/azure_valid_config.json",
wantConfig: &CloudConfig{
ARMClientConfig: azclient.ARMClientConfig{
Cloud: "AzurePublicCloud",
TenantID: "00000000-0000-0000-0000-000000000000",
Cloud: "AzurePublicCloud",
TenantID: "00000000-0000-0000-0000-000000000000",
UserAgent: "fleet-member-agent",
},
AzureAuthConfig: azclient.AzureAuthConfig{
UseManagedIdentityExtension: true,
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/cloudconfig/azure/test/azure_valid_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cloud": "AzurePublicCloud",
"userAgent": "fleet-member-agent",
"tenantId": "00000000-0000-0000-0000-000000000000",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"useManagedIdentityExtension": true,
Expand Down
1 change: 1 addition & 0 deletions test/e2e/azure_valid_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config:
azureCloudConfig:
cloud: "AzurePublicCloud"
userAgent: "fleet-member-agent"
tenantId: "00000000-0000-0000-0000-000000000000"
subscriptionId: "00000000-0000-0000-0000-000000000000"
useManagedIdentityExtension: true
Expand Down
Loading