Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/manifestival/client-go-client v0.6.0
github.com/manifestival/manifestival v0.7.2
github.com/markbates/inflect v1.0.4
github.com/openshift-pipelines/pipelines-as-code v0.37.4
github.com/openshift-pipelines/pipelines-as-code v0.37.7
github.com/openshift-pipelines/tektoncd-pruner v0.0.0-20250711075231-9c8624123820
github.com/openshift/api v0.0.0-20240521185306-0314f31e7774
github.com/openshift/apiserver-library-go v0.0.0-20230816171015-6bfafa975bfb
Expand All @@ -19,9 +19,9 @@ require (
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
github.com/tektoncd/pipeline v1.3.1
github.com/tektoncd/pipeline v1.3.2
github.com/tektoncd/plumbing v0.0.0-20250630062957-f863d38f433a
github.com/tektoncd/triggers v0.32.0
github.com/tektoncd/triggers v0.33.0
go.opencensus.io v0.24.0
go.uber.org/zap v1.27.1
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/openshift-pipelines/pipelines-as-code v0.37.4 h1:bf+mz6qKQ7PozB+VZmpfxpSPXlfMKkg0cYr1o3bS6p4=
github.com/openshift-pipelines/pipelines-as-code v0.37.4/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-pipelines/tektoncd-pruner v0.0.0-20250711075231-9c8624123820 h1:+/fO+q9MDSvTWGHrX4pm2ZZsnmyRKLhgTEMLXNwZ51c=
github.com/openshift-pipelines/tektoncd-pruner v0.0.0-20250711075231-9c8624123820/go.mod h1:Za44xopzfXjqqOzpn1t46BWr5aLL3KjJLt9pMsCzvL0=
github.com/openshift/api v0.0.0-20240521185306-0314f31e7774 h1:SsoLnIil/D0FcjUbQ9Z8h95B7rxFvrso2X6OQjR8jPw=
Expand Down Expand Up @@ -1191,12 +1191,12 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDd
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/tchap/go-patricia/v2 v2.3.3 h1:xfNEsODumaEcCcY3gI0hYPZ/PcpVv5ju6RMAhgwZDDc=
github.com/tchap/go-patricia/v2 v2.3.3/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k=
github.com/tektoncd/pipeline v1.3.1 h1:GOp49pAMPCXYX1E/cSc2JAm7j4vEB68DOOhGkSoaAmI=
github.com/tektoncd/pipeline v1.3.1/go.mod h1:924mFZJC0FXYruna4kDisnfFnRowJQgRgLpJuGbjNPQ=
github.com/tektoncd/pipeline v1.3.2 h1:aOOMa4/u1b+nExxIPVMW7++hJMJQhtSpLisoKdUFQ+c=
github.com/tektoncd/pipeline v1.3.2/go.mod h1:924mFZJC0FXYruna4kDisnfFnRowJQgRgLpJuGbjNPQ=
github.com/tektoncd/plumbing v0.0.0-20250630062957-f863d38f433a h1:a9/eNSSAsC+7N33gPdqubmdvCYZpfVXAzyyo+RPl7ms=
github.com/tektoncd/plumbing v0.0.0-20250630062957-f863d38f433a/go.mod h1:BC6F3DlZc+wpUT9YcwG9MoSfb4tUiH2olB9xYoIsB4I=
github.com/tektoncd/triggers v0.32.0 h1:aUo2ePkbvwJaUC8+S66gLuryF17O+I2K/gzQaXjlsm8=
github.com/tektoncd/triggers v0.32.0/go.mod h1:dfJ0Dnp4vl/PflXO3cSgs4aYLxdU5DMAY/BCKI2oUmM=
github.com/tektoncd/triggers v0.33.0 h1:pG2Kz/2FHjysGG4GGhiGp9hHdwA8BLZI3H7m9U9sj4M=
github.com/tektoncd/triggers v0.33.0/go.mod h1:V2CTUxZB6zwymfeUnsZqFEwtkN6ClT+chtxr03N3L7c=
github.com/thales-e-security/pool v0.0.2 h1:RAPs4q2EbWsTit6tpzuvTFlgFRJ3S8Evf5gtvVDbmPg=
github.com/thales-e-security/pool v0.0.2/go.mod h1:qtpMm2+thHtqhLzTwgDBj/OuNnMpupY8mv0Phz0gjhU=
github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
"context"
"fmt"
"net/http"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -47,7 +48,7 @@ func (set *PACSettings) setPACDefaults(logger *zap.SugaredLogger) {
}
defaultPacSettings := pacSettings.Settings{}

err := pacSettings.SyncConfig(logger, &defaultPacSettings, set.Settings, map[string]func(string) error{})
err := pacSettings.SyncConfig(logger, &defaultPacSettings, set.Settings, map[string]func(string) error{}, http.DefaultClient)
if err != nil {
logger.Error("error on applying default PAC settings", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func TestSetPACControllerDefaultSettingsWithMultipleCatalogs(t *testing.T) {
"catalog-1-url": "https://api.other.com/v1",
"catalog-5-id": "anotherhub5",
"catalog-5-name": "tekton1",
"catalog-5-url": "https://api.other.com/v2",
"catalog-5-url": "https://artifacthub.io/api/v1",
},
},
},
Expand All @@ -162,12 +162,12 @@ func TestSetPACControllerDefaultSettingsWithMultipleCatalogs(t *testing.T) {
"bitbucket-cloud-check-source-ip": "true",
"catalog-1-id": "anotherhub",
"catalog-1-name": "tekton",
"catalog-1-type": "artifacthub",
"catalog-1-type": "tektonhub",
"catalog-1-url": "https://api.other.com/v1",
"catalog-5-id": "anotherhub5",
"catalog-5-name": "tekton1",
"catalog-5-type": "artifacthub",
"catalog-5-url": "https://api.other.com/v2",
"catalog-5-url": "https://artifacthub.io/api/v1",
"custom-console-name": "",
"custom-console-url": "",
"custom-console-url-namespace": "",
Expand Down Expand Up @@ -250,3 +250,27 @@ func TestSetAdditionalPACControllerDefaultHavingAdditionalPACController(t *testi
assert.Equal(t, "custom", opacCR.Spec.PACSettings.AdditionalPACControllers["test"].Settings["custom-console-name"])
assert.Equal(t, "https://custom.com", opacCR.Spec.PACSettings.AdditionalPACControllers["test"].Settings["custom-console-url"])
}

func TestSetPACControllerDefaultWhenNotArtifactHubSetsTektonHub(t *testing.T) {
// When default catalog is not artifacthub, operator sets it to tektonhub
opacCR := &OpenShiftPipelinesAsCode{
ObjectMeta: metav1.ObjectMeta{
Name: "name",
Namespace: "namespace",
},
Spec: OpenShiftPipelinesAsCodeSpec{
PACSettings: PACSettings{
Settings: map[string]string{
"hub-catalog-type": "tektonhub",
"hub-url": "https://api.hub.tekton.dev/v1",
},
},
},
}

opacCR.Spec.PACSettings.setPACDefaults(zap.NewNop().Sugar())

// Default catalog should be tektonhub when not artifacthub
assert.Equal(t, "tektonhub", opacCR.Spec.PACSettings.Settings["hub-catalog-type"])
assert.Equal(t, "https://api.hub.tekton.dev/v1", opacCR.Spec.PACSettings.Settings["hub-url"])
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
"context"
"fmt"
"net/http"
"reflect"

pacSettings "github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings"
Expand Down Expand Up @@ -53,7 +54,7 @@ func (ps *PACSettings) validate(logger *zap.SugaredLogger, path string) *apis.Fi
var errs *apis.FieldError

defaultPacSettings := pacSettings.Settings{}
if err := pacSettings.SyncConfig(logger, &defaultPacSettings, ps.Settings, pacSettings.DefaultValidators()); err != nil {
if err := pacSettings.SyncConfig(logger, &defaultPacSettings, ps.Settings, pacSettings.DefaultValidators(), http.DefaultClient); err != nil {
errs = errs.Also(apis.ErrInvalidValue(err, fmt.Sprintf("%s.settings", path)))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package openshiftpipelinesascode
import (
"context"
"fmt"
"net/http"

mf "github.com/manifestival/manifestival"
pacSettings "github.com/openshift-pipelines/pipelines-as-code/pkg/params/settings"
Expand Down Expand Up @@ -232,7 +233,7 @@ func updateAdditionControllerConfigMap(config v1alpha1.AdditionalPACControllerCo
}

defaultPacSettings := pacSettings.Settings{}
err := pacSettings.SyncConfig(zap.NewNop().Sugar(), &defaultPacSettings, config.Settings, pacSettings.DefaultValidators())
err := pacSettings.SyncConfig(zap.NewNop().Sugar(), &defaultPacSettings, config.Settings, pacSettings.DefaultValidators(), http.DefaultClient)
if err != nil {
return err
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading