Skip to content

Commit

Permalink
test(helper): add coverage on getTargetEnvironment method (#5639)
Browse files Browse the repository at this point in the history
Co-authored-by: Jessie Wang <[email protected]>
  • Loading branch information
techworldhello and Jessie Wang authored Jan 23, 2025
1 parent cfe184d commit c16abcc
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions aks-node-controller/parser/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,42 @@ func Test_getTargetEnvironment(t *testing.T) {
},
want: helpers.AksCustomCloudName,
},
{
name: "China location cluster config",
args: args{
v: &aksnodeconfigv1.Configuration{
CustomCloudConfig: &aksnodeconfigv1.CustomCloudConfig{},
ClusterConfig: &aksnodeconfigv1.ClusterConfig{
Location: "china",
},
},
},
want: "AzureChinaCloud",
},
{
name: "Germany location cluster config",
args: args{
v: &aksnodeconfigv1.Configuration{
CustomCloudConfig: &aksnodeconfigv1.CustomCloudConfig{},
ClusterConfig: &aksnodeconfigv1.ClusterConfig{
Location: "germanynortheast",
},
},
},
want: "AzureGermanCloud",
},
{
name: "usgov location cluster config",
args: args{
v: &aksnodeconfigv1.Configuration{
CustomCloudConfig: &aksnodeconfigv1.CustomCloudConfig{},
ClusterConfig: &aksnodeconfigv1.ClusterConfig{
Location: "usdod",
},
},
},
want: "AzureUSGovernmentCloud",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit c16abcc

Please sign in to comment.