Skip to content

Commit e2d71bc

Browse files
authored
include the airgap registry cluster IP in the node join response (#4553)
* include the airgap registry cluster IP in the node join response * use kotsutil.GetEmbeddedRegistryCreds
1 parent ea2056e commit e2d71bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/handlers/embedded_cluster_node_join_command.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ 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"
@@ -24,6 +25,8 @@ type GetEmbeddedClusterNodeJoinCommandResponse struct {
2425
EndUserK0sConfigOverrides string `json:"endUserK0sConfigOverrides"`
2526
MetricsBaseURL string `json:"metricsBaseURL"`
2627
EmbeddedClusterVersion string `json:"embeddedClusterVersion"`
28+
AirgapRegistryAddress string `json:"airgapRegistryAddress"`
29+
IsAirgap bool `json:"isAirgap"`
2730
}
2831

2932
type GenerateEmbeddedClusterNodeJoinCommandRequest struct {
@@ -163,6 +166,11 @@ func (h *Handler) GetEmbeddedClusterNodeJoinCommand(w http.ResponseWriter, r *ht
163166
ecVersion = install.Spec.Config.Version
164167
}
165168

169+
airgapRegistryAddress := ""
170+
if install.Spec.AirGap {
171+
airgapRegistryAddress, _, _ = kotsutil.GetEmbeddedRegistryCreds(client)
172+
}
173+
166174
JSON(w, http.StatusOK, GetEmbeddedClusterNodeJoinCommandResponse{
167175
ClusterID: clusterID,
168176
K0sJoinCommand: k0sJoinCommand,
@@ -171,5 +179,7 @@ func (h *Handler) GetEmbeddedClusterNodeJoinCommand(w http.ResponseWriter, r *ht
171179
EndUserK0sConfigOverrides: endUserK0sConfigOverrides,
172180
MetricsBaseURL: install.Spec.MetricsBaseURL,
173181
EmbeddedClusterVersion: ecVersion,
182+
AirgapRegistryAddress: airgapRegistryAddress,
183+
IsAirgap: install.Spec.AirGap,
174184
})
175185
}

0 commit comments

Comments
 (0)