Skip to content

Commit

Permalink
Fix docker nil pointer for endpoint host aws iam auth reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude committed Feb 13, 2024
1 parent 8c148a1 commit a6c6c7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/awsiamauth/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/awsiamauth"
anywhereCluster "github.com/aws/eks-anywhere/pkg/cluster"
Expand Down Expand Up @@ -154,7 +155,11 @@ func (r *Reconciler) applyIAMAuthManifest(ctx context.Context, client client.Cli
}

func (r *Reconciler) createKubeconfigSecret(ctx context.Context, clusterSpec *anywhereCluster.Spec, cluster *anywherev1.Cluster, clusterID uuid.UUID) error {
apiServerEndpoint := fmt.Sprintf("https://%s:6443", cluster.Spec.ControlPlaneConfiguration.Endpoint.Host)
endpoint := "127.0.0.1"
if cluster.Spec.DatacenterRef.Kind != v1alpha1.DockerDatacenterKind {
endpoint = cluster.Spec.ControlPlaneConfiguration.Endpoint.Host
}
apiServerEndpoint := fmt.Sprintf("https://%s:6443", endpoint)

clusterCaSecretName := clusterapi.ClusterCASecretName(cluster.Name)
clusterCaSecret := &corev1.Secret{}
Expand Down

0 comments on commit a6c6c7b

Please sign in to comment.