From 047665c81b166d5d61efb2eeae7015604b440750 Mon Sep 17 00:00:00 2001 From: divyansh42 Date: Tue, 24 Feb 2026 13:43:40 +0530 Subject: [PATCH] Update pac version Signed-off-by: divyansh42 --- Makefile | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/version.json | 2 +- .../pipelines-as-code/pkg/cli/browser/browser.go | 2 +- .../pkg/cmd/tknpac/resolve/resolve.go | 2 +- .../pipelines-as-code/pkg/params/info/info.go | 5 +++-- .../pipelines-as-code/pkg/params/run.go | 2 +- .../pipelines-as-code/pkg/params/settings/config.go | 5 +++-- .../pipelines-as-code/pkg/params/settings/default.go | 10 +++++----- .../pipelines-as-code/pkg/params/version/version.txt | 2 +- .../pipelines-as-code/pkg/resolve/remote.go | 9 +++++++++ .../pipelines-as-code/pkg/secrets/secrets.go | 4 ++-- .../pipelines-as-code/pkg/sort/repository_status.go | 6 ++---- .../pipelines-as-code/pkg/sort/task_log_snippets.go | 2 +- vendor/modules.txt | 2 +- 16 files changed, 35 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index edf23b6a9..4fcb23d72 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ MAG_VERSION := $(shell sed -n '/[ ]*github.com\/openshift-pipelines\/manual-appr GO := go GOVERSION := 1.22 -OPC_VERSION := devel +OPC_VERSION := 1.20.3 BINARYNAME := opc GOLANGCI_LINT := golangci-lint diff --git a/go.mod b/go.mod index 0d417bf5f..168d04dfc 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.5 require ( github.com/openshift-pipelines/manual-approval-gate v0.6.0 - github.com/openshift-pipelines/pipelines-as-code v0.37.5 + github.com/openshift-pipelines/pipelines-as-code v0.37.7 github.com/spf13/cobra v1.10.2 github.com/tektoncd/cli v0.42.1 github.com/tektoncd/results v0.16.0 diff --git a/go.sum b/go.sum index 879d7a0a0..438a08a4b 100644 --- a/go.sum +++ b/go.sum @@ -822,8 +822,8 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/openshift-pipelines/manual-approval-gate v0.6.0 h1:ohvFnwfgqTEpWOjzJb9gcYo0mND+V28F7ce/VdNug70= github.com/openshift-pipelines/manual-approval-gate v0.6.0/go.mod h1:2Qp7sSrb3d9SDC8n9b43KrHw2T7RD/BGpm3TQlfIwOI= -github.com/openshift-pipelines/pipelines-as-code v0.37.5 h1:zKXjzrSb/umsvIBHlE/KaMLQDzF33FGhhnDNlG9hcVI= -github.com/openshift-pipelines/pipelines-as-code v0.37.5/go.mod h1:o0xBfgt16RSYxsH+s9/Lu4hOrtYIa/VL/L5NXDJULl8= +github.com/openshift-pipelines/pipelines-as-code v0.37.7 h1:iV/QZxJl/wmgfze+RD7YnIljFZ1uHoy4QhgRJjDQmkE= +github.com/openshift-pipelines/pipelines-as-code v0.37.7/go.mod h1:o0xBfgt16RSYxsH+s9/Lu4hOrtYIa/VL/L5NXDJULl8= github.com/openshift/api v0.0.0-20250414140316-b7680e188c5e h1:knmBEwTQ//pHhX7KxflegQwvlXfGf50nh5wdpJh9tq8= github.com/openshift/api v0.0.0-20250414140316-b7680e188c5e/go.mod h1:yk60tHAmHhtVpJQo3TwVYq2zpuP70iJIFDCmeKMIzPw= github.com/openshift/client-go v0.0.0-20250402181141-b3bad3b645f2 h1:bPXR0R8zp1o12nSUphN26hSM+OKYq5pMorbDCpApzDQ= diff --git a/pkg/version.json b/pkg/version.json index 0e8a64922..7ddcd8459 100644 --- a/pkg/version.json +++ b/pkg/version.json @@ -1 +1 @@ -{"pac": "0.37.5", "tkn": "0.42.1", "results": "0.16.0", "manualapprovalgate": "0.6.0", "opc": "devel"} +{"pac": "0.37.7", "tkn": "0.42.1", "results": "0.16.0", "manualapprovalgate": "0.6.0", "opc": "1.20.3"} diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cli/browser/browser.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cli/browser/browser.go index aa518b05d..67766761f 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cli/browser/browser.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cli/browser/browser.go @@ -10,7 +10,7 @@ import ( func OpenWebBrowser(ctx context.Context, url string) error { var cmd string - args := []string{} + args := make([]string, 0, 1) switch runtime.GOOS { case "windows": cmd = "cmd" diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cmd/tknpac/resolve/resolve.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cmd/tknpac/resolve/resolve.go index 447f31dbf..81d07ae62 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cmd/tknpac/resolve/resolve.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/cmd/tknpac/resolve/resolve.go @@ -104,7 +104,7 @@ func Command(run *params.Run, streams *cli.IOStreams) *cobra.Command { return fmt.Errorf("you need to at least specify a file with -f") } - if err := settings.SyncConfig(run.Clients.Log, &run.Info.Pac.Settings, map[string]string{}, settings.DefaultValidators()); err != nil { + if err := settings.SyncConfig(run.Clients.Log, &run.Info.Pac.Settings, map[string]string{}, settings.DefaultValidators(), &run.Clients.HTTP); err != nil { return err } diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/info/info.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/info/info.go index 729b439f2..81186edcf 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/info/info.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/info/info.go @@ -1,6 +1,7 @@ package info import ( + "net/http" "sync" "github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings" @@ -36,14 +37,14 @@ func (i *Info) GetPacOpts() PacOpts { return *i.Pac } -func (i *Info) UpdatePacOpts(logger *zap.SugaredLogger, configData map[string]string) (*settings.Settings, error) { +func (i *Info) UpdatePacOpts(logger *zap.SugaredLogger, configData map[string]string, httpClient *http.Client) (*settings.Settings, error) { if i.pacMutex == nil { i.pacMutex = &sync.Mutex{} } i.pacMutex.Lock() defer i.pacMutex.Unlock() - if err := settings.SyncConfig(logger, &i.Pac.Settings, configData, settings.DefaultValidators()); err != nil { + if err := settings.SyncConfig(logger, &i.Pac.Settings, configData, settings.DefaultValidators(), httpClient); err != nil { return nil, err } return &i.Pac.Settings, nil diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/run.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/run.go index e31f90041..1f94da2eb 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/run.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/run.go @@ -28,7 +28,7 @@ func (r *Run) UpdatePacConfig(ctx context.Context) error { return err } - updatedPacInfo, err := r.Info.UpdatePacOpts(r.Clients.Log, cfg.Data) + updatedPacInfo, err := r.Info.UpdatePacOpts(r.Clients.Log, cfg.Data, &r.Clients.HTTP) if err != nil { return err } diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/config.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/config.go index 6c853fd56..c68cc1df7 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/config.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/config.go @@ -2,6 +2,7 @@ package settings import ( "fmt" + "net/http" "net/url" "regexp" "strings" @@ -112,8 +113,8 @@ func DefaultValidators() map[string]func(string) error { } } -func SyncConfig(logger *zap.SugaredLogger, setting *Settings, config map[string]string, validators map[string]func(string) error) error { - setting.HubCatalogs = getHubCatalogs(logger, setting.HubCatalogs, config) +func SyncConfig(logger *zap.SugaredLogger, setting *Settings, config map[string]string, validators map[string]func(string) error, httpClient *http.Client) error { + setting.HubCatalogs = getHubCatalogs(logger, setting.HubCatalogs, config, httpClient) err := configutil.ValidateAndAssignValues(logger, config, setting, validators, true) if err != nil { diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/default.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/default.go index f0ea70ec8..c784ac0c5 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/default.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings/default.go @@ -13,7 +13,7 @@ import ( "go.uber.org/zap" ) -func getHubCatalogs(logger *zap.SugaredLogger, catalogs *sync.Map, config map[string]string) *sync.Map { +func getHubCatalogs(logger *zap.SugaredLogger, catalogs *sync.Map, config map[string]string, httpClient *http.Client) *sync.Map { if catalogs == nil { catalogs = &sync.Map{} } @@ -25,7 +25,7 @@ func getHubCatalogs(logger *zap.SugaredLogger, catalogs *sync.Map, config map[st if hubType, ok := config[HubCatalogTypeKey]; !ok || hubType == "" { config[HubCatalogTypeKey] = hubtypes.ArtifactHubType if config[HubURLKey] != "" { - config[HubCatalogTypeKey] = getHubCatalogTypeViaAPI(config[HubURLKey]) + config[HubCatalogTypeKey] = getHubCatalogTypeViaAPI(config[HubURLKey], httpClient) } } else if hubType != hubtypes.ArtifactHubType && hubType != hubtypes.TektonHubType { logger.Warnf("CONFIG: invalid hub type %s, defaulting to %s", hubType, hubtypes.ArtifactHubType) @@ -90,7 +90,7 @@ func getHubCatalogs(logger *zap.SugaredLogger, catalogs *sync.Map, config map[st catalogName := config[fmt.Sprintf("%s-name", cPrefix)] catalogType := config[fmt.Sprintf("%s-type", cPrefix)] if catalogType == "" { - catalogType = hubtypes.ArtifactHubType // default to artifact hub if not specified + catalogType = getHubCatalogTypeViaAPI(config[fmt.Sprintf("%s-url", cPrefix)], httpClient) } value, ok := catalogs.Load(catalogID) @@ -113,7 +113,7 @@ func getHubCatalogs(logger *zap.SugaredLogger, catalogs *sync.Map, config map[st return catalogs } -func getHubCatalogTypeViaAPI(hubURL string) string { +func getHubCatalogTypeViaAPI(hubURL string, httpClient *http.Client) string { statsURL := fmt.Sprintf("%s/api/v1/stats", strings.TrimSuffix(hubURL, "/")) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) @@ -124,7 +124,7 @@ func getHubCatalogTypeViaAPI(hubURL string) string { return hubtypes.TektonHubType } - resp, err := http.DefaultClient.Do(req) + resp, err := httpClient.Do(req) if err != nil { return hubtypes.TektonHubType } diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt index f3d8baac6..d14b36fc1 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt @@ -1 +1 @@ -v0.37.4 +v0.37.6 diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/resolve/remote.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/resolve/remote.go index f16296621..fb6451ac2 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/resolve/remote.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/resolve/remote.go @@ -5,6 +5,7 @@ import ( "fmt" "net/url" "path" + "strings" "github.com/openshift-pipelines/pipelines-as-code/pkg/matcher" tektonv1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" @@ -32,6 +33,14 @@ func assembleTaskFQDNs(pipelineURL string, tasks []string) ([]string, error) { return tasks, nil // no pipeline URL, return tasks as is } + // Only HTTP(S) URLs can serve as base for relative task resolution. + // Hub catalog references (e.g., "catalog://resource:version") use a + // different scheme where relative paths are meaningless. + lowered := strings.ToLower(pipelineURL) + if !strings.HasPrefix(lowered, "http://") && !strings.HasPrefix(lowered, "https://") { + return tasks, nil + } + pURL, err := url.Parse(pipelineURL) if err != nil { return tasks, err diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/secrets/secrets.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/secrets/secrets.go index 843eb43b1..493e32660 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/secrets/secrets.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/secrets/secrets.go @@ -66,8 +66,8 @@ func GetSecretsAttachedToPipelineRun(ctx context.Context, k kubeinteraction.Inte // if we don't sort by longest then if there two passwords with the same prefix // the shortest one will replace and would leak the end of the passwords of the longest after. func sortSecretsByLongests(values []ktypes.SecretValue) []ktypes.SecretValue { - ret := []ktypes.SecretValue{} - ret = append(ret, values...) + ret := make([]ktypes.SecretValue, len(values)) + copy(ret, values) for i := 0; i < len(ret); i++ { for j := i + 1; j < len(ret); j++ { if len(ret[i].Value) < len(ret[j].Value) { diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/repository_status.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/repository_status.go index c3750c6e6..5f762f268 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/repository_status.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/repository_status.go @@ -29,10 +29,8 @@ func (rs repoSortRunStatus) Less(i, j int) bool { } func RepositorySortRunStatus(repoStatus []v1alpha1.RepositoryRunStatus) []v1alpha1.RepositoryRunStatus { - rrstatus := repoSortRunStatus{} - for _, status := range repoStatus { - rrstatus = append(rrstatus, status) - } + rrstatus := make(repoSortRunStatus, len(repoStatus)) + copy(rrstatus, repoStatus) sort.Sort(rrstatus) return rrstatus } diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/task_log_snippets.go b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/task_log_snippets.go index 1b9ef3ddd..a82c032ae 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/task_log_snippets.go +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/sort/task_log_snippets.go @@ -19,7 +19,7 @@ func (s taskInfoSorter) Less(i, j int) bool { } func TaskInfos(taskinfos map[string]pacv1alpha1.TaskInfos) []pacv1alpha1.TaskInfos { - tis := taskInfoSorter{} + tis := make(taskInfoSorter, 0, len(taskinfos)) for _, ti := range taskinfos { tis = append(tis, ti) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 7fffa71fe..bd3571f9e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1258,7 +1258,7 @@ github.com/openshift-pipelines/manual-approval-gate/pkg/cli/formatter github.com/openshift-pipelines/manual-approval-gate/pkg/client/clientset/versioned github.com/openshift-pipelines/manual-approval-gate/pkg/client/clientset/versioned/scheme github.com/openshift-pipelines/manual-approval-gate/pkg/client/clientset/versioned/typed/approvaltask/v1alpha1 -# github.com/openshift-pipelines/pipelines-as-code v0.37.5 +# github.com/openshift-pipelines/pipelines-as-code v0.37.7 ## explicit; go 1.23.8 github.com/openshift-pipelines/pipelines-as-code/pkg/acl github.com/openshift-pipelines/pipelines-as-code/pkg/action