Skip to content

Commit

Permalink
fix: remove VnetName check from common cloudConfig package (Azure#956)
Browse files Browse the repository at this point in the history
VnetName check only on fleet-member-agent
  • Loading branch information
britaniar committed Nov 15, 2024
1 parent 448fa35 commit 4ded60a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
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.UserAgent == "fleet-member-agent" && cfg.VnetName == "" {
return fmt.Errorf("vnet name is empty")
}

if cfg.VnetResourceGroup == "" {
cfg.VnetResourceGroup = cfg.ResourceGroup
}
Expand Down
22 changes: 2 additions & 20 deletions pkg/utils/cloudconfig/azure/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,6 @@ func TestValidate(t *testing.T) {
},
wantPass: false,
},
"VnetName empty": {
config: &CloudConfig{
ARMClientConfig: azclient.ARMClientConfig{
Cloud: "c",
UserAgent: "fleet-member-agent",
},
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 @@ -560,9 +543,8 @@ func TestNewCloudConfigFromFile(t *testing.T) {
filePath: "./test/azure_valid_config.json",
wantConfig: &CloudConfig{
ARMClientConfig: azclient.ARMClientConfig{
Cloud: "AzurePublicCloud",
TenantID: "00000000-0000-0000-0000-000000000000",
UserAgent: "fleet-member-agent",
Cloud: "AzurePublicCloud",
TenantID: "00000000-0000-0000-0000-000000000000",
},
AzureAuthConfig: azclient.AzureAuthConfig{
UseManagedIdentityExtension: true,
Expand Down

0 comments on commit 4ded60a

Please sign in to comment.