diff --git a/pkg/handlers/embedded_cluster_node_join_command.go b/pkg/handlers/embedded_cluster_node_join_command.go index 06c3b19637..4355784d42 100644 --- a/pkg/handlers/embedded_cluster_node_join_command.go +++ b/pkg/handlers/embedded_cluster_node_join_command.go @@ -7,6 +7,7 @@ import ( "github.com/replicatedhq/kots/pkg/embeddedcluster" "github.com/replicatedhq/kots/pkg/k8sutil" + "github.com/replicatedhq/kots/pkg/kotsutil" "github.com/replicatedhq/kots/pkg/logger" "github.com/replicatedhq/kots/pkg/store" "github.com/replicatedhq/kots/pkg/util" @@ -24,6 +25,8 @@ type GetEmbeddedClusterNodeJoinCommandResponse struct { EndUserK0sConfigOverrides string `json:"endUserK0sConfigOverrides"` MetricsBaseURL string `json:"metricsBaseURL"` EmbeddedClusterVersion string `json:"embeddedClusterVersion"` + AirgapRegistryAddress string `json:"airgapRegistryAddress"` + IsAirgap bool `json:"isAirgap"` } type GenerateEmbeddedClusterNodeJoinCommandRequest struct { @@ -163,6 +166,11 @@ func (h *Handler) GetEmbeddedClusterNodeJoinCommand(w http.ResponseWriter, r *ht ecVersion = install.Spec.Config.Version } + airgapRegistryAddress := "" + if install.Spec.AirGap { + airgapRegistryAddress, _, _ = kotsutil.GetEmbeddedRegistryCreds(client) + } + JSON(w, http.StatusOK, GetEmbeddedClusterNodeJoinCommandResponse{ ClusterID: clusterID, K0sJoinCommand: k0sJoinCommand, @@ -171,5 +179,7 @@ func (h *Handler) GetEmbeddedClusterNodeJoinCommand(w http.ResponseWriter, r *ht EndUserK0sConfigOverrides: endUserK0sConfigOverrides, MetricsBaseURL: install.Spec.MetricsBaseURL, EmbeddedClusterVersion: ecVersion, + AirgapRegistryAddress: airgapRegistryAddress, + IsAirgap: install.Spec.AirGap, }) }