Skip to content

Commit

Permalink
chore: improve error msg when PAC is not installed (#1742)
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
  • Loading branch information
zroubalik committed May 17, 2023
1 parent 9a790f0 commit 702da8a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/pipelines/tekton/pipelines_pac_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ func (pp *PipelinesProvider) createClusterResources(ctx context.Context, f fn.Fu
// figure out pac installation namespace
installed, _, err := pac.DetectPACInstallation(ctx, "")
if !installed {
return fmt.Errorf("pipelines as code not installed: %w", err)
errMsg := ""
if err != nil {
errMsg = fmt.Sprintf(", %v", err)
}
return fmt.Errorf("pipelines as code not installed%s", errMsg)
}
if installed && err != nil {
return err
Expand Down Expand Up @@ -193,7 +197,11 @@ func (pp *PipelinesProvider) createRemoteResources(ctx context.Context, f fn.Fun
// figure out pac installation namespace
installed, installationNS, err := pac.DetectPACInstallation(ctx, "")
if !installed {
return fmt.Errorf("pipelines as code not installed: %w", err)
errMsg := ""
if err != nil {
errMsg = fmt.Sprintf(", %v", err)
}
return fmt.Errorf("pipelines as code not installed%s", errMsg)
}
if installed && err != nil {
return err
Expand Down

0 comments on commit 702da8a

Please sign in to comment.