Add name flag to scaffold Command#92
Open
ThorstenHans wants to merge 2 commits intospinframework:mainfrom
Open
Add name flag to scaffold Command#92ThorstenHans wants to merge 2 commits intospinframework:mainfrom
ThorstenHans wants to merge 2 commits intospinframework:mainfrom
Conversation
Signed-off-by: Thorsten Hans <thorsten.hans@fermyon.com>
rajatjindal
reviewed
Nov 5, 2024
| return nil, err | ||
| } | ||
| if len(opts.name) > 0 { | ||
| if !validateName(opts.name) { |
Member
There was a problem hiding this comment.
I am wondering if we should add this validation to the name parsed from docker image ref as well.
Author
There was a problem hiding this comment.
Hmm 🤔 In that case, I would move everything into the getNameFromImageReference function, rename it to getSpinAppName to streamline the code
Member
There was a problem hiding this comment.
I think that should be good. My only reason for that was to keep the validation for name consistent irrespective of source of that string.
Author
There was a problem hiding this comment.
@rajatjindal I've updated the PR according to the discussion we had here. As part of that, I've also added the name flag to the deploy sub command
Signed-off-by: Thorsten Hans <thorsten.hans@fermyon.com>
rajatjindal
approved these changes
Nov 9, 2024
Member
|
Hey! Happy to merge this one if this is still what we want |
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.
This PR adds an optional
nameflag to thescaffoldcommand.Motivation
As a user I want to specify a custom name when scaffolding a Kubernetes Deployment manifest for my Spin App.
Behavior
The
nameflag is optional. By default the name of the Spin App is generated using the provided OCI artifact reference (as it was before). If the--nameflag is specified, its value is validated and used for scaffolding.Validation
Only valid DNS subdomain names with less than 254 chars are considered valid. If an invalid value is provided, execution is terminated and a corresponding error message is presented to the user