Fix for ecctl deployment create bug when --version isn't provided#761
Merged
gigerdo merged 3 commits intoelastic:masterfrom Mar 23, 2026
Merged
Fix for ecctl deployment create bug when --version isn't provided#761gigerdo merged 3 commits intoelastic:masterfrom
ecctl deployment create bug when --version isn't provided#761gigerdo merged 3 commits intoelastic:masterfrom
Conversation
…--file are empty Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
gigerdo
approved these changes
Mar 23, 2026
Member
gigerdo
left a comment
There was a problem hiding this comment.
LGTM 👍 Thanks, great addition for creating deployments.
This was referenced Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
--versionis not provided toecctl deployment create, the command now automatically fetches the latest available stack version from the API and uses it. This avoids a confusing error when users omit the--versionflag.Key changes in
create.go:getLatestStackVersion()that queriesstackapi.Listfor available stack versions and picks the first (latest) one.--fileis provided, since file-based payloads carry their own version.--version not set, using latest: X.Y.Z) so the user knows which version was selected.Related Issues
#756
Motivation and Context
--versioncould lead to an empty version being passed through the deployment creation flow, resulting in unclear errors or unexpected behavior.--filepath is excluded from this behavior since the payload file already specifies its own version.How Has This Been Tested
"succeeds creating a deployment without --version by fetching latest stack version"that mocks the stack versions API returning multiple versions (7.8.0, 7.7.0, 7.6.0), verifies the latest is selected, and asserts the stderr message.cmd/deployment/pass.Types of Changes
Readiness Checklist