Skip to content
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

fix: add immage flag for . image convention #69

Merged
merged 1 commit into from Feb 2, 2024

Conversation

chrishumanitec
Copy link
Contributor

Add -i|--image flag to allow for specifying the image to override when the image property in a score file has a value .

Description

  • Added a new Flag to all commands
  • Added a backwards compatible implementation to override .containers.{containerId}.image where the value is .

What does this PR do?

It is a convention when working with score that setting the image to . means: "the image in the current context". Usually, this means the image that is associated with the score file. The CI pipeline will know the generated image to be inserted.

Today, there are a number of workarounds involving --property overrides (which require knowledge of the container IDs) or even sed scripts such as:

sed -i -E "s/^(\\s+image:)\\s+.*\$/\\1 '${IMAGE_NAME}'/" score.yaml

This change will make updated in the current image much simpler:

score-humanitec delta -i my-image:my-tag --org....

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New chore (expected functionality to be implemented)

Checklist:

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I've signed off with an email address that matches the commit author.

internal/command/run.go Outdated Show resolved Hide resolved
Copy link
Member

@astromechza astromechza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, just a duplicated typo in the flag description.

Signed-off-by: Chris Stephenson <chris.stephenson@humanitec.com>
@chrishumanitec
Copy link
Contributor Author

Change looks good, just a duplicated typo in the flag description.

Fixed the duplicated text and rebased to main.

Copy link
Member

@astromechza astromechza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chrishumanitec chrishumanitec merged commit 6355a99 into main Feb 2, 2024
3 checks passed
@chrishumanitec chrishumanitec deleted the image-replacement-convention branch February 2, 2024 08:59
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.

None yet

2 participants