Skip to content

Commit 8528206

Browse files
authored
Remove airgap bundle flag from join command (#5297)
* Remove airgap bundle flag from join command
1 parent b998072 commit 8528206

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

pkg/embeddedcluster/node_join.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,7 @@ func GenerateAddNodeCommand(ctx context.Context, kbClient kbclient.Client, token
230230
return "", fmt.Errorf("failed to get admin console port: %w", err)
231231
}
232232

233-
// if airgap, add the airgap bundle flag
234-
airgapBundleFlag := ""
235-
if isAirgap {
236-
airgapBundleFlag = fmt.Sprintf(" --airgap-bundle %s.airgap", binaryName)
237-
}
238-
239-
return fmt.Sprintf("sudo ./%s join%s %s:%d %s", binaryName, airgapBundleFlag, nodeIP, port, token), nil
233+
return fmt.Sprintf("sudo ./%s join %s:%d %s", binaryName, nodeIP, port, token), nil
240234
}
241235

242236
// GenerateK0sJoinCommand returns the k0s node join command, without the token but with all other required flags

pkg/embeddedcluster/node_join_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func TestGenerateAddNodeCommand(t *testing.T) {
9797
}
9898

9999
// Verify the generated command
100-
wantCommand = "sudo ./my-app join --airgap-bundle my-app.airgap 192.168.0.100:30000 token"
100+
wantCommand = "sudo ./my-app join 192.168.0.100:30000 token"
101101
req.Equal(wantCommand, gotCommand)
102102
}
103103

pkg/handlers/embedded_cluster_artifacts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ func (h *Handler) GetEmbeddedClusterBinary(w http.ResponseWriter, r *http.Reques
112112
}
113113
}
114114

115-
// GetEmbeddedClusterInfraImages returns the infrastructure images as a .tgz file
116-
func (h *Handler) GetEmbeddedClusterInfraImages(w http.ResponseWriter, r *http.Request) {
115+
// GetEmbeddedClusterK0sImages returns the k0s images file
116+
func (h *Handler) GetEmbeddedClusterK0sImages(w http.ResponseWriter, r *http.Request) {
117117
if !util.IsEmbeddedCluster() {
118118
logger.Error(errors.New("not an embedded cluster"))
119119
w.WriteHeader(http.StatusBadRequest)
@@ -149,7 +149,7 @@ func (h *Handler) GetEmbeddedClusterInfraImages(w http.ResponseWriter, r *http.R
149149
}
150150

151151
if imagesPath == "" {
152-
logger.Error(errors.New("no infrastructure image files found"))
152+
logger.Error(errors.New("no k0s images file found"))
153153
w.WriteHeader(http.StatusNotFound)
154154
return
155155
}

pkg/handlers/handlers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ func RegisterUnauthenticatedRoutes(handler *Handler, kotsStore store.Store, debu
391391
// This endpoint returns the embedded cluster binary as a .tgz file
392392
loggingRouter.Path("/api/v1/embedded-cluster/binary").Methods("GET").HandlerFunc(handler.GetEmbeddedClusterBinary)
393393

394-
// This endpoint returns the embedded cluster infra images file
395-
loggingRouter.Path("/api/v1/embedded-cluster/infra-images").Methods("GET").HandlerFunc(handler.GetEmbeddedClusterInfraImages)
394+
// This endpoint returns the embedded cluster k0s images file
395+
loggingRouter.Path("/api/v1/embedded-cluster/k0s-images").Methods("GET").HandlerFunc(handler.GetEmbeddedClusterK0sImages)
396396
}
397397

398398
func StreamJSON(c *gwebsocket.Conn, payload interface{}) {

0 commit comments

Comments
 (0)