Skip to content

Commit

Permalink
bump pipelines to 0.47 and update changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jeeva Kandasamy <jkandasa@redhat.com>
  • Loading branch information
jkandasa committed May 9, 2023
1 parent 14ce616 commit 829722b
Show file tree
Hide file tree
Showing 155 changed files with 6,337 additions and 3,519 deletions.
2 changes: 2 additions & 0 deletions docs/TektonConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The TektonConfig CR provides the following features
metrics.taskrun.level: taskrun
require-git-ssh-secret-known-hosts: false
running-in-environment-with-injected-sidecars: true
trusted-resources-verification-no-match-policy: ignore
performance:
disable-ha: false
buckets: 1
Expand Down Expand Up @@ -142,6 +143,7 @@ pipeline:
metrics.taskrun.level: taskrun
require-git-ssh-secret-known-hosts: false
running-in-environment-with-injected-sidecars: true
trusted-resources-verification-no-match-policy: ignore
performance:
disable-ha: false
buckets: 1
Expand Down
5 changes: 5 additions & 0 deletions docs/TektonPipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ spec:
require-git-ssh-secret-known-hosts: false
running-in-environment-with-injected-sidecars: true
scope-when-expressions-to-task: false
trusted-resources-verification-no-match-policy: ignore
performance:
disable-ha: false
buckets: 1
Expand Down Expand Up @@ -100,6 +101,10 @@ and thus should still be considered an alpha feature.

Setting this flag to "true" scopes when expressions to guard a Task only instead of a Task and its dependent Tasks.

- `trusted-resources-verification-no-match-policy` (Default: `ignore`)

Trusted Resources is a feature which can be used to sign Tekton Resources and verify them. Details of design can be found at [TEP–0091](https://github.com/tektoncd/community/blob/main/teps/0091-trusted-resources.md). This feature is under alpha version and support v1beta1 version of Task and Pipeline. To know more about this visit [pipelines documentation](https://tekton.dev/docs/pipelines/trusted-resources/)

### Metrics Properties
These fields have default values so even if user have not passed them in CR, operator will add them and override the values
configure in pipelines.
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/sigstore/cosign/v2 v2.0.2
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/tektoncd/pipeline v0.45.0
github.com/tektoncd/pipeline v0.47.0
github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7
github.com/tektoncd/triggers v0.23.1
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399
Expand All @@ -36,7 +36,7 @@ require (
gotest.tools/v3 v3.4.0
k8s.io/api v0.26.1
k8s.io/apiextensions-apiserver v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/apimachinery v0.26.4
k8s.io/client-go v0.26.1
k8s.io/code-generator v0.26.1
knative.dev/pkg v0.0.0-20230224205330-75da922ef055
Expand Down Expand Up @@ -255,7 +255,7 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/automaxprocs v1.5.2 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874 // indirect
golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
Expand All @@ -271,9 +271,9 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect
k8s.io/klog/v2 v2.90.0 // indirect
k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a // indirect
k8s.io/utils v0.0.0-20230115233650-391b47cb4029 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/release-utils v0.7.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
22 changes: 11 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJ
github.com/clbanning/mxj/v2 v2.5.6 h1:Jm4VaCI/+Ug5Q57IzEoZbwx4iQFA6wkXv72juUSeK+g=
github.com/clbanning/mxj/v2 v2.5.6/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudevents/sdk-go/v2 v2.13.0 h1:2zxDS8RyY1/wVPULGGbdgniGXSzLaRJVl136fLXGsYw=
github.com/cloudevents/sdk-go/v2 v2.14.0 h1:Nrob4FwVgi5L4tV9lhjzZcjYqFVyJzsA56CwPaPfv6s=
github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY=
github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
Expand Down Expand Up @@ -1327,8 +1327,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJ
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes=
github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k=
github.com/tektoncd/pipeline v0.45.0 h1:Hv9kyutu5GWGXKtcMrM7PXdAULgeQc0F2HWDNg+jo5c=
github.com/tektoncd/pipeline v0.45.0/go.mod h1:20Xs6qk3BTpsLHYWEtLNPM44XKqNH5jYwoomXHOGNs8=
github.com/tektoncd/pipeline v0.47.0 h1:zZxmp6im8/p9RaH32LgeCP6dwH/4hcsfvEQUrwGsUPA=
github.com/tektoncd/pipeline v0.47.0/go.mod h1:7H1DeNuEJFGoExGwQTlRul2IziCPxkjXRdDdirWmoQs=
github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7 h1:YsjQ83UBIIq4k/s2PzQ6pqe4tpPtm1hia3oyNBDDrDU=
github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7/go.mod h1:uJBaI0AL/kjPThiMYZcWRujEz7D401v643d6s/21GAg=
github.com/tektoncd/triggers v0.23.1 h1:hdfjr5R+gC1RnHSrxanEbQGXXmKJ9QtTeV+uy4D+S8s=
Expand Down Expand Up @@ -1521,8 +1521,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874 h1:kWC3b7j6Fu09SnEBr7P4PuQyM0R6sqyH9R+EjIvT1nQ=
golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230307190834-24139beb5833 h1:SChBja7BCQewoTAU7IgvucQKMIXrEpFxNMs0spT3/5s=
golang.org/x/exp v0.0.0-20230307190834-24139beb5833/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down Expand Up @@ -2152,21 +2152,21 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.90.0 h1:VkTxIV/FjRXn1fgNNcKGM8cfmL1Z33ZjXRTVxKCoF5M=
k8s.io/klog/v2 v2.90.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20200204173128-addea2498afe/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM=
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a h1:s6zvHjyDQX1NtVT88pvw2tddqhqY0Bz0Gbnn+yctsFU=
k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0=
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a h1:gmovKNur38vgoWfGtP5QOGNOA7ki4n6qNYoFAgMlNvg=
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20230115233650-391b47cb4029 h1:L8zDtT4jrxj+TaQYD0k8KNlr556WaVQylDXswKmX+dE=
k8s.io/utils v0.0.0-20230115233650-391b47cb4029/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.35.5 h1:G9gthy4CpBUWH/NvTX3SvKHGGqHMPOlWY++JiV+oybg=
knative.dev/networking v0.0.0-20220404212543-dde40b019aff h1:pqzWi29qb44TY+5xtc9vty4mSyUYvojXZGCp0y/91eo=
knative.dev/pkg v0.0.0-20230125083639-408ad0773f47 h1:zlRO7wXOHVYgKvsC3nIaYGqeQGlLJL8EIUY30Rh37Is=
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/operator/v1alpha1/tektonpipeline_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ func (p *Pipeline) setDefaults() {
if p.EnableApiFields == "" {
p.EnableApiFields = config.DefaultEnableAPIFields
}
if p.VerificationMode == "" {
p.VerificationMode = config.DefaultResourceVerificationMode

if p.VerificationNoMatchPolicy == "" {
p.VerificationNoMatchPolicy = config.DefaultNoMatchPolicyConfig
}

if p.EnableProvenanceInStatus == nil {
p.EnableProvenanceInStatus = ptr.Bool(config.DefaultEnableProvenanceInStatus)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/operator/v1alpha1/tektonpipeline_defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/tektoncd/pipeline/pkg/apis/config"
"github.com/tektoncd/pipeline/test/diff"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/ptr"
Expand Down Expand Up @@ -51,7 +52,7 @@ func Test_SetDefaults_PipelineProperties(t *testing.T) {
EmbeddedStatus: "",
ScopeWhenExpressionsToTask: nil,
SendCloudEventsForRuns: ptr.Bool(false),
VerificationMode: "skip",
VerificationNoMatchPolicy: config.DefaultNoMatchPolicyConfig,
EnableProvenanceInStatus: ptr.Bool(false),
PipelineMetricsProperties: PipelineMetricsProperties{
MetricsPipelinerunDurationType: "histogram",
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/operator/v1alpha1/tektonpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type PipelineProperties struct {
EnableApiFields string `json:"enable-api-fields,omitempty"`
EmbeddedStatus string `json:"embedded-status,omitempty"`
SendCloudEventsForRuns *bool `json:"send-cloudevents-for-runs,omitempty"`
VerificationMode string `json:"verification-mode,omitempty"`
VerificationNoMatchPolicy string `json:"trusted-resources-verification-no-match-policy,omitempty"`
EnableProvenanceInStatus *bool `json:"enable-provenance-in-status,omitempty"`

// ScopeWhenExpressionsToTask Deprecated: remove in next release
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/operator/v1alpha1/tektonpipeline_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import (
)

var (
validatePipelineAllowedApiFields = sets.NewString("", config.AlphaAPIFields, config.BetaAPIFields, config.StableAPIFields)
validatePipelineAllowedApiFields = sets.NewString("", config.AlphaAPIFields, config.BetaAPIFields, config.StableAPIFields)
validatePipelineVerificationNoMatchPolicy = sets.NewString("", config.FailNoMatchPolicy, config.WarnNoMatchPolicy, config.IgnoreNoMatchPolicy)
)

func (tp *TektonPipeline) Validate(ctx context.Context) (errs *apis.FieldError) {
Expand Down Expand Up @@ -59,10 +60,9 @@ func (p *PipelineProperties) validate(path string) (errs *apis.FieldError) {
}
}

if p.VerificationMode != "" {
if p.VerificationMode != config.SkipResourceVerificationMode && p.VerificationMode != config.WarnResourceVerificationMode && p.VerificationMode != config.EnforceResourceVerificationMode {
errs = errs.Also(apis.ErrInvalidValue(p.VerificationMode, path+".verification-mode"))
}
// validate trusted-resources-verification-no-match-policy
if !validatePipelineVerificationNoMatchPolicy.Has(p.VerificationNoMatchPolicy) {
errs = errs.Also(apis.ErrInvalidValue(p.VerificationNoMatchPolicy, fmt.Sprintf("%s.trusted-resources-verification-no-match-policy", path)))
}

// validate performance properties
Expand Down
38 changes: 36 additions & 2 deletions pkg/apis/operator/v1alpha1/tektonpipeline_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ func Test_ValidateTektonPipeline_APIField(t *testing.T) {
apiField string
err string
}{
{name: "api-empty-value", apiField: "", err: ""},
{name: "api-alpha", apiField: config.AlphaAPIFields, err: ""},
{name: "api-beta", apiField: config.AlphaAPIFields, err: ""},
{name: "api-stable", apiField: config.AlphaAPIFields, err: ""},
{name: "api-beta", apiField: config.BetaAPIFields, err: ""},
{name: "api-stable", apiField: config.StableAPIFields, err: ""},
{name: "api-invalid", apiField: "prod", err: "invalid value: prod: spec.enable-api-fields"},
}

Expand All @@ -72,7 +73,40 @@ func Test_ValidateTektonPipeline_APIField(t *testing.T) {
assert.Equal(t, test.err, errs.Error())
})
}
}

func TestValidateTektonPipelineVerificationNoMatchPolicy(t *testing.T) {
tp := &TektonPipeline{
ObjectMeta: metav1.ObjectMeta{
Name: "pipeline",
Namespace: "tekton-pipelines-ns",
},
Spec: TektonPipelineSpec{
CommonSpec: CommonSpec{
TargetNamespace: "tekton-pipelines-ns",
},
},
}

tests := []struct {
name string
policy string
err string
}{
{name: "policy-empty-value", policy: "", err: ""},
{name: "policy-fail", policy: config.FailNoMatchPolicy, err: ""},
{name: "policy-warn", policy: config.WarnNoMatchPolicy, err: ""},
{name: "policy-ignore", policy: config.IgnoreNoMatchPolicy, err: ""},
{name: "policy-invalid", policy: "hello", err: "invalid value: hello: spec.trusted-resources-verification-no-match-policy"},
}

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
tp.Spec.Pipeline.VerificationNoMatchPolicy = test.policy
errs := tp.Validate(context.TODO())
assert.Equal(t, test.err, errs.Error())
})
}
}

func Test_ValidateTektonPipeline_OnDelete(t *testing.T) {
Expand Down
112 changes: 0 additions & 112 deletions vendor/github.com/tektoncd/pipeline/pkg/apis/config/artifact_bucket.go

This file was deleted.

Loading

0 comments on commit 829722b

Please sign in to comment.