Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to k8s 1.12.6 and pkg @ HEAD #662

Merged
merged 1 commit into from
Mar 25, 2019
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
205 changes: 169 additions & 36 deletions Gopkg.lock

Large diffs are not rendered by default.

32 changes: 19 additions & 13 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ required = [
name = "gopkg.in/yaml.v2"
version = "v2.2.1"

[[constraint]]
[[override]]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to bump go-containerregistry to 1.12.6 for moving those back to constraint

name = "k8s.io/api"
version = "kubernetes-1.11.3"
version = "kubernetes-1.12.6"

[[constraint]]
[[override]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.3"
version = "kubernetes-1.12.6"

[[constraint]]
[[override]]
name = "k8s.io/code-generator"
version = "kubernetes-1.11.3"
version = "kubernetes-1.12.6"

[[constraint]]
[[override]]
name = "k8s.io/client-go"
version = "kubernetes-1.11.3"
version = "kubernetes-1.12.6"

[[override]]
name = "golang.org/x/sys"
Expand All @@ -43,27 +43,33 @@ required = [
# It seems to be broken at HEAD.
revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682"

[[constraint]]
[[override]]
name = "github.com/google/go-containerregistry"
# HEAD as of 2019-03-20
revision = "8d4083db9aa0d2fae6588c1acdbe6a1f5db461e3"

[[override]]
name = "github.com/golang/protobuf"
revision = "c823c79ea1570fb5ff454033735a8e68575d1d0f"
# Lock the version of protobuf to keep things building.
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"

[[constraint]]
name = "github.com/knative/caching"
# HEAD as of 2019-03-21
revision = "3fc06fd3c9880a9ebb5c401f4b20cf6666cc7bc0"

[[override]]
name = "github.com/knative/pkg"
# HEAD as of 2019-02-14 💖
revision = "0183bf9cdc7349e3c76c26e51f84689b411fccea"
# HEAD as of 2019-03-21 💖
revision = "60fdcbcabd2faeb34328d8b2725dc76c59189453"

[[override]]
name = "go.uber.org/zap"
revision = "67bc79d13d155c02fd008f721863ff8cc5f30659"

[[constraint]]
name = "github.com/knative/build"
revision = "v0.3.0"
revision = "dd3ceb3323922b899a0a913f885fcf59943e7b59"

[prune]
go-tests = true
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/pipeline/v1alpha1/cluster_task_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package v1alpha1

import (
"context"

"github.com/knative/pkg/apis"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -33,8 +35,8 @@ func (t *ClusterTask) Copy() TaskInterface {
return t.DeepCopy()
}

func (t *ClusterTask) SetDefaults() {
t.Spec.SetDefaults()
func (t *ClusterTask) SetDefaults(ctx context.Context) {
t.Spec.SetDefaults(ctx)
}

// Check that Task may be validated and defaulted.
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/pipeline/v1alpha1/cluster_task_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ limitations under the License.
package v1alpha1

import (
"context"

"github.com/knative/pkg/apis"
)

func (t *ClusterTask) Validate() *apis.FieldError {
func (t *ClusterTask) Validate(ctx context.Context) *apis.FieldError {
if err := validateObjectMetadata(t.GetObjectMeta()); err != nil {
return err.ViaField("metadata")
}
return t.Spec.Validate()
return t.Spec.Validate(ctx)
}
8 changes: 5 additions & 3 deletions pkg/apis/pipeline/v1alpha1/pipeline_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ limitations under the License.

package v1alpha1

func (p *Pipeline) SetDefaults() {
p.Spec.SetDefaults()
import "context"

func (p *Pipeline) SetDefaults(ctx context.Context) {
p.Spec.SetDefaults(ctx)
}

func (ps *PipelineSpec) SetDefaults() {
func (ps *PipelineSpec) SetDefaults(ctx context.Context) {
for _, pt := range ps.Tasks {
if pt.TaskRef.Kind == "" {
pt.TaskRef.Kind = NamespacedTaskKind
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/pipeline/v1alpha1/pipeline_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"fmt"

"github.com/knative/pkg/apis"
Expand All @@ -27,7 +28,7 @@ import (

// Validate checks that the Pipeline structure is valid but does not validate
// that any references resources exist, that is done at run time.
func (p *Pipeline) Validate() *apis.FieldError {
func (p *Pipeline) Validate(ctx context.Context) *apis.FieldError {
if err := validateObjectMetadata(p.GetObjectMeta()); err != nil {
return err.ViaField("metadata")
}
Expand Down Expand Up @@ -111,7 +112,7 @@ func validateGraph(tasks []PipelineTask) error {

// Validate checks that taskNames in the Pipeline are valid and that the graph
// of Tasks expressed in the Pipeline makes sense.
func (ps *PipelineSpec) Validate() *apis.FieldError {
func (ps *PipelineSpec) Validate(ctx context.Context) *apis.FieldError {
if equality.Semantic.DeepEqual(ps, &PipelineSpec{}) {
return apis.ErrMissingField(apis.CurrentField)
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1_test

import (
"context"
"testing"

"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
Expand Down Expand Up @@ -113,7 +114,7 @@ func TestPipelineSpec_Validate_Error(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := tt.p.Spec.Validate(); err == nil {
if err := tt.p.Spec.Validate(context.Background()); err == nil {
t.Error("PipelineSpec.Validate() did not return error, wanted error")
}
})
Expand Down Expand Up @@ -174,7 +175,7 @@ func TestPipelineSpec_Validate_Valid(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := tt.p.Spec.Validate(); err != nil {
if err := tt.p.Spec.Validate(context.Background()); err != nil {
t.Errorf("PipelineSpec.Validate() returned error: %v", err)
}
})
Expand Down
7 changes: 4 additions & 3 deletions pkg/apis/pipeline/v1alpha1/pipelineresource_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ limitations under the License.
package v1alpha1

import (
"context"
"strings"

"github.com/knative/pkg/apis"
"k8s.io/apimachinery/pkg/api/equality"
)

func (r *PipelineResource) Validate() *apis.FieldError {
func (r *PipelineResource) Validate(ctx context.Context) *apis.FieldError {
if err := validateObjectMetadata(r.GetObjectMeta()); err != nil {
return err.ViaField("metadata")
}

return r.Spec.Validate()
return r.Spec.Validate(ctx)
}

func (rs *PipelineResourceSpec) Validate() *apis.FieldError {
func (rs *PipelineResourceSpec) Validate(ctx context.Context) *apis.FieldError {
if equality.Semantic.DeepEqual(rs, &PipelineResourceSpec{}) {
return apis.ErrMissingField(apis.CurrentField)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"testing"

"github.com/google/go-cmp/cmp"
Expand Down Expand Up @@ -215,7 +216,7 @@ func TestResourceValidation_Invalid(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := tt.res.Validate()
err := tt.res.Validate(context.Background())
if d := cmp.Diff(err.Error(), tt.want.Error()); d != "" {
t.Errorf("PipleineResource.Validate/%s (-want, +got) = %v", tt.name, d)
}
Expand Down Expand Up @@ -250,7 +251,7 @@ func TestClusterResourceValidation_Valid(t *testing.T) {
},
},
}
if err := res.Validate(); err != nil {
if err := res.Validate(context.Background()); err != nil {
t.Errorf("Unexpected PipelineRun.Validate() error = %v", err)
}
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/apis/pipeline/v1alpha1/pipelinerun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"fmt"
"time"

Expand Down Expand Up @@ -206,7 +207,7 @@ func (pr *PipelineRun) GetTaskRunRef() corev1.ObjectReference {
}

// SetDefaults for pipelinerun
func (pr *PipelineRun) SetDefaults() {}
func (pr *PipelineRun) SetDefaults(ctx context.Context) {}

// GetOwnerReference gets the pipeline run as owner reference for any related objects
func (pr *PipelineRun) GetOwnerReference() []metav1.OwnerReference {
Expand Down
9 changes: 5 additions & 4 deletions pkg/apis/pipeline/v1alpha1/pipelinerun_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ limitations under the License.
package v1alpha1

import (
"context"
"fmt"

"github.com/knative/pkg/apis"
"k8s.io/apimachinery/pkg/api/equality"
)

// Validate pipelinerun
func (pr *PipelineRun) Validate() *apis.FieldError {
func (pr *PipelineRun) Validate(ctx context.Context) *apis.FieldError {
if err := validateObjectMetadata(pr.GetObjectMeta()).ViaField("metadata"); err != nil {
return err
}
return pr.Spec.Validate()
return pr.Spec.Validate(ctx)
}

// Validate pipelinerun spec
func (ps *PipelineRunSpec) Validate() *apis.FieldError {
func (ps *PipelineRunSpec) Validate(ctx context.Context) *apis.FieldError {
if equality.Semantic.DeepEqual(ps, &PipelineRunSpec{}) {
return apis.ErrMissingField("spec")
}
Expand All @@ -45,7 +46,7 @@ func (ps *PipelineRunSpec) Validate() *apis.FieldError {
}
// check for results
if ps.Results != nil {
if err := ps.Results.Validate("spec.results"); err != nil {
if err := ps.Results.Validate(ctx, "spec.results"); err != nil {
return err
}
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/pipeline/v1alpha1/pipelinerun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"testing"
"time"

Expand Down Expand Up @@ -101,7 +102,7 @@ func TestPipelineRun_Invalidate(t *testing.T) {

for _, ts := range tests {
t.Run(ts.name, func(t *testing.T) {
err := ts.pr.Validate()
err := ts.pr.Validate(context.Background())
if d := cmp.Diff(err.Error(), ts.want.Error()); d != "" {
t.Errorf("PipelineRun.Validate/%s (-want, +got) = %v", ts.name, d)
}
Expand All @@ -127,7 +128,7 @@ func TestPipelineRun_Validate(t *testing.T) {
},
},
}
if err := tr.Validate(); err != nil {
if err := tr.Validate(context.Background()); err != nil {
t.Errorf("Unexpected PipelineRun.Validate() error = %v", err)
}
}
8 changes: 5 additions & 3 deletions pkg/apis/pipeline/v1alpha1/resource_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ limitations under the License.

package v1alpha1

func (t *PipelineResource) SetDefaults() {
t.Spec.SetDefaults()
import "context"

func (t *PipelineResource) SetDefaults(ctx context.Context) {
t.Spec.SetDefaults(ctx)
}

func (ts *PipelineResourceSpec) SetDefaults() {
func (ts *PipelineResourceSpec) SetDefaults(ctx context.Context) {
return
}
3 changes: 2 additions & 1 deletion pkg/apis/pipeline/v1alpha1/result_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"fmt"
"net/url"

Expand Down Expand Up @@ -45,7 +46,7 @@ type Results struct {
// Validate will validate the result configuration. The path is the path at which
// we found this instance of `Results` (since it is probably a member of another
// structure) and will be used to report any errors.
func (r *Results) Validate(path string) *apis.FieldError {
func (r *Results) Validate(ctx context.Context, path string) *apis.FieldError {
if r.Type != ResultTargetTypeGCS {
return apis.ErrInvalidValue(string(r.Type), fmt.Sprintf("%s.Type", path))
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/pipeline/v1alpha1/result_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -28,7 +29,7 @@ func TestValidate(t *testing.T) {
URL: "http://google.com",
Type: "gcs",
}
err := results.Validate("somepath")
err := results.Validate(context.Background(), "somepath")
if err != nil {
t.Fatalf("Did not expect error when validating valid Results but got %s", err)
}
Expand Down Expand Up @@ -76,7 +77,7 @@ func TestValidate_Invalid(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
path := "spec.results"
err := tc.results.Validate(path)
err := tc.results.Validate(context.Background(), path)
if d := cmp.Diff(err.Error(), tc.want.Error()); d != "" {
t.Errorf("Results.Validate/%s (-want, +got) = %v", tc.name, d)
}
Expand Down
8 changes: 5 additions & 3 deletions pkg/apis/pipeline/v1alpha1/task_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ limitations under the License.

package v1alpha1

func (t *Task) SetDefaults() {
t.Spec.SetDefaults()
import "context"

func (t *Task) SetDefaults(ctx context.Context) {
t.Spec.SetDefaults(ctx)
}

func (ts *TaskSpec) SetDefaults() {
func (ts *TaskSpec) SetDefaults(ctx context.Context) {
return
}
Loading