From 19d58918ffeef21e1a4cbbaacb23b78904a0fc4a Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Fri, 25 Apr 2025 11:33:14 -0700 Subject: [PATCH 1/2] Remove airgap bundle flag from join command --- pkg/embeddedcluster/node_join.go | 8 +------- pkg/handlers/embedded_cluster_artifacts.go | 6 +++--- pkg/handlers/handlers.go | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/pkg/embeddedcluster/node_join.go b/pkg/embeddedcluster/node_join.go index b6f06ccc3d..90f4d057fc 100644 --- a/pkg/embeddedcluster/node_join.go +++ b/pkg/embeddedcluster/node_join.go @@ -230,13 +230,7 @@ func GenerateAddNodeCommand(ctx context.Context, kbClient kbclient.Client, token return "", fmt.Errorf("failed to get admin console port: %w", err) } - // if airgap, add the airgap bundle flag - airgapBundleFlag := "" - if isAirgap { - airgapBundleFlag = fmt.Sprintf(" --airgap-bundle %s.airgap", binaryName) - } - - return fmt.Sprintf("sudo ./%s join%s %s:%d %s", binaryName, airgapBundleFlag, nodeIP, port, token), nil + return fmt.Sprintf("sudo ./%s join %s:%d %s", binaryName, nodeIP, port, token), nil } // GenerateK0sJoinCommand returns the k0s node join command, without the token but with all other required flags diff --git a/pkg/handlers/embedded_cluster_artifacts.go b/pkg/handlers/embedded_cluster_artifacts.go index ca96b1c4d8..8864190384 100644 --- a/pkg/handlers/embedded_cluster_artifacts.go +++ b/pkg/handlers/embedded_cluster_artifacts.go @@ -112,8 +112,8 @@ func (h *Handler) GetEmbeddedClusterBinary(w http.ResponseWriter, r *http.Reques } } -// GetEmbeddedClusterInfraImages returns the infrastructure images as a .tgz file -func (h *Handler) GetEmbeddedClusterInfraImages(w http.ResponseWriter, r *http.Request) { +// GetEmbeddedClusterK0sImages returns the k0s images file +func (h *Handler) GetEmbeddedClusterK0sImages(w http.ResponseWriter, r *http.Request) { if !util.IsEmbeddedCluster() { logger.Error(errors.New("not an embedded cluster")) w.WriteHeader(http.StatusBadRequest) @@ -149,7 +149,7 @@ func (h *Handler) GetEmbeddedClusterInfraImages(w http.ResponseWriter, r *http.R } if imagesPath == "" { - logger.Error(errors.New("no infrastructure image files found")) + logger.Error(errors.New("no k0s images file found")) w.WriteHeader(http.StatusNotFound) return } diff --git a/pkg/handlers/handlers.go b/pkg/handlers/handlers.go index bd2f674f7e..13d5609992 100644 --- a/pkg/handlers/handlers.go +++ b/pkg/handlers/handlers.go @@ -391,8 +391,8 @@ func RegisterUnauthenticatedRoutes(handler *Handler, kotsStore store.Store, debu // This endpoint returns the embedded cluster binary as a .tgz file loggingRouter.Path("/api/v1/embedded-cluster/binary").Methods("GET").HandlerFunc(handler.GetEmbeddedClusterBinary) - // This endpoint returns the embedded cluster infra images file - loggingRouter.Path("/api/v1/embedded-cluster/infra-images").Methods("GET").HandlerFunc(handler.GetEmbeddedClusterInfraImages) + // This endpoint returns the embedded cluster k0s images file + loggingRouter.Path("/api/v1/embedded-cluster/k0s-images").Methods("GET").HandlerFunc(handler.GetEmbeddedClusterK0sImages) } func StreamJSON(c *gwebsocket.Conn, payload interface{}) { From 303c55c69c377fbe7f522f7d123c4c0bab0faf77 Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Fri, 25 Apr 2025 11:34:32 -0700 Subject: [PATCH 2/2] fix test --- pkg/embeddedcluster/node_join_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/embeddedcluster/node_join_test.go b/pkg/embeddedcluster/node_join_test.go index fc4ecc9ce0..18c1ec7463 100644 --- a/pkg/embeddedcluster/node_join_test.go +++ b/pkg/embeddedcluster/node_join_test.go @@ -97,7 +97,7 @@ func TestGenerateAddNodeCommand(t *testing.T) { } // Verify the generated command - wantCommand = "sudo ./my-app join --airgap-bundle my-app.airgap 192.168.0.100:30000 token" + wantCommand = "sudo ./my-app join 192.168.0.100:30000 token" req.Equal(wantCommand, gotCommand) }