Skip to content

Commit

Permalink
Fix AKS connectivity (#3964)
Browse files Browse the repository at this point in the history
* Restore missing serverFqdn parameter

* Fix validate-go
  • Loading branch information
kimorris27 authored Nov 20, 2024
1 parent 65499d7 commit e7f6866
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ import (

"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
armcontainerservice "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6"

"github.com/Azure/ARO-RP/pkg/util/pointerutils"
)

// ManagedClustersAddons is a minimal interface for azure ManagedClustersAddons
type ManagedClustersAddons interface {
ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (armcontainerservice.ManagedClustersClientListClusterAdminCredentialsResponse, error)
ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (armcontainerservice.ManagedClustersClientListClusterAdminCredentialsResponse, error)
List(ctx context.Context) *runtime.Pager[armcontainerservice.ManagedClustersClientListResponse]
}

func (r *managedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (armcontainerservice.ManagedClustersClientListClusterAdminCredentialsResponse, error) {
return r.ManagedClustersClient.ListClusterAdminCredentials(ctx, resourceGroupName, resourceName, nil)
func (r *managedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (armcontainerservice.ManagedClustersClientListClusterAdminCredentialsResponse, error) {
return r.ManagedClustersClient.ListClusterAdminCredentials(ctx, resourceGroupName, resourceName, &armcontainerservice.ManagedClustersClientListClusterAdminCredentialsOptions{
ServerFqdn: pointerutils.ToPtr(serverFqdn),
})
}

func (r *managedClustersClient) List(ctx context.Context) *runtime.Pager[armcontainerservice.ManagedClustersClientListResponse] {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/liveconfig/hive.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func getAksShardKubeconfig(ctx context.Context, managedClustersClient utilcontai

aksResourceGroup := strings.Replace(*aksCluster.Properties.NodeResourceGroup, fmt.Sprintf("-aks%d", shard), "", 1)

res, err := managedClustersClient.ListClusterAdminCredentials(ctx, aksResourceGroup, aksClusterName)
res, err := managedClustersClient.ListClusterAdminCredentials(ctx, aksResourceGroup, aksClusterName, "public")
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/liveconfig/hive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestProdHiveAdmin(t *testing.T) {
t.Fatal(errors.New("expected name of first managed clusters list to match first page results"))
}

adminCredsResult, err := mcc.ListClusterAdminCredentials(ctx, "rp-eastus", "aro-ak-cluster-001")
adminCredsResult, err := mcc.ListClusterAdminCredentials(ctx, "rp-eastus", "aro-ak-cluster-001", "public")
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit e7f6866

Please sign in to comment.