Skip to content

Commit 77e2c3e

Browse files
committed
Try to get config configMap when doing tkn-pac resolv
If it doesn't work, defaults will be used.
1 parent b066d13 commit 77e2c3e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/cmd/tknpac/resolve/resolve.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ func Command(run *params.Run) *cobra.Command {
7171
return err
7272
}
7373
}
74+
75+
if err := run.GetConfigFromConfigMap(ctx); err != nil {
76+
log.Printf("Warning: cannot get pipelines-as-code config map in pipelines-as-code namespace. Using defaults. Error: %v\n", err)
77+
}
78+
7479
if len(filenames) == 0 {
7580
return fmt.Errorf("you need to at least specify a file with -f")
7681
}

pkg/cmd/tknpac/resolve/resolve_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestSplitArgsInMap(t *testing.T) {
4242

4343
func TestCommandFilenameSetProperly(t *testing.T) {
4444
cs := &params.Run{
45-
Clients: clients.Clients{ClientInitialized: true},
45+
Clients: clients.Clients{ClientInitialized: false},
4646
Info: info.Info{Pac: &info.PacOpts{}},
4747
}
4848
cmd := Command(cs)

0 commit comments

Comments
 (0)