Make branch arg required for image updates
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@@ -50,7 +50,7 @@ var imageUpdateArgs = imageUpdateFlags{}
|
|||||||
func init() {
|
func init() {
|
||||||
flags := createImageUpdateCmd.Flags()
|
flags := createImageUpdateCmd.Flags()
|
||||||
flags.StringVar(&imageUpdateArgs.gitRepoRef, "git-repo-ref", "", "the name of a GitRepository resource with details of the upstream git repository")
|
flags.StringVar(&imageUpdateArgs.gitRepoRef, "git-repo-ref", "", "the name of a GitRepository resource with details of the upstream git repository")
|
||||||
flags.StringVar(&imageUpdateArgs.branch, "branch", "", "the branch to push commits to")
|
flags.StringVar(&imageUpdateArgs.branch, "branch", "", "the branch to checkout and push commits to")
|
||||||
flags.StringVar(&imageUpdateArgs.commitTemplate, "commit-template", "", "a template for commit messages")
|
flags.StringVar(&imageUpdateArgs.commitTemplate, "commit-template", "", "a template for commit messages")
|
||||||
flags.StringVar(&imageUpdateArgs.authorName, "author-name", "", "the name to use for commit author")
|
flags.StringVar(&imageUpdateArgs.authorName, "author-name", "", "the name to use for commit author")
|
||||||
flags.StringVar(&imageUpdateArgs.authorEmail, "author-email", "", "the email to use for commit author")
|
flags.StringVar(&imageUpdateArgs.authorEmail, "author-email", "", "the email to use for commit author")
|
||||||
@@ -68,6 +68,10 @@ func createImageUpdateRun(cmd *cobra.Command, args []string) error {
|
|||||||
return fmt.Errorf("a reference to a GitRepository is required (--git-repo-ref)")
|
return fmt.Errorf("a reference to a GitRepository is required (--git-repo-ref)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if imageUpdateArgs.branch == "" {
|
||||||
|
return fmt.Errorf("the Git repoistory branch is required (--branch)")
|
||||||
|
}
|
||||||
|
|
||||||
labels, err := parseLabels()
|
labels, err := parseLabels()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ flux create image update <name> [flags]
|
|||||||
```
|
```
|
||||||
--author-email string the email to use for commit author
|
--author-email string the email to use for commit author
|
||||||
--author-name string the name to use for commit author
|
--author-name string the name to use for commit author
|
||||||
--branch string the branch to push commits to
|
--branch string the branch to checkout and push commits to
|
||||||
--commit-template string a template for commit messages
|
--commit-template string a template for commit messages
|
||||||
--git-repo-ref string the name of a GitRepository resource with details of the upstream git repository
|
--git-repo-ref string the name of a GitRepository resource with details of the upstream git repository
|
||||||
-h, --help help for update
|
-h, --help help for update
|
||||||
|
|||||||
Reference in New Issue
Block a user