Repository navigation
feat: don't apply file extension if --rename already contains it - #705
Merged
Merged
Conversation
avirtopeanu-ionos
requested review from
a team,
adeatcu-ionos,
cavramoniu-ionos,
cristiGuranIonos,
mimihalescu and
rmocanu-ionos
and
a lite review from Copilot
and removed request for
a team
August 19, 2026 09:08
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates image upload --rename behavior so user-provided rename values that already include the image file extension don’t end up with a duplicated extension, and aligns CLI/docs text and changelog with the new behavior.
Changes:
- Add
applyRenamehelper to append an image extension only when the rename value doesn’t already end with it (case-insensitive). - Update
image uploadCLI flag help text and the generated docs to reflect the new rename/extension behavior. - Add unit tests covering
applyRenameedge cases and document the fix in the changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/subcommands/Compute Engine/image/upload.md | Updates --rename help text to explain non-duplication of extensions. |
| commands/compute/image/upload.go | Uses applyRename to avoid doubling extensions when building upload names/paths. |
| commands/compute/image/upload_test.go | Adds test coverage for applyRename (including case-insensitive matching). |
| CHANGELOG.md | Documents the fixed behavior for image upload --rename. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.



if
image upload --renamealready contains a file extension, don't append the image's file extension.