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 pipelines sync-status command flags handling #2095

Merged
merged 3 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pipelines/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func createPipelinesDetailsByFlags(c *cli.Context) (*coreConfig.ServerDetails, e
if err != nil {
return nil, err
}
if plDetails.DistributionUrl == "" {
if plDetails.PipelinesUrl == "" {
return nil, fmt.Errorf("the --pipelines-url option is mandatory")
}
return plDetails, nil
Expand Down Expand Up @@ -138,7 +138,13 @@ func syncPipelineResources(c *cli.Context) error {
// getSyncPipelineResourcesStatus fetch sync status for a given repository path and branch name
func getSyncPipelineResourcesStatus(c *cli.Context) error {
branch := c.String("branch")
if branch == "" {
return cliutils.PrintHelpAndReturnError("missing --branch <branch name>", c)
sverdlov93 marked this conversation as resolved.
Show resolved Hide resolved
}
repository := c.String("repository")
if repository == "" {
return cliutils.PrintHelpAndReturnError("missing --repository <repository name>", c)
sverdlov93 marked this conversation as resolved.
Show resolved Hide resolved
}
clientlog.Info("Fetching pipeline sync status on repository:", repository, "branch:", branch)

// Fetch service details for authentication
Expand Down
4 changes: 2 additions & 2 deletions utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ var flagsMap = map[string]cli.Flag{
},
branch: cli.StringFlag{
Name: branch,
Usage: "[Optional] Branch name to filter.` `",
Usage: "Branch name to filter.` `",
sverdlov93 marked this conversation as resolved.
Show resolved Hide resolved
},
pipelineName: cli.StringFlag{
Name: pipelineName,
Expand All @@ -1554,7 +1554,7 @@ var flagsMap = map[string]cli.Flag{
},
repository: cli.StringFlag{
Name: repository,
Usage: "[Optional] Repository name to filter resource.` `",
Usage: "Repository name to filter resource.` `",
sverdlov93 marked this conversation as resolved.
Show resolved Hide resolved
},
singleBranch: cli.BoolFlag{
Name: singleBranch,
Expand Down
Loading