Skip to content

Fix non-interactive template uploads - #228

Open
dheeraj12347 wants to merge 1 commit into
apache:mainfrom
dheeraj12347:fix-template-upload-noninteractive-227
Open

dheeraj12347 wants to merge 1 commit into
apache:mainfrom
dheeraj12347:fix-template-upload-noninteractive-227

Conversation

@dheeraj12347

Copy link
Copy Markdown
Contributor

Summary

Fixes #227.

Template uploads using filepath= failed in non-interactive mode because
UploadFiles() unconditionally used the CLI spinner.

StartSpinner() returns nil when CloudMonkey is running without a shell,
which caused a nil pointer dereference when the spinner was accessed.

This change:

  • only creates the spinner when running interactively
  • guards spinner operations when no spinner is available
  • allows file uploads to continue normally in non-interactive mode
  • adds a regression test that performs an actual multipart upload with
    HasShell=false

Validation

  • go test ./... ✅
  • go vet ./... ✅
  • git diff --check ✅
  • Regression test for non-interactive upload ✅

Fixes #227

@dheeraj12347

Copy link
Copy Markdown
Contributor Author

Hi @jl0815, @DaanHoogland I’ve opened PR #228 for #227. I traced the non-interactive template upload crash to UploadFiles() dereferencing a nil spinner when HasShell=false. The fix makes spinner handling optional while preserving interactive progress behavior, and I added a regression test that performs an actual multipart upload in non-interactive mode. go test ./..., go vet ./..., and git diff --check all pass. Would appreciate your review when you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

template upload via cmk only works in interactive mode

1 participant