Skip to content

Remove airgap bundle flag from join command #5297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions pkg/embeddedcluster/node_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/embeddedcluster/node_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/handlers/embedded_cluster_artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}) {
Expand Down
Loading