Skip to content

Commit 5e68e34

Browse files
committed
use kotsutil.GetEmbeddedRegistryCreds
1 parent 33a17b1 commit 5e68e34

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/handlers/embedded_cluster_node_join_command.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77

88
"github.com/replicatedhq/kots/pkg/embeddedcluster"
99
"github.com/replicatedhq/kots/pkg/k8sutil"
10+
"github.com/replicatedhq/kots/pkg/kotsutil"
1011
"github.com/replicatedhq/kots/pkg/logger"
1112
"github.com/replicatedhq/kots/pkg/store"
1213
"github.com/replicatedhq/kots/pkg/util"
13-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1414
)
1515

1616
type GenerateEmbeddedClusterNodeJoinCommandResponse struct {
@@ -168,13 +168,7 @@ func (h *Handler) GetEmbeddedClusterNodeJoinCommand(w http.ResponseWriter, r *ht
168168

169169
airgapRegistryAddress := ""
170170
if install.Spec.AirGap {
171-
airgapRegistrySvc, err := client.CoreV1().Services("registry").Get(r.Context(), "registry", metav1.GetOptions{})
172-
if err != nil {
173-
logger.Error(fmt.Errorf("failed to get airgap registry service: %w", err))
174-
w.WriteHeader(http.StatusInternalServerError)
175-
return
176-
}
177-
airgapRegistryAddress = fmt.Sprintf("%s:5000", airgapRegistrySvc.Spec.ClusterIP)
171+
airgapRegistryAddress, _, _ = kotsutil.GetEmbeddedRegistryCreds(client)
178172
}
179173

180174
JSON(w, http.StatusOK, GetEmbeddedClusterNodeJoinCommandResponse{

0 commit comments

Comments
 (0)