diff --git a/go.mod b/go.mod index 2366dd21574..38db13994db 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( cloud.google.com/go/compute v1.5.0 // indirect contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect - github.com/Azure/azure-sdk-for-go v62.0.0+incompatible // indirect + github.com/Azure/azure-sdk-for-go v63.3.0+incompatible // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest v0.11.24 // indirect github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect diff --git a/go.sum b/go.sum index 6ea0c928c87..c0f71eb5638 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,9 @@ github.com/Antonboom/errname v0.1.5/go.mod h1:DugbBstvPFQbv/5uLcRRzfrNqKE9tVdVCq github.com/Antonboom/nilnil v0.1.0/go.mod h1:PhHLvRPSghY5Y7mX4TW+BHZQYo1A8flE5H20D3IPZBo= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v46.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v62.0.0+incompatible h1:8N2k27SYtc12qj5nTsuFMFJPZn5CGmgMWqTy4y9I7Jw= github.com/Azure/azure-sdk-for-go v62.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v63.3.0+incompatible h1:INepVujzUrmArRZjDLHbtER+FkvCoEwyRCXGqOlmDII= +github.com/Azure/azure-sdk-for-go v63.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= diff --git a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go index 0708802e6fe..f069738ff16 100644 --- a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion_test.go @@ -58,7 +58,7 @@ func TestClusterTaskConversion(t *testing.T) { }, Spec: TaskSpec{ TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, Volumes: []corev1.Volume{{}}, diff --git a/pkg/apis/pipeline/v1alpha1/condition_validation_test.go b/pkg/apis/pipeline/v1alpha1/condition_validation_test.go index 2a1a0e80830..96ae111c874 100644 --- a/pkg/apis/pipeline/v1alpha1/condition_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/condition_validation_test.go @@ -24,7 +24,6 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" ) @@ -33,7 +32,7 @@ func TestCondition_Validate(t *testing.T) { c := v1alpha1.Condition{ ObjectMeta: metav1.ObjectMeta{Name: "condname"}, Spec: v1alpha1.ConditionSpec{ - Check: v1alpha1.Step{Container: corev1.Container{ + Check: v1alpha1.Step{Container: v1alpha1.Container{ Name: "cname", Image: "ubuntu", }}, @@ -67,7 +66,7 @@ func TestCondition_Invalid(t *testing.T) { cond: &v1alpha1.Condition{ ObjectMeta: metav1.ObjectMeta{Name: "condname"}, Spec: v1alpha1.ConditionSpec{ - Check: v1alpha1.Step{Container: corev1.Container{ + Check: v1alpha1.Step{Container: v1alpha1.Container{ Image: "", }}, }, @@ -82,7 +81,7 @@ func TestCondition_Invalid(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "condname"}, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "image", Command: []string{"exit", "0"}, }, @@ -100,7 +99,7 @@ func TestCondition_Invalid(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "condname"}, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Name: "Cname", Image: "image", }, diff --git a/pkg/apis/pipeline/v1alpha1/container_replacements.go b/pkg/apis/pipeline/v1alpha1/container_replacements.go index 63606afc6ac..a61202169de 100644 --- a/pkg/apis/pipeline/v1alpha1/container_replacements.go +++ b/pkg/apis/pipeline/v1alpha1/container_replacements.go @@ -18,12 +18,11 @@ package v1alpha1 import ( "github.com/tektoncd/pipeline/pkg/substitution" - corev1 "k8s.io/api/core/v1" ) // ApplyContainerReplacements replaces ${...} expressions in the container's name, image, args, env, command, workingDir, // and volumes. -func ApplyContainerReplacements(step *corev1.Container, stringReplacements map[string]string, arrayReplacements map[string][]string) { +func ApplyContainerReplacements(step *Container, stringReplacements map[string]string, arrayReplacements map[string][]string) { step.Name = substitution.ApplyReplacements(step.Name, stringReplacements) step.Image = substitution.ApplyReplacements(step.Image, stringReplacements) diff --git a/pkg/apis/pipeline/v1alpha1/container_replacements_test.go b/pkg/apis/pipeline/v1alpha1/container_replacements_test.go index ce84bf3a738..263089c1472 100644 --- a/pkg/apis/pipeline/v1alpha1/container_replacements_test.go +++ b/pkg/apis/pipeline/v1alpha1/container_replacements_test.go @@ -34,7 +34,7 @@ func TestApplyContainerReplacements(t *testing.T) { "array.replace.me": {"val1", "val2"}, } - s := corev1.Container{ + s := v1alpha1.Container{ Name: "$(replace.me)", Image: "$(replace.me)", Command: []string{"$(array.replace.me)"}, @@ -77,7 +77,7 @@ func TestApplyContainerReplacements(t *testing.T) { }}, } - expected := corev1.Container{ + expected := v1alpha1.Container{ Name: "replaced!", Image: "replaced!", Command: []string{"val1", "val2"}, @@ -127,7 +127,7 @@ func TestApplyContainerReplacements(t *testing.T) { } func TestApplyContainerReplacements_NotDefined(t *testing.T) { - s := corev1.Container{ + s := v1alpha1.Container{ Name: "$(params.not.defined)", } replacements := map[string]string{ @@ -138,7 +138,7 @@ func TestApplyContainerReplacements_NotDefined(t *testing.T) { "array.replace.me": {"val1", "val2"}, } - expected := corev1.Container{ + expected := v1alpha1.Container{ Name: "$(params.not.defined)", } v1alpha1.ApplyContainerReplacements(&s, replacements, arrayReplacements) diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go b/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go index 2789f5b6e31..86dab625262 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go @@ -25,7 +25,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resource "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" "github.com/tektoncd/pipeline/test/diff" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" ) @@ -105,7 +104,7 @@ func TestPipelineConversion_Success(t *testing.T) { }, { Name: "task2", TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, }}, @@ -162,7 +161,7 @@ func TestPipelineConversion_Failure(t *testing.T) { Name: "task2", TaskSpec: &TaskSpec{ TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, Resources: &v1beta1.TaskResources{ diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go b/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go index eb21c86cc23..8f53b7adcf0 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_validation_test.go @@ -23,7 +23,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -157,7 +156,7 @@ func TestPipeline_Validate(t *testing.T) { Name: "foo", TaskRef: &v1alpha1.TaskRef{Name: "foo-task"}, TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "foo", Image: "bar", }}}, @@ -186,7 +185,7 @@ func TestPipeline_Validate(t *testing.T) { Tasks: []v1alpha1.PipelineTask{{ Name: "foo", TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "foo", Image: "bar", }}}, diff --git a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go index 67c083bfe16..03a6726570c 100644 --- a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion_test.go @@ -113,7 +113,7 @@ func TestPipelineRunConversion(t *testing.T) { }, { Name: "task2", TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, }}, diff --git a/pkg/apis/pipeline/v1alpha1/resource_types_test.go b/pkg/apis/pipeline/v1alpha1/resource_types_test.go index 52a55c2ee18..ba30f3e3aa3 100644 --- a/pkg/apis/pipeline/v1alpha1/resource_types_test.go +++ b/pkg/apis/pipeline/v1alpha1/resource_types_test.go @@ -24,13 +24,13 @@ import ( ) var ( - prependStep = corev1.Container{ + prependStep = v1alpha1.Container{ Name: "prepend-step", Image: "dummy", Command: []string{"doit"}, Args: []string{"stuff", "things"}, } - appendStep = corev1.Container{ + appendStep = v1alpha1.Container{ Name: "append-step", Image: "dummy", Command: []string{"doit"}, diff --git a/pkg/apis/pipeline/v1alpha1/step_replacements_test.go b/pkg/apis/pipeline/v1alpha1/step_replacements_test.go index 70618685b50..fb9e09aba96 100644 --- a/pkg/apis/pipeline/v1alpha1/step_replacements_test.go +++ b/pkg/apis/pipeline/v1alpha1/step_replacements_test.go @@ -36,7 +36,7 @@ func TestApplyStepReplacements(t *testing.T) { s := v1alpha1.Step{ Script: "$(replace.me)", - Container: corev1.Container{ + Container: v1alpha1.Container{ Name: "$(replace.me)", Image: "$(replace.me)", Command: []string{"$(array.replace.me)"}, @@ -82,7 +82,7 @@ func TestApplyStepReplacements(t *testing.T) { expected := v1alpha1.Step{ Script: "replaced!", - Container: corev1.Container{ + Container: v1alpha1.Container{ Name: "replaced!", Image: "replaced!", Command: []string{"val1", "val2"}, diff --git a/pkg/apis/pipeline/v1alpha1/task_conversion_test.go b/pkg/apis/pipeline/v1alpha1/task_conversion_test.go index a9b13685828..fe39f2f6380 100644 --- a/pkg/apis/pipeline/v1alpha1/task_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/task_conversion_test.go @@ -59,7 +59,7 @@ func TestTaskConversion(t *testing.T) { Spec: TaskSpec{ TaskSpec: v1beta1.TaskSpec{ Description: "test", - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, Volumes: []corev1.Volume{{}}, diff --git a/pkg/apis/pipeline/v1alpha1/task_types.go b/pkg/apis/pipeline/v1alpha1/task_types.go index 1121e93c787..0ce83dd232b 100644 --- a/pkg/apis/pipeline/v1alpha1/task_types.go +++ b/pkg/apis/pipeline/v1alpha1/task_types.go @@ -70,6 +70,9 @@ type Step = v1beta1.Step // Sidecar has nearly the same data structure as Step, consisting of a Container and an optional Script, but does not have the ability to timeout. type Sidecar = v1beta1.Sidecar +// Container describes a container which runs a Step or Sidecar +type Container = v1beta1.Container + // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/pipeline/v1alpha1/task_validation.go b/pkg/apis/pipeline/v1alpha1/task_validation.go index 94a13a69185..e7d915212d8 100644 --- a/pkg/apis/pipeline/v1alpha1/task_validation.go +++ b/pkg/apis/pipeline/v1alpha1/task_validation.go @@ -148,7 +148,7 @@ func (ts *TaskSpec) Validate(ctx context.Context) *apis.FieldError { // validateDeclaredWorkspaces will make sure that the declared workspaces do not try to use // a mount path which conflicts with any other declared workspaces, with the explicitly // declared volume mounts, or with the stepTemplate. The names must also be unique. -func validateDeclaredWorkspaces(workspaces []WorkspaceDeclaration, steps []Step, stepTemplate *corev1.Container) *apis.FieldError { +func validateDeclaredWorkspaces(workspaces []WorkspaceDeclaration, steps []Step, stepTemplate *Container) *apis.FieldError { mountPaths := sets.NewString() for _, step := range steps { for _, vm := range step.VolumeMounts { diff --git a/pkg/apis/pipeline/v1alpha1/task_validation_test.go b/pkg/apis/pipeline/v1alpha1/task_validation_test.go index b7459b85d8b..18a7c22579e 100644 --- a/pkg/apis/pipeline/v1alpha1/task_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/task_validation_test.go @@ -67,12 +67,12 @@ var requiredResource = v1alpha1.TaskResource{ }, } -var validSteps = []v1alpha1.Step{{Container: corev1.Container{ +var validSteps = []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", }}} -var invalidSteps = []v1alpha1.Step{{Container: corev1.Container{ +var invalidSteps = []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "replaceImage", Image: "myimage", }}} @@ -82,7 +82,7 @@ func TestTaskSpecValidate(t *testing.T) { Inputs *v1alpha1.Inputs Outputs *v1alpha1.Outputs Steps []v1alpha1.Step - StepTemplate *corev1.Container + StepTemplate *v1alpha1.Container Workspaces []v1alpha1.WorkspaceDeclaration } tests := []struct { @@ -91,9 +91,9 @@ func TestTaskSpecValidate(t *testing.T) { }{{ name: "unnamed steps", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Image: "myimage", - }}, {Container: corev1.Container{ + }}, {Container: v1alpha1.Container{ Image: "myotherimage", }}}, }, @@ -206,7 +206,7 @@ func TestTaskSpecValidate(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "$(inputs.resources.source.url)", Args: []string{"--flag=$(inputs.params.baz) && $(input.params.foo-is-baz)"}, @@ -229,7 +229,7 @@ func TestTaskSpecValidate(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "$(inputs.resources.source.url)", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -253,7 +253,7 @@ func TestTaskSpecValidate(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "$(inputs.resources.source.url)", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -264,7 +264,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid legacy credential helper (creds-init) path variable", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "echo", Args: []string{"$(credentials.path)"}, @@ -273,12 +273,12 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "step template included in validation", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "astep", Command: []string{"echo"}, Args: []string{"hello"}, }}}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1alpha1.Container{ Image: "some-image", }, }, @@ -286,7 +286,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid step with script", fields: fields{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "my-image", }, Script: ` @@ -298,7 +298,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid step with script and args", fields: fields{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -310,7 +310,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid step with volumeMount under /tekton/home", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "foo", @@ -322,7 +322,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid workspace", fields: fields{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -360,7 +360,7 @@ func TestTaskSpecValidateError(t *testing.T) { Outputs *v1alpha1.Outputs Steps []v1alpha1.Step Volumes []corev1.Volume - StepTemplate *corev1.Container + StepTemplate *v1alpha1.Container Workspaces []v1alpha1.WorkspaceDeclaration // v1beta1 Params []v1beta1.ParamSpec @@ -566,7 +566,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inexistent input param variable", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", Args: []string{"--flag=$(inputs.params.inexistent)"}, @@ -592,7 +592,7 @@ func TestTaskSpecValidateError(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "$(inputs.params.baz)", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -620,7 +620,7 @@ func TestTaskSpecValidateError(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "$(inputs.params.baz[*])", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -648,7 +648,7 @@ func TestTaskSpecValidateError(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -676,7 +676,7 @@ func TestTaskSpecValidateError(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -691,7 +691,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inexistent input resource variable", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage:$(inputs.resources.inputs)", }}}, @@ -722,7 +722,7 @@ func TestTaskSpecValidateError(t *testing.T) { Outputs: &v1alpha1.Outputs{ Resources: []v1alpha1.TaskResource{validResource}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(inputs.params.foo-is-baz)"}, @@ -737,7 +737,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inexistent input resource variable", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage:$(inputs.resources.inputs)", }}}, @@ -749,7 +749,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inexistent output param variable", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", WorkingDir: "/foo/bar/$(outputs.resources.inexistent)", @@ -772,7 +772,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, }}, }, - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", Args: []string{"$(inputs.params.foo) && $(inputs.params.inexistent)"}, @@ -800,7 +800,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "step with script and command", fields: fields{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "myimage", Command: []string{"command"}, }, @@ -814,7 +814,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step volume mounts under /tekton/", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "foo", @@ -829,7 +829,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step volume mount name starts with tekton-internal-", fields: fields{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "tekton-internal-foo", @@ -875,7 +875,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "workspace mount path already in volumeMounts", fields: fields{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "myimage", Command: []string{"command"}, VolumeMounts: []corev1.VolumeMount{{ @@ -897,7 +897,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "workspace default mount path already in volumeMounts", fields: fields{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "myimage", Command: []string{"command"}, VolumeMounts: []corev1.VolumeMount{{ @@ -917,7 +917,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "workspace mount path already in stepTemplate", fields: fields{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1alpha1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "my-mount", MountPath: "/foo", @@ -936,7 +936,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "workspace default mount path already in stepTemplate", fields: fields{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1alpha1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "my-mount", MountPath: "/workspace/some-workspace", diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go b/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go index 80741b0cf99..5140618378c 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_conversion_test.go @@ -111,7 +111,7 @@ func TestTaskRunConversion(t *testing.T) { }, Spec: TaskRunSpec{ TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, }}, @@ -156,7 +156,7 @@ func TestTaskRunConversion(t *testing.T) { }, Spec: TaskRunSpec{ TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, }}, @@ -193,7 +193,7 @@ func TestTaskRunConversion(t *testing.T) { }, Spec: TaskRunSpec{ TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, }}, @@ -238,7 +238,7 @@ func TestTaskRunConversion(t *testing.T) { }, Spec: TaskRunSpec{ TaskSpec: &TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: Container{ Image: "foo", }}}, }}, diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go b/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go index b5f20e71c3d..73daa1acac2 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_validation_test.go @@ -164,7 +164,7 @@ func TestTaskRunSpec_Invalid(t *testing.T) { Name: "taskrefname", }, TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -184,7 +184,7 @@ func TestTaskRunSpec_Invalid(t *testing.T) { name: "invalid taskspec", spec: v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "invalid-name-with-$weird-char*/%", Image: "myimage", }}}, @@ -214,7 +214,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { name: "taskspec without a taskRef", spec: v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -225,7 +225,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { spec: v1alpha1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: 0}, TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ - Steps: []v1alpha1.Step{{Container: corev1.Container{ + Steps: []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -236,7 +236,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { spec: v1alpha1.TaskRunSpec{ TaskSpec: &v1alpha1.TaskSpec{TaskSpec: v1beta1.TaskSpec{ Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Name: "mystep", Image: "myimage", }, diff --git a/pkg/apis/pipeline/v1beta1/container_replacements.go b/pkg/apis/pipeline/v1beta1/container_replacements.go index 30af4e11e8c..2e25b0087c7 100644 --- a/pkg/apis/pipeline/v1beta1/container_replacements.go +++ b/pkg/apis/pipeline/v1beta1/container_replacements.go @@ -22,7 +22,7 @@ import ( ) // applyContainerReplacements applies variable interpolation on a Container (subset of a Step). -func applyContainerReplacements(step *corev1.Container, stringReplacements map[string]string, arrayReplacements map[string][]string) { +func applyContainerReplacements(step *Container, stringReplacements map[string]string, arrayReplacements map[string][]string) { step.Name = substitution.ApplyReplacements(step.Name, stringReplacements) step.Image = substitution.ApplyReplacements(step.Image, stringReplacements) step.ImagePullPolicy = corev1.PullPolicy(substitution.ApplyReplacements(string(step.ImagePullPolicy), stringReplacements)) diff --git a/pkg/apis/pipeline/v1beta1/container_types.go b/pkg/apis/pipeline/v1beta1/container_types.go new file mode 100644 index 00000000000..375ff03b500 --- /dev/null +++ b/pkg/apis/pipeline/v1beta1/container_types.go @@ -0,0 +1,200 @@ +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// A single application container that you want to run within a pod. +type Container struct { + // Name of the container specified as a DNS_LABEL. + // Each container in a pod must have a unique name (DNS_LABEL). + // Cannot be updated. + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // Docker image name. + // More info: https://kubernetes.io/docs/concepts/containers/images + // This field is optional to allow higher level config management to default or override + // container images in workload controllers like Deployments and StatefulSets. + // +optional + Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` + // Entrypoint array. Not executed within a shell. + // The docker image's ENTRYPOINT is used if this is not provided. + // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. + // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + // +optional + // +listType=atomic + Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` + // Arguments to the entrypoint. + // The docker image's CMD is used if this is not provided. + // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + // of whether the variable exists or not. Cannot be updated. + // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + // +optional + // +listType=atomic + Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` + // Container's working directory. + // If not specified, the container runtime's default will be used, which + // might be configured in the container image. + // Cannot be updated. + // +optional + WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` + // List of ports to expose from the container. Exposing a port here gives + // the system additional information about the network connections a + // container uses, but is primarily informational. Not specifying a port here + // DOES NOT prevent that port from being exposed. Any port which is + // listening on the default "0.0.0.0" address inside a container will be + // accessible from the network. + // Cannot be updated. + // +optional + // +patchMergeKey=containerPort + // +patchStrategy=merge + // +listType=map + // +listMapKey=containerPort + // +listMapKey=protocol + Ports []corev1.ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"` + // List of sources to populate environment variables in the container. + // The keys defined within a source must be a C_IDENTIFIER. All invalid keys + // will be reported as an event when the container is starting. When a key exists in multiple + // sources, the value associated with the last source will take precedence. + // Values defined by an Env with a duplicate key will take precedence. + // Cannot be updated. + // +optional + // +listType=atomic + EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` + // List of environment variables to set in the container. + // Cannot be updated. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=atomic + Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` + // Compute Resources required by this container. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + // +optional + Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` + // Pod volumes to mount into the container's filesystem. + // Cannot be updated. + // +optional + // +patchMergeKey=mountPath + // +patchStrategy=merge + // +listType=atomic + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` + // volumeDevices is the list of block devices to be used by the container. + // +patchMergeKey=devicePath + // +patchStrategy=merge + // +optional + // +listType=atomic + VolumeDevices []corev1.VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"` + // Periodic probe of container liveness. + // Container will be restarted if the probe fails. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + // +optional + LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"` + // Periodic probe of container service readiness. + // Container will be removed from service endpoints if the probe fails. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + // +optional + ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"` + // StartupProbe indicates that the Pod has successfully initialized. + // If specified, no other probes are executed until this completes successfully. + // If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + // This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + // when it might take a long time to load data or warm a cache, than during steady-state operation. + // This cannot be updated. + // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + // +optional + StartupProbe *corev1.Probe `json:"startupProbe,omitempty" protobuf:"bytes,22,opt,name=startupProbe"` + // Actions that the management system should take in response to container lifecycle events. + // Cannot be updated. + // +optional + Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` + // Optional: Path at which the file to which the container's termination message + // will be written is mounted into the container's filesystem. + // Message written is intended to be brief final status, such as an assertion failure message. + // Will be truncated by the node if greater than 4096 bytes. The total message length across + // all containers will be limited to 12kb. + // Defaults to /dev/termination-log. + // Cannot be updated. + // +optional + TerminationMessagePath string `json:"terminationMessagePath,omitempty" protobuf:"bytes,13,opt,name=terminationMessagePath"` + // Indicate how the termination message should be populated. File will use the contents of + // terminationMessagePath to populate the container status message on both success and failure. + // FallbackToLogsOnError will use the last chunk of container log output if the termination + // message file is empty and the container exited with an error. + // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + // Defaults to File. + // Cannot be updated. + // +optional + TerminationMessagePolicy corev1.TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty" protobuf:"bytes,20,opt,name=terminationMessagePolicy,casttype=TerminationMessagePolicy"` + // Image pull policy. + // One of Always, Never, IfNotPresent. + // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images + // +optional + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` + // SecurityContext defines the security options the container should be run with. + // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + // +optional + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` + + // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) + // and shouldn't be used for general purpose containers. + + // Whether this container should allocate a buffer for stdin in the container runtime. If this + // is not set, reads from stdin in the container will always result in EOF. + // Default is false. + // +optional + Stdin bool `json:"stdin,omitempty" protobuf:"varint,16,opt,name=stdin"` + // Whether the container runtime should close the stdin channel after it has been opened by + // a single attach. When stdin is true the stdin stream will remain open across multiple attach + // sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + // first client attaches to stdin, and then remains open and accepts data until the client disconnects, + // at which time stdin is closed and remains closed until the container is restarted. If this + // flag is false, a container processes that reads from stdin will never receive an EOF. + // Default is false + // +optional + StdinOnce bool `json:"stdinOnce,omitempty" protobuf:"varint,17,opt,name=stdinOnce"` + // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + // Default is false. + // +optional + TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"` +} + +// ToK8sContainer converts the v1beta1 Container struct to a Kubernetes Container struct +func (c *Container) ToK8sContainer() *corev1.Container { + return &corev1.Container{ + Name: c.Name, + Image: c.Image, + Command: c.Command, + Args: c.Args, + WorkingDir: c.WorkingDir, + Ports: c.Ports, + EnvFrom: c.EnvFrom, + Env: c.Env, + Resources: c.Resources, + VolumeMounts: c.VolumeMounts, + VolumeDevices: c.VolumeDevices, + LivenessProbe: c.LivenessProbe, + ReadinessProbe: c.ReadinessProbe, + StartupProbe: c.StartupProbe, + Lifecycle: c.Lifecycle, + TerminationMessagePath: c.TerminationMessagePath, + ImagePullPolicy: c.ImagePullPolicy, + SecurityContext: c.SecurityContext, + Stdin: c.Stdin, + StdinOnce: c.StdinOnce, + TTY: c.TTY, + } + +} diff --git a/pkg/apis/pipeline/v1beta1/merge.go b/pkg/apis/pipeline/v1beta1/merge.go index f200c99e3ea..06bf80fbef0 100644 --- a/pkg/apis/pipeline/v1beta1/merge.go +++ b/pkg/apis/pipeline/v1beta1/merge.go @@ -35,18 +35,18 @@ type mergeData struct { // MergeStepsWithStepTemplate takes a possibly nil container template and a // list of steps, merging each of the steps with the container template, if // it's not nil, and returning the resulting list. -func MergeStepsWithStepTemplate(template *v1.Container, steps []Step) ([]Step, error) { +func MergeStepsWithStepTemplate(template *Container, steps []Step) ([]Step, error) { if template == nil { return steps, nil } - md, err := getMergeData(template, &v1.Container{}) + md, err := getMergeData(template, &Container{}) if err != nil { return nil, err } for i, s := range steps { - merged := v1.Container{} + merged := Container{} err := mergeObjWithTemplateBytes(md, &s.Container, &merged) if err != nil { return nil, err diff --git a/pkg/apis/pipeline/v1beta1/merge_test.go b/pkg/apis/pipeline/v1beta1/merge_test.go index 32814550f8a..2becd9a63a8 100644 --- a/pkg/apis/pipeline/v1beta1/merge_test.go +++ b/pkg/apis/pipeline/v1beta1/merge_test.go @@ -32,49 +32,49 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { for _, tc := range []struct { name string - template *corev1.Container + template *Container steps []Step expected []Step }{{ name: "nil-template", template: nil, steps: []Step{{ - Container: corev1.Container{Image: "some-image"}, + Container: Container{Image: "some-image"}, OnError: "foo", }}, expected: []Step{{ - Container: corev1.Container{Image: "some-image"}, + Container: Container{Image: "some-image"}, OnError: "foo", }}, }, { name: "not-overlapping", - template: &corev1.Container{ + template: &Container{ Command: []string{"/somecmd"}, }, steps: []Step{{ - Container: corev1.Container{Image: "some-image"}, + Container: Container{Image: "some-image"}, OnError: "foo", }}, expected: []Step{{ - Container: corev1.Container{Command: []string{"/somecmd"}, Image: "some-image"}, + Container: Container{Command: []string{"/somecmd"}, Image: "some-image"}, OnError: "foo", }}, }, { name: "overwriting-one-field", - template: &corev1.Container{ + template: &Container{ Image: "some-image", Command: []string{"/somecmd"}, }, - steps: []Step{{Container: corev1.Container{ + steps: []Step{{Container: Container{ Image: "some-other-image", }}}, - expected: []Step{{Container: corev1.Container{ + expected: []Step{{Container: Container{ Command: []string{"/somecmd"}, Image: "some-other-image", }}}, }, { name: "merge-and-overwrite-slice", - template: &corev1.Container{ + template: &Container{ Env: []corev1.EnvVar{{ Name: "KEEP_THIS", Value: "A_VALUE", @@ -83,7 +83,7 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { Value: "ORIGINAL_VALUE", }}, }, - steps: []Step{{Container: corev1.Container{ + steps: []Step{{Container: Container{ Env: []corev1.EnvVar{{ Name: "NEW_KEY", Value: "A_VALUE", @@ -92,7 +92,7 @@ func TestMergeStepsWithStepTemplate(t *testing.T) { Value: "NEW_VALUE", }}, }}}, - expected: []Step{{Container: corev1.Container{ + expected: []Step{{Container: Container{ Env: []corev1.EnvVar{{ Name: "NEW_KEY", Value: "A_VALUE", @@ -127,7 +127,7 @@ func TestMergeStepOverrides(t *testing.T) { }{{ name: "no overrides", steps: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -135,7 +135,7 @@ func TestMergeStepOverrides(t *testing.T) { }, }}, want: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -145,14 +145,14 @@ func TestMergeStepOverrides(t *testing.T) { }, { name: "not all steps overridden", steps: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, }, }, }, { - Container: corev1.Container{ + Container: Container{ Name: "bar", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -166,14 +166,14 @@ func TestMergeStepOverrides(t *testing.T) { }, }}, want: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, }, }, }, { - Container: corev1.Container{ + Container: Container{ Name: "bar", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("2Gi")}, @@ -183,7 +183,7 @@ func TestMergeStepOverrides(t *testing.T) { }, { name: "override memory but not CPU", steps: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ @@ -200,7 +200,7 @@ func TestMergeStepOverrides(t *testing.T) { }, }}, want: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ @@ -213,7 +213,7 @@ func TestMergeStepOverrides(t *testing.T) { }, { name: "override request but not limit", steps: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -228,7 +228,7 @@ func TestMergeStepOverrides(t *testing.T) { }, }}, want: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1.5Gi")}, @@ -239,7 +239,7 @@ func TestMergeStepOverrides(t *testing.T) { }, { name: "override request and limit", steps: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -255,7 +255,7 @@ func TestMergeStepOverrides(t *testing.T) { }, }}, want: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1.5Gi")}, @@ -268,7 +268,7 @@ func TestMergeStepOverrides(t *testing.T) { // instead, we let k8s reject the resulting pod. name: "new request > old limit", steps: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -283,7 +283,7 @@ func TestMergeStepOverrides(t *testing.T) { }, }}, want: []Step{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("3Gi")}, @@ -314,7 +314,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }{{ name: "no overrides", sidecars: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -322,7 +322,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, }}, want: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -332,14 +332,14 @@ func TestMergeSidecarOverrides(t *testing.T) { }, { name: "not all sidecars overridden", sidecars: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, }, }, }, { - Container: corev1.Container{ + Container: Container{ Name: "bar", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -353,14 +353,14 @@ func TestMergeSidecarOverrides(t *testing.T) { }, }}, want: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, }, }, }, { - Container: corev1.Container{ + Container: Container{ Name: "bar", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("2Gi")}, @@ -370,7 +370,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, { name: "override memory but not CPU", sidecars: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ @@ -387,7 +387,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, }}, want: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ @@ -400,7 +400,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, { name: "override request but not limit", sidecars: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -415,7 +415,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, }}, want: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1.5Gi")}, @@ -426,7 +426,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, { name: "override request and limit", sidecars: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -442,7 +442,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, }}, want: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1.5Gi")}, @@ -455,7 +455,7 @@ func TestMergeSidecarOverrides(t *testing.T) { // instead, we let k8s reject the resulting pod. name: "new request > old limit", sidecars: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("1Gi")}, @@ -470,7 +470,7 @@ func TestMergeSidecarOverrides(t *testing.T) { }, }}, want: []Sidecar{{ - Container: corev1.Container{ + Container: Container{ Name: "foo", Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceMemory: resource.MustParse("3Gi")}, diff --git a/pkg/apis/pipeline/v1beta1/openapi_generated.go b/pkg/apis/pipeline/v1beta1/openapi_generated.go index 3f55b20243a..64950c3b4d2 100644 --- a/pkg/apis/pipeline/v1beta1/openapi_generated.go +++ b/pkg/apis/pipeline/v1beta1/openapi_generated.go @@ -41,6 +41,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ConditionCheck": schema_pkg_apis_pipeline_v1beta1_ConditionCheck(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ConditionCheckStatus": schema_pkg_apis_pipeline_v1beta1_ConditionCheckStatus(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ConditionCheckStatusFields": schema_pkg_apis_pipeline_v1beta1_ConditionCheckStatusFields(ref), + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Container": schema_pkg_apis_pipeline_v1beta1_Container(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.EmbeddedTask": schema_pkg_apis_pipeline_v1beta1_EmbeddedTask(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.InternalTaskModifier": schema_pkg_apis_pipeline_v1beta1_InternalTaskModifier(ref), "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Param": schema_pkg_apis_pipeline_v1beta1_Param(ref), @@ -830,6 +831,270 @@ func schema_pkg_apis_pipeline_v1beta1_ConditionCheckStatusFields(ref common.Refe } } +func schema_pkg_apis_pipeline_v1beta1_Container(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "A single application container that you want to run within a pod.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", + Type: []string{"string"}, + Format: "", + }, + }, + "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "args": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "workingDir": { + SchemaProps: spec.SchemaProps{ + Description: "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", + Type: []string{"string"}, + Format: "", + }, + }, + "ports": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "containerPort", + "protocol", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "containerPort", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerPort"), + }, + }, + }, + }, + }, + "envFrom": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.EnvFromSource"), + }, + }, + }, + }, + }, + "env": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of environment variables to set in the container. Cannot be updated.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.EnvVar"), + }, + }, + }, + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "volumeMounts": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "mountPath", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Pod volumes to mount into the container's filesystem. Cannot be updated.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.VolumeMount"), + }, + }, + }, + }, + }, + "volumeDevices": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "devicePath", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "volumeDevices is the list of block devices to be used by the container.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.VolumeDevice"), + }, + }, + }, + }, + }, + "livenessProbe": { + SchemaProps: spec.SchemaProps{ + Description: "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + Ref: ref("k8s.io/api/core/v1.Probe"), + }, + }, + "readinessProbe": { + SchemaProps: spec.SchemaProps{ + Description: "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + Ref: ref("k8s.io/api/core/v1.Probe"), + }, + }, + "startupProbe": { + SchemaProps: spec.SchemaProps{ + Description: "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + Ref: ref("k8s.io/api/core/v1.Probe"), + }, + }, + "lifecycle": { + SchemaProps: spec.SchemaProps{ + Description: "Actions that the management system should take in response to container lifecycle events. Cannot be updated.", + Ref: ref("k8s.io/api/core/v1.Lifecycle"), + }, + }, + "terminationMessagePath": { + SchemaProps: spec.SchemaProps{ + Description: "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", + Type: []string{"string"}, + Format: "", + }, + }, + "terminationMessagePolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", + Type: []string{"string"}, + Format: "", + }, + }, + "imagePullPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", + Type: []string{"string"}, + Format: "", + }, + }, + "securityContext": { + SchemaProps: spec.SchemaProps{ + Description: "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", + Ref: ref("k8s.io/api/core/v1.SecurityContext"), + }, + }, + "stdin": { + SchemaProps: spec.SchemaProps{ + Description: "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "stdinOnce": { + SchemaProps: spec.SchemaProps{ + Description: "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", + Type: []string{"boolean"}, + Format: "", + }, + }, + "tty": { + SchemaProps: spec.SchemaProps{ + Description: "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + } +} + func schema_pkg_apis_pipeline_v1beta1_EmbeddedTask(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -935,7 +1200,7 @@ func schema_pkg_apis_pipeline_v1beta1_EmbeddedTask(ref common.ReferenceCallback) "stepTemplate": { SchemaProps: spec.SchemaProps{ Description: "StepTemplate can be used as the basis for all step containers within the Task, so that the steps inherit settings on the base container.", - Ref: ref("k8s.io/api/core/v1.Container"), + Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Container"), }, }, "sidecars": { @@ -999,7 +1264,7 @@ func schema_pkg_apis_pipeline_v1beta1_EmbeddedTask(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.PipelineTaskMetadata", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Sidecar", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Step", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResources", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WorkspaceDeclaration", "k8s.io/api/core/v1.Container", "k8s.io/api/core/v1.Volume", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Container", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.PipelineTaskMetadata", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Sidecar", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Step", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResources", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WorkspaceDeclaration", "k8s.io/api/core/v1.Volume", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -3015,6 +3280,11 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm }, }, "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", Type: []string{"array"}, @@ -3030,6 +3300,11 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm }, }, "args": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", Type: []string{"array"}, @@ -3077,6 +3352,11 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm }, }, "envFrom": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", Type: []string{"array"}, @@ -3093,6 +3373,7 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm "env": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -3120,6 +3401,7 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge", }, @@ -3140,6 +3422,7 @@ func schema_pkg_apis_pipeline_v1beta1_Sidecar(ref common.ReferenceCallback) comm "volumeDevices": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge", }, @@ -3381,6 +3664,11 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. }, }, "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", Type: []string{"array"}, @@ -3396,6 +3684,11 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. }, }, "args": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", Type: []string{"array"}, @@ -3443,6 +3736,11 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. }, }, "envFrom": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", Type: []string{"array"}, @@ -3459,6 +3757,7 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. "env": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -3486,6 +3785,7 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge", }, @@ -3506,6 +3806,7 @@ func schema_pkg_apis_pipeline_v1beta1_Step(ref common.ReferenceCallback) common. "volumeDevices": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge", }, @@ -4943,7 +5244,7 @@ func schema_pkg_apis_pipeline_v1beta1_TaskSpec(ref common.ReferenceCallback) com "stepTemplate": { SchemaProps: spec.SchemaProps{ Description: "StepTemplate can be used as the basis for all step containers within the Task, so that the steps inherit settings on the base container.", - Ref: ref("k8s.io/api/core/v1.Container"), + Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Container"), }, }, "sidecars": { @@ -5007,7 +5308,7 @@ func schema_pkg_apis_pipeline_v1beta1_TaskSpec(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Sidecar", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Step", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResources", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WorkspaceDeclaration", "k8s.io/api/core/v1.Container", "k8s.io/api/core/v1.Volume"}, + "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Container", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.ParamSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Sidecar", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Step", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResources", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.TaskResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WorkspaceDeclaration", "k8s.io/api/core/v1.Volume"}, } } diff --git a/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go b/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go index b618ec50292..7c5aad284d0 100644 --- a/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_validation_test.go @@ -1153,7 +1153,7 @@ func TestValidateParamResults_Success(t *testing.T) { Name: "output", }}, Steps: []Step{{ - Container: corev1.Container{Name: "foo", Image: "bar"}, + Container: Container{Name: "foo", Image: "bar"}, }}, }}, Name: "a-task", @@ -3078,7 +3078,7 @@ func Test_validateResultsFromMatrixedPipelineTasksNotConsumed(t *testing.T) { func getTaskSpec() TaskSpec { return TaskSpec{ Steps: []Step{{ - Container: corev1.Container{Name: "foo", Image: "bar"}, + Container: Container{Name: "foo", Image: "bar"}, }}, } } diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go index ee4a785f590..eddac66d49b 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go @@ -259,7 +259,7 @@ func TestPipelineRun_Validate(t *testing.T) { Type: v1beta1.ParamTypeArray, }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "echo", Image: "ubuntu", Command: []string{"echo"}, diff --git a/pkg/apis/pipeline/v1beta1/resource_types_test.go b/pkg/apis/pipeline/v1beta1/resource_types_test.go index ef481daa87d..1636cbd94d4 100644 --- a/pkg/apis/pipeline/v1beta1/resource_types_test.go +++ b/pkg/apis/pipeline/v1beta1/resource_types_test.go @@ -24,13 +24,13 @@ import ( ) var ( - prependStep = corev1.Container{ + prependStep = v1beta1.Container{ Name: "prepend-step", Image: "dummy", Command: []string{"doit"}, Args: []string{"stuff", "things"}, } - appendStep = corev1.Container{ + appendStep = v1beta1.Container{ Name: "append-step", Image: "dummy", Command: []string{"doit"}, diff --git a/pkg/apis/pipeline/v1beta1/sidecar_replacements_test.go b/pkg/apis/pipeline/v1beta1/sidecar_replacements_test.go index bca75facff7..498f91e792b 100644 --- a/pkg/apis/pipeline/v1beta1/sidecar_replacements_test.go +++ b/pkg/apis/pipeline/v1beta1/sidecar_replacements_test.go @@ -35,7 +35,7 @@ func TestApplySidecarReplacements(t *testing.T) { s := v1beta1.Sidecar{ Script: "$(replace.me)", - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "$(replace.me)", Image: "$(replace.me)", Command: []string{"$(array.replace.me)"}, @@ -81,7 +81,7 @@ func TestApplySidecarReplacements(t *testing.T) { expected := v1beta1.Sidecar{ Script: "replaced!", - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "replaced!", Image: "replaced!", Command: []string{"val1", "val2"}, diff --git a/pkg/apis/pipeline/v1beta1/step_replacements_test.go b/pkg/apis/pipeline/v1beta1/step_replacements_test.go index 8f03671e430..bef91511d2c 100644 --- a/pkg/apis/pipeline/v1beta1/step_replacements_test.go +++ b/pkg/apis/pipeline/v1beta1/step_replacements_test.go @@ -35,7 +35,7 @@ func TestApplyStepReplacements(t *testing.T) { s := v1beta1.Step{ Script: "$(replace.me)", - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "$(replace.me)", Image: "$(replace.me)", Command: []string{"$(array.replace.me)"}, @@ -81,7 +81,7 @@ func TestApplyStepReplacements(t *testing.T) { expected := v1beta1.Step{ Script: "replaced!", - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "replaced!", Image: "replaced!", Command: []string{"val1", "val2"}, diff --git a/pkg/apis/pipeline/v1beta1/swagger.json b/pkg/apis/pipeline/v1beta1/swagger.json index 92af2a98c73..84dcc4d60d5 100644 --- a/pkg/apis/pipeline/v1beta1/swagger.json +++ b/pkg/apis/pipeline/v1beta1/swagger.json @@ -560,6 +560,152 @@ } } }, + "v1beta1.Container": { + "description": "A single application container that you want to run within a pod.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "args": { + "description": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "atomic" + }, + "command": { + "description": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "atomic" + }, + "env": { + "description": "List of environment variables to set in the container. Cannot be updated.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/v1.EnvVar" + }, + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge" + }, + "envFrom": { + "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/v1.EnvFromSource" + }, + "x-kubernetes-list-type": "atomic" + }, + "image": { + "description": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", + "type": "string" + }, + "imagePullPolicy": { + "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", + "type": "string" + }, + "lifecycle": { + "description": "Actions that the management system should take in response to container lifecycle events. Cannot be updated.", + "$ref": "#/definitions/v1.Lifecycle" + }, + "livenessProbe": { + "description": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "$ref": "#/definitions/v1.Probe" + }, + "name": { + "description": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", + "type": "string", + "default": "" + }, + "ports": { + "description": "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/v1.ContainerPort" + }, + "x-kubernetes-list-map-keys": [ + "containerPort", + "protocol" + ], + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "containerPort", + "x-kubernetes-patch-strategy": "merge" + }, + "readinessProbe": { + "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "$ref": "#/definitions/v1.Probe" + }, + "resources": { + "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + "default": {}, + "$ref": "#/definitions/v1.ResourceRequirements" + }, + "securityContext": { + "description": "SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", + "$ref": "#/definitions/v1.SecurityContext" + }, + "startupProbe": { + "description": "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "$ref": "#/definitions/v1.Probe" + }, + "stdin": { + "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", + "type": "boolean" + }, + "stdinOnce": { + "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", + "type": "boolean" + }, + "terminationMessagePath": { + "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", + "type": "string" + }, + "terminationMessagePolicy": { + "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", + "type": "string" + }, + "tty": { + "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", + "type": "boolean" + }, + "volumeDevices": { + "description": "volumeDevices is the list of block devices to be used by the container.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/v1.VolumeDevice" + }, + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "devicePath", + "x-kubernetes-patch-strategy": "merge" + }, + "volumeMounts": { + "description": "Pod volumes to mount into the container's filesystem. Cannot be updated.", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/v1.VolumeMount" + }, + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "mountPath", + "x-kubernetes-patch-strategy": "merge" + }, + "workingDir": { + "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", + "type": "string" + } + } + }, "v1beta1.EmbeddedTask": { "description": "EmbeddedTask is used to define a Task inline within a Pipeline's PipelineTasks.", "type": "object", @@ -616,7 +762,7 @@ }, "stepTemplate": { "description": "StepTemplate can be used as the basis for all step containers within the Task, so that the steps inherit settings on the base container.", - "$ref": "#/definitions/v1.Container" + "$ref": "#/definitions/v1beta1.Container" }, "steps": { "description": "Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.", @@ -1712,7 +1858,8 @@ "items": { "type": "string", "default": "" - } + }, + "x-kubernetes-list-type": "atomic" }, "command": { "description": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", @@ -1720,7 +1867,8 @@ "items": { "type": "string", "default": "" - } + }, + "x-kubernetes-list-type": "atomic" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", @@ -1729,6 +1877,7 @@ "default": {}, "$ref": "#/definitions/v1.EnvVar" }, + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, @@ -1738,7 +1887,8 @@ "items": { "default": {}, "$ref": "#/definitions/v1.EnvFromSource" - } + }, + "x-kubernetes-list-type": "atomic" }, "image": { "description": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", @@ -1824,6 +1974,7 @@ "default": {}, "$ref": "#/definitions/v1.VolumeDevice" }, + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, @@ -1834,6 +1985,7 @@ "default": {}, "$ref": "#/definitions/v1.VolumeMount" }, + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, @@ -1915,7 +2067,8 @@ "items": { "type": "string", "default": "" - } + }, + "x-kubernetes-list-type": "atomic" }, "command": { "description": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", @@ -1923,7 +2076,8 @@ "items": { "type": "string", "default": "" - } + }, + "x-kubernetes-list-type": "atomic" }, "env": { "description": "List of environment variables to set in the container. Cannot be updated.", @@ -1932,6 +2086,7 @@ "default": {}, "$ref": "#/definitions/v1.EnvVar" }, + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge" }, @@ -1941,7 +2096,8 @@ "items": { "default": {}, "$ref": "#/definitions/v1.EnvFromSource" - } + }, + "x-kubernetes-list-type": "atomic" }, "image": { "description": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", @@ -2035,6 +2191,7 @@ "default": {}, "$ref": "#/definitions/v1.VolumeDevice" }, + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge" }, @@ -2045,6 +2202,7 @@ "default": {}, "$ref": "#/definitions/v1.VolumeMount" }, + "x-kubernetes-list-type": "atomic", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge" }, @@ -2747,7 +2905,7 @@ }, "stepTemplate": { "description": "StepTemplate can be used as the basis for all step containers within the Task, so that the steps inherit settings on the base container.", - "$ref": "#/definitions/v1.Container" + "$ref": "#/definitions/v1beta1.Container" }, "steps": { "description": "Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.", diff --git a/pkg/apis/pipeline/v1beta1/task_types.go b/pkg/apis/pipeline/v1beta1/task_types.go index f7067b3a7a9..27ae270480d 100644 --- a/pkg/apis/pipeline/v1beta1/task_types.go +++ b/pkg/apis/pipeline/v1beta1/task_types.go @@ -110,7 +110,7 @@ type TaskSpec struct { // StepTemplate can be used as the basis for all step containers within the // Task, so that the steps inherit settings on the base container. - StepTemplate *corev1.Container `json:"stepTemplate,omitempty"` + StepTemplate *Container `json:"stepTemplate,omitempty"` // Sidecars are run alongside the Task's step containers. They begin before // the steps start and end after the steps complete. @@ -139,7 +139,7 @@ type TaskResult struct { // Step embeds the Container type, which allows it to include fields not // provided by Container. type Step struct { - corev1.Container `json:",inline"` + Container `json:",inline"` // Script is the contents of an executable file to execute. // @@ -172,7 +172,7 @@ type Step struct { // Sidecar has nearly the same data structure as Step, consisting of a Container and an optional Script, but does not have the ability to timeout. type Sidecar struct { - corev1.Container `json:",inline"` + Container `json:",inline"` // Script is the contents of an executable file to execute. // diff --git a/pkg/apis/pipeline/v1beta1/task_validation.go b/pkg/apis/pipeline/v1beta1/task_validation.go index e6baaed04eb..48a28067d16 100644 --- a/pkg/apis/pipeline/v1beta1/task_validation.go +++ b/pkg/apis/pipeline/v1beta1/task_validation.go @@ -87,7 +87,7 @@ func (tr TaskResult) Validate(_ context.Context) *apis.FieldError { // a mount path which conflicts with any other declared workspaces, with the explicitly // declared volume mounts, or with the stepTemplate. The names must also be unique. -func validateDeclaredWorkspaces(workspaces []WorkspaceDeclaration, steps []Step, stepTemplate *corev1.Container) (errs *apis.FieldError) { +func validateDeclaredWorkspaces(workspaces []WorkspaceDeclaration, steps []Step, stepTemplate *Container) (errs *apis.FieldError) { mountPaths := sets.NewString() for _, step := range steps { for _, vm := range step.VolumeMounts { diff --git a/pkg/apis/pipeline/v1beta1/task_validation_test.go b/pkg/apis/pipeline/v1beta1/task_validation_test.go index c860b927ded..23cf642b5d2 100644 --- a/pkg/apis/pipeline/v1beta1/task_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/task_validation_test.go @@ -46,12 +46,12 @@ var invalidResource = v1beta1.TaskResource{ }, } -var validSteps = []v1beta1.Step{{Container: corev1.Container{ +var validSteps = []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }}} -var invalidSteps = []v1beta1.Step{{Container: corev1.Container{ +var invalidSteps = []v1beta1.Step{{Container: v1beta1.Container{ Name: "replaceImage", Image: "myimage", }}} @@ -87,7 +87,7 @@ func TestTaskSpecValidate(t *testing.T) { Params []v1beta1.ParamSpec Resources *v1beta1.TaskResources Steps []v1beta1.Step - StepTemplate *corev1.Container + StepTemplate *v1beta1.Container Workspaces []v1beta1.WorkspaceDeclaration Results []v1beta1.TaskResult } @@ -97,9 +97,9 @@ func TestTaskSpecValidate(t *testing.T) { }{{ name: "unnamed steps", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "myimage", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Image: "myotherimage", }}}, }, @@ -148,7 +148,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { Name: "foo-is-baz", }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "url", Args: []string{"--flag=$(params.baz) && $(params.foo-is-baz)"}, @@ -165,7 +165,7 @@ func TestTaskSpecValidate(t *testing.T) { Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", Command: []string{"$(params.foo-is-baz)"}, @@ -183,7 +183,7 @@ func TestTaskSpecValidate(t *testing.T) { Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", Command: []string{"$(params.foo-is-baz)"}, @@ -194,7 +194,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid path variable for legacy credential helper (aka creds-init)", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "echo", Args: []string{"$(credentials.path)"}, @@ -203,12 +203,12 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "step template included in validation", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "astep", Command: []string{"echo"}, Args: []string{"hello"}, }}}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Image: "some-image", }, }, @@ -216,7 +216,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid step with script", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", }, Script: ` @@ -233,7 +233,7 @@ func TestTaskSpecValidate(t *testing.T) { Name: "foo-is-baz", }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", }, Script: ` @@ -245,7 +245,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid step with script and args", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -257,7 +257,7 @@ func TestTaskSpecValidate(t *testing.T) { }, { name: "valid step with volumeMount under /tekton/home", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "foo", @@ -269,7 +269,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid workspace", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -284,7 +284,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid result", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -298,7 +298,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid task name context", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -311,7 +311,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid task retry count context", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -324,7 +324,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid taskrun name context", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -337,7 +337,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid taskrun uid context", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -350,7 +350,7 @@ func TestTaskSpecValidate(t *testing.T) { name: "valid context", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -385,7 +385,7 @@ func TestTaskSpecValidateError(t *testing.T) { Resources *v1beta1.TaskResources Steps []v1beta1.Step Volumes []corev1.Volume - StepTemplate *corev1.Container + StepTemplate *v1beta1.Container Workspaces []v1beta1.WorkspaceDeclaration Results []v1beta1.TaskResult } @@ -565,7 +565,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "inexistent param variable", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", Args: []string{"--flag=$(params.inexistent)"}, @@ -585,7 +585,7 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "$(params.baz)", Command: []string{"$(params.foo-is-baz)"}, @@ -607,7 +607,7 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "$(params.baz[*])", Command: []string{"$(params.foo-is-baz)"}, @@ -632,7 +632,7 @@ func TestTaskSpecValidateError(t *testing.T) { Steps: []v1beta1.Step{ { Script: "$(params.baz[*])", - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "mystep", Image: "my-image", WorkingDir: "/foo/bar/src/", @@ -653,7 +653,7 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -675,7 +675,7 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "foo-is-baz", Type: v1beta1.ParamTypeArray, }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -697,7 +697,7 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "foo-is-baz", Default: v1beta1.NewArrayOrString("implied", "array", "type"), }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -719,7 +719,7 @@ func TestTaskSpecValidateError(t *testing.T) { Name: "foo-is-baz", Default: v1beta1.NewArrayOrString("implied", "array", "type"), }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "someimage", Command: []string{"$(params.foo-is-baz)"}, @@ -741,7 +741,7 @@ func TestTaskSpecValidateError(t *testing.T) { Default: v1beta1.NewArrayOrString("default"), }, }, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ @@ -761,7 +761,7 @@ func TestTaskSpecValidateError(t *testing.T) { Description: "param", Default: v1beta1.NewArrayOrString("default"), }}, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", Args: []string{"$(params.foo) && $(params.inexistent)"}, @@ -789,7 +789,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "step with script and command", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Command: []string{"command"}, }, @@ -803,7 +803,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step volume mounts under /tekton/", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "foo", @@ -818,7 +818,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "step volume mount name starts with tekton-internal-", fields: fields{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "myimage", VolumeMounts: []corev1.VolumeMount{{ Name: "tekton-internal-foo", @@ -866,7 +866,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "workspace mount path already in volumeMounts", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Command: []string{"command"}, VolumeMounts: []corev1.VolumeMount{{ @@ -888,7 +888,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "workspace default mount path already in volumeMounts", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Command: []string{"command"}, VolumeMounts: []corev1.VolumeMount{{ @@ -908,7 +908,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "workspace mount path already in stepTemplate", fields: fields{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "my-mount", MountPath: "/foo", @@ -927,7 +927,7 @@ func TestTaskSpecValidateError(t *testing.T) { }, { name: "workspace default mount path already in stepTemplate", fields: fields{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "my-mount", MountPath: "/workspace/some-workspace", @@ -960,7 +960,7 @@ func TestTaskSpecValidateError(t *testing.T) { name: "context not validate", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -1022,7 +1022,7 @@ func TestStepAndSidecarWorkspaces(t *testing.T) { name: "valid step workspace usage", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", Args: []string{"arg"}, }, @@ -1073,7 +1073,7 @@ func TestStepAndSidecarWorkspacesErrors(t *testing.T) { name: "step workspace that refers to non-existent workspace declaration fails", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "foo", }, Workspaces: []v1beta1.WorkspaceUsage{{ @@ -1089,12 +1089,12 @@ func TestStepAndSidecarWorkspacesErrors(t *testing.T) { name: "sidecar workspace that refers to non-existent workspace declaration fails", fields: fields{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "foo", }, }}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "foo", }, Workspaces: []v1beta1.WorkspaceUsage{{ @@ -1144,7 +1144,7 @@ func TestStepOnError(t *testing.T) { name: "valid step - valid onError usage - set to continue - alpha API", steps: []v1beta1.Step{{ OnError: "continue", - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "image", Args: []string{"arg"}, }, @@ -1153,7 +1153,7 @@ func TestStepOnError(t *testing.T) { name: "valid step - valid onError usage - set to stopAndFail - alpha API", steps: []v1beta1.Step{{ OnError: "stopAndFail", - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "image", Args: []string{"arg"}, }, @@ -1162,7 +1162,7 @@ func TestStepOnError(t *testing.T) { name: "invalid step - onError set to invalid value - alpha API", steps: []v1beta1.Step{{ OnError: "onError", - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "image", Args: []string{"arg"}, }, @@ -1206,7 +1206,7 @@ func TestIncompatibleAPIVersions(t *testing.T) { Name: "foo", }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "foo", }, Workspaces: []v1beta1.WorkspaceUsage{{ @@ -1222,12 +1222,12 @@ func TestIncompatibleAPIVersions(t *testing.T) { Name: "foo", }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "foo", }, }}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "foo", }, Workspaces: []v1beta1.WorkspaceUsage{{ @@ -1240,7 +1240,7 @@ func TestIncompatibleAPIVersions(t *testing.T) { requiredVersion: "alpha", spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "my-image", }, Script: ` diff --git a/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go b/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go index ca08a59755c..b3bb12a2ddf 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go @@ -207,7 +207,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { Name: "taskrefname", }, TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -236,7 +236,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { name: "invalid taskspec", spec: v1beta1.TaskRunSpec{ TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "invalid-name-with-$weird-char/%", Image: "myimage", }}}, @@ -511,7 +511,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { name: "taskspec without a taskRef", spec: v1beta1.TaskRunSpec{ TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -522,7 +522,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { spec: v1beta1.TaskRunSpec{ Timeout: &metav1.Duration{Duration: 0}, TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -537,7 +537,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { Value: *v1beta1.NewArrayOrString("value"), }}, TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }}}, @@ -548,7 +548,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { spec: v1beta1.TaskRunSpec{ TaskSpec: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }, diff --git a/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go index 983a234151b..fc91f0d3dc2 100644 --- a/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go @@ -246,6 +246,89 @@ func (in *ConditionCheckStatusFields) DeepCopy() *ConditionCheckStatusFields { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Container) DeepCopyInto(out *Container) { + *out = *in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]v1.ContainerPort, len(*in)) + copy(*out, *in) + } + if in.EnvFrom != nil { + in, out := &in.EnvFrom, &out.EnvFrom + *out = make([]v1.EnvFromSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Resources.DeepCopyInto(&out.Resources) + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = make([]v1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VolumeDevices != nil { + in, out := &in.VolumeDevices, &out.VolumeDevices + *out = make([]v1.VolumeDevice, len(*in)) + copy(*out, *in) + } + if in.LivenessProbe != nil { + in, out := &in.LivenessProbe, &out.LivenessProbe + *out = new(v1.Probe) + (*in).DeepCopyInto(*out) + } + if in.ReadinessProbe != nil { + in, out := &in.ReadinessProbe, &out.ReadinessProbe + *out = new(v1.Probe) + (*in).DeepCopyInto(*out) + } + if in.StartupProbe != nil { + in, out := &in.StartupProbe, &out.StartupProbe + *out = new(v1.Probe) + (*in).DeepCopyInto(*out) + } + if in.Lifecycle != nil { + in, out := &in.Lifecycle, &out.Lifecycle + *out = new(v1.Lifecycle) + (*in).DeepCopyInto(*out) + } + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Container. +func (in *Container) DeepCopy() *Container { + if in == nil { + return nil + } + out := new(Container) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EmbeddedTask) DeepCopyInto(out *EmbeddedTask) { *out = *in @@ -1965,7 +2048,7 @@ func (in *TaskSpec) DeepCopyInto(out *TaskSpec) { } if in.StepTemplate != nil { in, out := &in.StepTemplate, &out.StepTemplate - *out = new(v1.Container) + *out = new(Container) (*in).DeepCopyInto(*out) } if in.Sidecars != nil { diff --git a/pkg/apis/resource/v1alpha1/cluster/cluster_resource.go b/pkg/apis/resource/v1alpha1/cluster/cluster_resource.go index 939d6ec19b0..914e0ad089d 100644 --- a/pkg/apis/resource/v1alpha1/cluster/cluster_resource.go +++ b/pkg/apis/resource/v1alpha1/cluster/cluster_resource.go @@ -186,7 +186,7 @@ func (s *Resource) GetInputTaskModifier(ts *v1beta1.TaskSpec, path string) (v1be } envVars = append(envVars, ev) } - step := v1beta1.Step{Container: corev1.Container{ + step := v1beta1.Step{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("kubeconfig"), Image: s.KubeconfigWriterImage, Command: []string{"/ko-app/kubeconfigwriter"}, diff --git a/pkg/apis/resource/v1alpha1/cluster/cluster_resource_test.go b/pkg/apis/resource/v1alpha1/cluster/cluster_resource_test.go index 1c01366cf0e..103bfe93fe4 100644 --- a/pkg/apis/resource/v1alpha1/cluster/cluster_resource_test.go +++ b/pkg/apis/resource/v1alpha1/cluster/cluster_resource_test.go @@ -285,7 +285,7 @@ func TestClusterResource_GetInputTaskModifier(t *testing.T) { ts := v1beta1.TaskSpec{} wantSteps := []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "kubeconfig-9l9zj", Image: "override-with-kubeconfig-writer:latest", Command: []string{"/ko-app/kubeconfigwriter"}, diff --git a/pkg/apis/resource/v1alpha1/git/git_resource.go b/pkg/apis/resource/v1alpha1/git/git_resource.go index 5e102c9440e..595d42890f0 100644 --- a/pkg/apis/resource/v1alpha1/git/git_resource.go +++ b/pkg/apis/resource/v1alpha1/git/git_resource.go @@ -188,7 +188,7 @@ func (s *Resource) GetInputTaskModifier(_ *v1beta1.TaskSpec, path string) (v1bet } step := v1beta1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(gitSource + "-" + s.Name), Image: s.GitImage, Command: []string{"/ko-app/git-init"}, diff --git a/pkg/apis/resource/v1alpha1/git/git_resource_test.go b/pkg/apis/resource/v1alpha1/git/git_resource_test.go index 2d2e0a9ffce..fc8cb83280e 100644 --- a/pkg/apis/resource/v1alpha1/git/git_resource_test.go +++ b/pkg/apis/resource/v1alpha1/git/git_resource_test.go @@ -547,7 +547,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { for _, tc := range []struct { desc string gitResource *git.Resource - want corev1.Container + want v1beta1.Container }{{ desc: "With basic values", gitResource: &git.Resource{ @@ -564,7 +564,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -602,7 +602,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-mz4c7", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -641,7 +641,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-mssqb", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -681,7 +681,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-78c5n", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -720,7 +720,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-6nl7g", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -758,7 +758,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPProxy: "http-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-j2tds", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -796,7 +796,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPProxy: "http-proxy.git.com", HTTPSProxy: "https-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-vr6ds", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -835,7 +835,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-l22wn", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -876,7 +876,7 @@ func TestGitResource_GetDownloadTaskModifier(t *testing.T) { HTTPSProxy: "https-proxy.git.com", NOProxy: "no-proxy.git.com", }, - want: corev1.Container{ + want: v1beta1.Container{ Name: "git-source-git-resource-twkr2", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, diff --git a/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource.go b/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource.go index f3035e42f3d..ef1ddeb8441 100644 --- a/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource.go +++ b/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource.go @@ -168,7 +168,7 @@ func (s *Resource) getSteps(mode string, sourcePath string) []pipelinev1beta1.St } } - return []pipelinev1beta1.Step{{Container: corev1.Container{ + return []pipelinev1beta1.Step{{Container: pipelinev1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(prSource + "-" + s.Name), Image: s.PRImage, Command: []string{"/ko-app/pullrequest-init"}, diff --git a/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource_test.go b/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource_test.go index 602c60c6263..5b7da226afa 100644 --- a/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource_test.go +++ b/pkg/apis/resource/v1alpha1/pullrequest/pull_request_resource_test.go @@ -113,7 +113,7 @@ func containerTestCases(mode string) []testcase { PRImage: "override-with-pr:latest", InsecureSkipTLSVerify: false, }, - out: []v1beta1.Step{{Container: corev1.Container{ + out: []v1beta1.Step{{Container: v1beta1.Container{ Name: "pr-source-nocreds-9l9zj", Image: "override-with-pr:latest", WorkingDir: pipeline.WorkspaceDir, @@ -135,7 +135,7 @@ func containerTestCases(mode string) []testcase { PRImage: "override-with-pr:latest", Provider: "github", }, - out: []v1beta1.Step{{Container: corev1.Container{ + out: []v1beta1.Step{{Container: v1beta1.Container{ Name: "pr-source-creds-mz4c7", Image: "override-with-pr:latest", WorkingDir: pipeline.WorkspaceDir, @@ -163,7 +163,7 @@ func containerTestCases(mode string) []testcase { PRImage: "override-with-pr:latest", InsecureSkipTLSVerify: true, }, - out: []v1beta1.Step{{Container: corev1.Container{ + out: []v1beta1.Step{{Container: v1beta1.Container{ Name: "pr-source-nocreds-mssqb", Image: "override-with-pr:latest", WorkingDir: pipeline.WorkspaceDir, @@ -179,7 +179,7 @@ func containerTestCases(mode string) []testcase { PRImage: "override-with-pr:latest", DisableStrictJSONComments: true, }, - out: []v1beta1.Step{{Container: corev1.Container{ + out: []v1beta1.Step{{Container: v1beta1.Container{ Name: "pr-source-strict-json-comments-78c5n", Image: "override-with-pr:latest", WorkingDir: pipeline.WorkspaceDir, diff --git a/pkg/apis/resource/v1alpha1/storage/artifact_bucket.go b/pkg/apis/resource/v1alpha1/storage/artifact_bucket.go index 0c23798b29b..0adbe9fdc5c 100644 --- a/pkg/apis/resource/v1alpha1/storage/artifact_bucket.go +++ b/pkg/apis/resource/v1alpha1/storage/artifact_bucket.go @@ -57,11 +57,11 @@ func (b *ArtifactBucket) StorageBasePath(pr *v1beta1.PipelineRun) string { func (b *ArtifactBucket) GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1beta1.Step { envVars, secretVolumeMount := getSecretEnvVarsAndVolumeMounts("bucket", secretVolumeMountPath, b.Secrets) - return []v1beta1.Step{{Container: corev1.Container{ + return []v1beta1.Step{{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("artifact-dest-mkdir-%s", name)), Image: b.ShellImage, Command: []string{"mkdir", "-p", destinationPath}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("artifact-copy-from-%s", name)), Image: b.GsutilImage, Command: []string{"gsutil"}, @@ -75,7 +75,7 @@ func (b *ArtifactBucket) GetCopyFromStorageToSteps(name, sourcePath, destination func (b *ArtifactBucket) GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1beta1.Step { envVars, secretVolumeMount := getSecretEnvVarsAndVolumeMounts("bucket", secretVolumeMountPath, b.Secrets) - return []v1beta1.Step{{Container: corev1.Container{ + return []v1beta1.Step{{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("artifact-copy-to-%s", name)), Image: b.GsutilImage, Command: []string{"gsutil"}, diff --git a/pkg/apis/resource/v1alpha1/storage/artifact_bucket_test.go b/pkg/apis/resource/v1alpha1/storage/artifact_bucket_test.go index 8360f2df750..4b1ef41bee3 100644 --- a/pkg/apis/resource/v1alpha1/storage/artifact_bucket_test.go +++ b/pkg/apis/resource/v1alpha1/storage/artifact_bucket_test.go @@ -50,11 +50,11 @@ var ( func TestBucketGetCopyFromContainerSpec(t *testing.T) { names.TestingSeed() - want := []v1alpha1.Step{{Container: corev1.Container{ + want := []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "artifact-dest-mkdir-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/destination"}, - }}, {Container: corev1.Container{ + }}, {Container: v1alpha1.Container{ Name: "artifact-copy-from-workspace-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -71,7 +71,7 @@ func TestBucketGetCopyFromContainerSpec(t *testing.T) { func TestBucketGetCopyToContainerSpec(t *testing.T) { names.TestingSeed() - want := []v1alpha1.Step{{Container: corev1.Container{ + want := []v1alpha1.Step{{Container: v1alpha1.Container{ Name: "artifact-copy-to-workspace-9l9zj", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, diff --git a/pkg/apis/resource/v1alpha1/storage/artifact_pvc.go b/pkg/apis/resource/v1alpha1/storage/artifact_pvc.go index 80c882ad3d6..ed517b1362a 100644 --- a/pkg/apis/resource/v1alpha1/storage/artifact_pvc.go +++ b/pkg/apis/resource/v1alpha1/storage/artifact_pvc.go @@ -51,7 +51,7 @@ func (p *ArtifactPVC) StorageBasePath(pr *v1beta1.PipelineRun) string { // GetCopyFromStorageToSteps returns a container used to download artifacts from temporary storage. func (p *ArtifactPVC) GetCopyFromStorageToSteps(name, sourcePath, destinationPath string) []v1beta1.Step { - return []v1beta1.Step{{Container: corev1.Container{ + return []v1beta1.Step{{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("source-copy-%s", name)), Image: p.ShellImage, Command: []string{"cp", "-r", fmt.Sprintf("%s/.", sourcePath), destinationPath}, @@ -64,7 +64,7 @@ func (p *ArtifactPVC) GetCopyFromStorageToSteps(name, sourcePath, destinationPat // GetCopyToStorageFromSteps returns a container used to upload artifacts for temporary storage. func (p *ArtifactPVC) GetCopyToStorageFromSteps(name, sourcePath, destinationPath string) []v1beta1.Step { - return []v1beta1.Step{{Container: corev1.Container{ + return []v1beta1.Step{{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("source-mkdir-%s", name)), Image: p.ShellImage, // This requires us to run as root, and the ShellImage is nonroot @@ -74,7 +74,7 @@ func (p *ArtifactPVC) GetCopyToStorageFromSteps(name, sourcePath, destinationPat }, Command: []string{"mkdir", "-p", destinationPath}, VolumeMounts: []corev1.VolumeMount{GetPvcMount(p.Name)}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("source-copy-%s", name)), Image: p.ShellImage, // This requires us to run as root, and the ShellImage is nonroot diff --git a/pkg/apis/resource/v1alpha1/storage/artifact_pvc_test.go b/pkg/apis/resource/v1alpha1/storage/artifact_pvc_test.go index 011c79e8c5c..312ecf73bc3 100644 --- a/pkg/apis/resource/v1alpha1/storage/artifact_pvc_test.go +++ b/pkg/apis/resource/v1alpha1/storage/artifact_pvc_test.go @@ -36,7 +36,7 @@ func TestPVCGetCopyFromContainerSpec(t *testing.T) { Name: "pipelinerun-pvc", ShellImage: "busybox", } - want := []v1beta1.Step{{Container: corev1.Container{ + want := []v1beta1.Step{{Container: v1beta1.Container{ Name: "source-copy-workspace-9l9zj", Image: "busybox", @@ -57,7 +57,7 @@ func TestPVCGetCopyToContainerSpec(t *testing.T) { Name: "pipelinerun-pvc", ShellImage: "busybox", } - want := []v1beta1.Step{{Container: corev1.Container{ + want := []v1beta1.Step{{Container: v1beta1.Container{ Name: "source-mkdir-workspace-9l9zj", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -65,7 +65,7 @@ func TestPVCGetCopyToContainerSpec(t *testing.T) { }, Command: []string{"mkdir", "-p", "/workspace/destination"}, VolumeMounts: []corev1.VolumeMount{{MountPath: "/pvc", Name: "pipelinerun-pvc"}}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-copy-workspace-mz4c7", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -100,7 +100,7 @@ func TestPVCGetPvcMount(t *testing.T) { func TestPVCGetMakeStep(t *testing.T) { names.TestingSeed() - want := v1beta1.Step{Container: corev1.Container{ + want := v1beta1.Step{Container: v1beta1.Container{ Name: "create-dir-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/destination"}, diff --git a/pkg/apis/resource/v1alpha1/storage/gcs.go b/pkg/apis/resource/v1alpha1/storage/gcs.go index 78a7c2cd97f..e891b0e8ea5 100644 --- a/pkg/apis/resource/v1alpha1/storage/gcs.go +++ b/pkg/apis/resource/v1alpha1/storage/gcs.go @@ -121,7 +121,7 @@ func (s *GCSResource) GetOutputTaskModifier(ts *v1beta1.TaskSpec, path string) ( envVars = append(envVars, corev1.EnvVar{Name: "HOME", Value: pipeline.HomeDir}) - step := v1beta1.Step{Container: corev1.Container{ + step := v1beta1.Step{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("upload-%s", s.Name)), Image: s.GsutilImage, Command: []string{"gsutil"}, @@ -156,7 +156,7 @@ func (s *GCSResource) GetInputTaskModifier(ts *v1beta1.TaskSpec, path string) (v CreateDirStep(s.ShellImage, s.Name, path), { Script: script, - Container: corev1.Container{ + Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("fetch-%s", s.Name)), Image: s.GsutilImage, Env: envVars, diff --git a/pkg/apis/resource/v1alpha1/storage/gcs_test.go b/pkg/apis/resource/v1alpha1/storage/gcs_test.go index b4678ee6420..5411ad654d5 100644 --- a/pkg/apis/resource/v1alpha1/storage/gcs_test.go +++ b/pkg/apis/resource/v1alpha1/storage/gcs_test.go @@ -271,7 +271,7 @@ func TestGetInputSteps(t *testing.T) { ShellImage: "busybox", GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk", }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-gcs-valid-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace"}, @@ -283,7 +283,7 @@ if [[ "${GOOGLE_APPLICATION_CREDENTIALS}" != "" ]]; then fi gsutil rsync -d -r gs://some-bucket /workspace `, - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "fetch-gcs-valid-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Env: []corev1.EnvVar{{ @@ -316,7 +316,7 @@ gsutil rsync -d -r gs://some-bucket /workspace ShellImage: "busybox", GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk", }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-gcs-valid-mssqb", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace"}, @@ -328,7 +328,7 @@ if [[ "${GOOGLE_APPLICATION_CREDENTIALS}" != "" ]]; then fi gsutil cp gs://some-bucket /workspace `, - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "fetch-gcs-valid-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Env: []corev1.EnvVar{{ @@ -379,7 +379,7 @@ func TestGetOutputTaskModifier(t *testing.T) { }}, GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk", }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "upload-gcs-valid-9l9zj", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -412,7 +412,7 @@ func TestGetOutputTaskModifier(t *testing.T) { }}, GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk", }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "upload-gcs-valid-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -437,7 +437,7 @@ func TestGetOutputTaskModifier(t *testing.T) { TypeDir: false, GsutilImage: "gcr.io/google.com/cloudsdktool/cloud-sdk", }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "upload-gcs-valid-mssqb", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, diff --git a/pkg/apis/resource/v1alpha1/storage/storage.go b/pkg/apis/resource/v1alpha1/storage/storage.go index 5b5467fc22a..4c3c61e1f90 100644 --- a/pkg/apis/resource/v1alpha1/storage/storage.go +++ b/pkg/apis/resource/v1alpha1/storage/storage.go @@ -84,7 +84,7 @@ func getStorageVolumeSpec(s PipelineStorageResourceInterface, spec v1beta1.TaskS // CreateDirStep returns a Step that creates a given directory with a given name. func CreateDirStep(shellImage string, name, destinationPath string) v1beta1.Step { - return v1beta1.Step{Container: corev1.Container{ + return v1beta1.Step{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("create-dir-%s", strings.ToLower(name))), Image: shellImage, Command: []string{"mkdir", "-p", destinationPath}, diff --git a/pkg/pod/pod_test.go b/pkg/pod/pod_test.go index 70c6f85d34e..fc78e183017 100644 --- a/pkg/pod/pod_test.go +++ b/pkg/pod/pod_test.go @@ -113,7 +113,7 @@ func TestPodBuild(t *testing.T) { }{{ desc: "simple", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -121,7 +121,7 @@ func TestPodBuild(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -160,7 +160,7 @@ func TestPodBuild(t *testing.T) { }, }, ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -168,7 +168,7 @@ func TestPodBuild(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -202,7 +202,7 @@ func TestPodBuild(t *testing.T) { }, { desc: "simple with running-in-environment-with-injected-sidecar set to false", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -213,7 +213,7 @@ func TestPodBuild(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -250,7 +250,7 @@ func TestPodBuild(t *testing.T) { }, { desc: "with service account", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -262,7 +262,7 @@ func TestPodBuild(t *testing.T) { want: &corev1.PodSpec{ ServiceAccountName: "service-account", RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -303,7 +303,7 @@ func TestPodBuild(t *testing.T) { }, { desc: "with-pod-template", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -329,7 +329,7 @@ func TestPodBuild(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -378,7 +378,7 @@ func TestPodBuild(t *testing.T) { }, { desc: "very long step name", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "a-very-very-long-character-step-name-to-trigger-max-len----and-invalid-characters", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -386,7 +386,7 @@ func TestPodBuild(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "a-very-very-long-character-step-name-to-trigger-max-len----and-invalid-characters"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "a-very-very-long-character-step-name-to-trigger-max-len----and-invalid-characters"}}})}, Containers: []corev1.Container{{ Name: "step-a-very-very-long-character-step-name-to-trigger-max-len", // step name trimmed. Image: "image", @@ -420,7 +420,7 @@ func TestPodBuild(t *testing.T) { }, { desc: "step name ends with non alphanumeric", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "ends-with-invalid-%%__$$", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -428,7 +428,7 @@ func TestPodBuild(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "ends-with-invalid-%%__$$"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "ends-with-invalid-%%__$$"}}})}, Containers: []corev1.Container{{ Name: "step-ends-with-invalid", // invalid suffix removed. Image: "image", @@ -462,7 +462,7 @@ func TestPodBuild(t *testing.T) { }, { desc: "workingDir in workspace", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -473,7 +473,7 @@ func TestPodBuild(t *testing.T) { RestartPolicy: corev1.RestartPolicyNever, InitContainers: []corev1.Container{ placeToolsInit, - tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}}), + tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}}), { Name: "working-dir-initializer", Image: images.WorkingDirInitImage, @@ -517,13 +517,13 @@ func TestPodBuild(t *testing.T) { }, { desc: "sidecar container", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "primary-name", Image: "primary-image", Command: []string{"cmd"}, // avoid entrypoint lookup. }}}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sc-name", Image: "sidecar-image", }, @@ -532,7 +532,7 @@ func TestPodBuild(t *testing.T) { wantAnnotations: map[string]string{}, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "primary-name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "primary-name"}}})}, Containers: []corev1.Container{{ Name: "step-primary-name", Image: "primary-image", @@ -572,13 +572,13 @@ func TestPodBuild(t *testing.T) { }, { desc: "sidecar container with script", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "primary-name", Image: "primary-image", Command: []string{"cmd"}, // avoid entrypoint lookup. }}}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sc-name", Image: "sidecar-image", }, @@ -590,7 +590,7 @@ func TestPodBuild(t *testing.T) { RestartPolicy: corev1.RestartPolicyNever, InitContainers: []corev1.Container{ placeToolsInit, - tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "primary-name"}}}), + tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "primary-name"}}}), { Name: "place-scripts", Image: "busybox", @@ -643,13 +643,13 @@ _EOF_ }, { desc: "sidecar container with enable-ready-annotation-on-pod-create", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "primary-name", Image: "primary-image", Command: []string{"cmd"}, // avoid entrypoint lookup. }}}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sc-name", Image: "sidecar-image", }, @@ -661,7 +661,7 @@ _EOF_ wantAnnotations: map[string]string{}, // no ready annotations on pod create since sidecars are present want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "primary-name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "primary-name"}}})}, Containers: []corev1.Container{{ Name: "step-primary-name", Image: "primary-image", @@ -698,7 +698,7 @@ _EOF_ }, { desc: "resource request", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. Resources: corev1.ResourceRequirements{ @@ -707,7 +707,7 @@ _EOF_ corev1.ResourceMemory: resource.MustParse("10Gi"), }, }, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. Resources: corev1.ResourceRequirements{ @@ -721,8 +721,8 @@ _EOF_ want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{ - {Container: corev1.Container{Name: "unnamed-0"}}, - {Container: corev1.Container{Name: "unnamed-1"}}, + {Container: v1beta1.Container{Name: "unnamed-0"}}, + {Container: v1beta1.Container{Name: "unnamed-1"}}, })}, Containers: []corev1.Container{{ Name: "step-unnamed-0", @@ -794,7 +794,7 @@ _EOF_ }, { desc: "with stepOverrides", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", Image: "image", Command: []string{"cmd"}, @@ -820,7 +820,7 @@ _EOF_ want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{ - {Container: corev1.Container{Name: "step1"}}, + {Container: v1beta1.Container{Name: "step1"}}, })}, Containers: []corev1.Container{{ Name: "step-step1", @@ -861,7 +861,7 @@ _EOF_ }, { desc: "with stepOverrides and stepTemplate", ts: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("8"), @@ -869,7 +869,7 @@ _EOF_ }, }, }, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", Image: "image", Command: []string{"cmd"}, @@ -889,7 +889,7 @@ _EOF_ want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{ - {Container: corev1.Container{Name: "step1"}}, + {Container: v1beta1.Container{Name: "step1"}}, })}, Containers: []corev1.Container{{ Name: "step-step1", @@ -930,13 +930,13 @@ _EOF_ }, { desc: "with sidecarOverrides", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "primary-name", Image: "primary-image", Command: []string{"cmd"}, // avoid entrypoint lookup. }}}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sc-name", Image: "sidecar-image", Resources: corev1.ResourceRequirements{ @@ -962,7 +962,7 @@ _EOF_ wantAnnotations: map[string]string{}, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "primary-name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "primary-name"}}})}, Containers: []corev1.Container{{ Name: "step-primary-name", Image: "primary-image", @@ -1005,18 +1005,18 @@ _EOF_ }, { desc: "step with script and stepTemplate", ts: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Env: []corev1.EnvVar{{Name: "FOO", Value: "bar"}}, Args: []string{"template", "args"}, }, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "one", Image: "image", }, Script: "#!/bin/sh\necho hello from step one", }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "two", Image: "image", VolumeMounts: []corev1.VolumeMount{{Name: "i-have-a-volume-mount"}}, @@ -1024,7 +1024,7 @@ _EOF_ Script: `#!/usr/bin/env python print("Hello from Python")`, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "regular-step", Image: "image", Command: []string{"regular", "command"}, @@ -1036,9 +1036,9 @@ print("Hello from Python")`, InitContainers: []corev1.Container{ placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{ - {Container: corev1.Container{Name: "one"}}, - {Container: corev1.Container{Name: "two"}}, - {Container: corev1.Container{Name: "regular-step"}}, + {Container: v1beta1.Container{Name: "one"}}, + {Container: v1beta1.Container{Name: "two"}}, + {Container: v1beta1.Container{Name: "regular-step"}}, }), { Name: "place-scripts", @@ -1154,7 +1154,7 @@ _EOF_ desc: "step with script that uses two dollar signs", ts: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "one", Image: "image", }, @@ -1164,7 +1164,7 @@ _EOF_ want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, InitContainers: []corev1.Container{placeToolsInit, - tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "one"}}}), + tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "one"}}}), { Name: "place-scripts", Image: images.ShellImage, @@ -1214,7 +1214,7 @@ _EOF_ ts: v1beta1.TaskSpec{ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "schedule-me", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1229,7 +1229,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "schedule-me"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "schedule-me"}}})}, SchedulerName: "there-scheduler", Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ Name: "tekton-creds-init-home-0", @@ -1267,7 +1267,7 @@ _EOF_ ts: v1beta1.TaskSpec{ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "image-pull", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1282,7 +1282,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "image-pull"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "image-pull"}}})}, Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ Name: "tekton-creds-init-home-0", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{Medium: corev1.StorageMediumMemory}}, @@ -1320,7 +1320,7 @@ _EOF_ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "host-aliases", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1335,7 +1335,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "host-aliases"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "host-aliases"}}})}, Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ Name: "tekton-creds-init-home-0", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{Medium: corev1.StorageMediumMemory}}, @@ -1371,7 +1371,7 @@ _EOF_ ts: v1beta1.TaskSpec{ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "use-my-hostNetwork", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1386,7 +1386,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "use-my-hostNetwork"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "use-my-hostNetwork"}}})}, HostNetwork: true, Volumes: append(implicitVolumes, binVolume, runVolume(0), downwardVolume, corev1.Volume{ Name: "tekton-creds-init-home-0", @@ -1421,7 +1421,7 @@ _EOF_ }, { desc: "step-with-timeout", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1431,7 +1431,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1467,7 +1467,7 @@ _EOF_ }, { desc: "step-with-no-timeout-equivalent-to-0-second-timeout", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1480,7 +1480,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1519,7 +1519,7 @@ _EOF_ "disable-creds-init": "true", }, ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1527,7 +1527,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1556,7 +1556,7 @@ _EOF_ desc: "hermetic env var", featureFlags: map[string]string{"enable-api-fields": "alpha"}, ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1567,7 +1567,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1605,7 +1605,7 @@ _EOF_ desc: "override hermetic env var", featureFlags: map[string]string{"enable-api-fields": "alpha"}, ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1617,7 +1617,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1656,7 +1656,7 @@ _EOF_ }, { desc: "pod for a taskRun with retries", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1683,7 +1683,7 @@ _EOF_ }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1718,7 +1718,7 @@ _EOF_ }, { desc: "long-taskrun-name", ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1728,7 +1728,7 @@ _EOF_ wantPodName: "task-run-0123456789-01234560d38957287bb0283c59440df14069f59-pod", want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -1873,7 +1873,7 @@ func TestPodBuildwithAlphaAPIEnabled(t *testing.T) { }, }, ts: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "image", Command: []string{"cmd"}, // avoid entrypoint lookup. @@ -1881,7 +1881,7 @@ func TestPodBuildwithAlphaAPIEnabled(t *testing.T) { }, want: &corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, - InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: corev1.Container{Name: "name"}}})}, + InitContainers: []corev1.Container{placeToolsInit, tektonDirInit(images.EntrypointImage, []v1beta1.Step{{Container: v1beta1.Container{Name: "name"}}})}, Containers: []corev1.Container{{ Name: "step-name", Image: "image", @@ -2022,7 +2022,7 @@ func TestMakeLabels(t *testing.T) { func TestShouldAddReadyAnnotationonPodCreate(t *testing.T) { sd := v1beta1.Sidecar{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "a-sidecar", }, } diff --git a/pkg/pod/script.go b/pkg/pod/script.go index 2f886b355d6..94a86d5b652 100644 --- a/pkg/pod/script.go +++ b/pkg/pod/script.go @@ -131,7 +131,7 @@ func convertListOfSteps(steps []v1beta1.Step, initContainer *corev1.Container, p for i, s := range steps { if s.Script == "" { // Nothing to convert. - containers = append(containers, s.Container) + containers = append(containers, *s.Container.ToK8sContainer()) continue } @@ -194,7 +194,7 @@ cat > ${scriptfile} << '%s' } steps[i].VolumeMounts = append(steps[i].VolumeMounts, debugScriptsVolumeMount, debugInfoVolumeMount) } - containers = append(containers, steps[i].Container) + containers = append(containers, *steps[i].Container.ToK8sContainer()) } // Place debug scripts if breakpoints are enabled diff --git a/pkg/pod/script_test.go b/pkg/pod/script_test.go index 71e90169010..dc7309c6361 100644 --- a/pkg/pod/script_test.go +++ b/pkg/pod/script_test.go @@ -28,11 +28,11 @@ import ( func TestConvertScripts_NothingToConvert_EmptySidecars(t *testing.T) { gotInit, gotScripts, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-1", }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-2", }, }}, []v1beta1.Sidecar{}, nil) @@ -55,11 +55,11 @@ func TestConvertScripts_NothingToConvert_EmptySidecars(t *testing.T) { func TestConvertScripts_NothingToConvert_NilSidecars(t *testing.T) { gotInit, gotScripts, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-1", }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-2", }, }}, nil, nil) @@ -82,15 +82,15 @@ func TestConvertScripts_NothingToConvert_NilSidecars(t *testing.T) { func TestConvertScripts_NothingToConvert_WithSidecar(t *testing.T) { gotInit, gotScripts, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-1", }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-2", }, }}, []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "sidecar-1", }, }}, nil) @@ -133,22 +133,22 @@ func TestConvertScripts(t *testing.T) { gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ Script: `#!/bin/sh script-1`, - Container: corev1.Container{Image: "step-1"}, + Container: v1beta1.Container{Image: "step-1"}, }, { // No script to convert here. - Container: corev1.Container{Image: "step-2"}, + Container: v1beta1.Container{Image: "step-2"}, }, { Script: ` #!/bin/sh script-3`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, }, }, { Script: `no-shebang`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, @@ -226,22 +226,22 @@ func TestConvertScripts_WithBreakpoint_OnFailure(t *testing.T) { gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ Script: `#!/bin/sh script-1`, - Container: corev1.Container{Image: "step-1"}, + Container: v1beta1.Container{Image: "step-1"}, }, { // No script to convert here. - Container: corev1.Container{Image: "step-2"}, + Container: v1beta1.Container{Image: "step-2"}, }, { Script: ` #!/bin/sh script-3`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, }, }, { Script: `no-shebang`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, @@ -368,14 +368,14 @@ func TestConvertScripts_WithSidecar(t *testing.T) { gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ Script: `#!/bin/sh script-1`, - Container: corev1.Container{Image: "step-1"}, + Container: v1beta1.Container{Image: "step-1"}, }, { // No script to convert here.: - Container: corev1.Container{Image: "step-2"}, + Container: v1beta1.Container{Image: "step-2"}, }, { Script: `#!/bin/sh script-3`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, @@ -383,7 +383,7 @@ script-3`, }}, []v1beta1.Sidecar{{ Script: `#!/bin/sh sidecar-1`, - Container: corev1.Container{Image: "sidecar-1"}, + Container: v1beta1.Container{Image: "sidecar-1"}, }}, nil) wantInit := &corev1.Container{ Name: "place-scripts", @@ -462,14 +462,14 @@ func TestConvertScripts_Windows(t *testing.T) { gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ Script: `#!win pwsh -File script-1`, - Container: corev1.Container{Image: "step-1"}, + Container: v1beta1.Container{Image: "step-1"}, }, { // No script to convert here. - Container: corev1.Container{Image: "step-2"}, + Container: v1beta1.Container{Image: "step-2"}, }, { Script: `#!win powershell -File script-3`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, @@ -477,7 +477,7 @@ script-3`, }, { Script: `#!win no-shebang`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, @@ -549,14 +549,14 @@ func TestConvertScripts_Windows_WithSidecar(t *testing.T) { gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ Script: `#!win pwsh -File script-1`, - Container: corev1.Container{Image: "step-1"}, + Container: v1beta1.Container{Image: "step-1"}, }, { // No script to convert here.: - Container: corev1.Container{Image: "step-2"}, + Container: v1beta1.Container{Image: "step-2"}, }, { Script: `#!win powershell -File script-3`, - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "step-3", VolumeMounts: preExistingVolumeMounts, Args: []string{"my", "args"}, @@ -564,7 +564,7 @@ script-3`, }}, []v1beta1.Sidecar{{ Script: `#!win pwsh -File sidecar-1`, - Container: corev1.Container{Image: "sidecar-1"}, + Container: v1beta1.Container{Image: "sidecar-1"}, }}, nil) wantInit := &corev1.Container{ Name: "place-scripts", @@ -630,11 +630,11 @@ func TestConvertScripts_Windows_SidecarOnly(t *testing.T) { gotInit, gotSteps, gotSidecars := convertScripts(images.ShellImage, images.ShellImageWin, []v1beta1.Step{{ // No script to convert here.: - Container: corev1.Container{Image: "step-1"}, + Container: v1beta1.Container{Image: "step-1"}, }}, []v1beta1.Sidecar{{ Script: `#!win python sidecar-1`, - Container: corev1.Container{Image: "sidecar-1"}, + Container: v1beta1.Container{Image: "sidecar-1"}, }}, nil) wantInit := &corev1.Container{ Name: "place-scripts", diff --git a/pkg/reconciler/pipelinerun/pipelinerun_test.go b/pkg/reconciler/pipelinerun/pipelinerun_test.go index af962987b94..ea0a044d1ed 100644 --- a/pkg/reconciler/pipelinerun/pipelinerun_test.go +++ b/pkg/reconciler/pipelinerun/pipelinerun_test.go @@ -3975,7 +3975,7 @@ func makeExpectedTr(condName, ccName string, labels, annotations map[string]stri Spec: v1beta1.TaskRunSpec{ TaskSpec: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "condition-check-" + condName, Image: "foo", Args: []string{"bar"}, @@ -7504,7 +7504,7 @@ func getTaskRunWithTaskSpec(tr, pr, p, t string, labels, annotations map[string] Spec: v1beta1.TaskRunSpec{ TaskSpec: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "mystep", Image: "myimage", }, diff --git a/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go b/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go index a94a9151dbc..2e24ca66ceb 100644 --- a/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go +++ b/pkg/reconciler/pipelinerun/resources/conditionresolution_test.go @@ -203,7 +203,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "foo", Image: "ubuntu", }, @@ -211,7 +211,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, }, want: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "foo", Image: "ubuntu", }}}, @@ -224,7 +224,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "", Image: "ubuntu", }, @@ -232,7 +232,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, }, want: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "condition-check-bar", Image: "ubuntu", }}}, @@ -245,7 +245,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "", Image: "ubuntu", }, @@ -253,7 +253,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, }, want: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ // Shortened via: names.SimpleNameGenerator.RestrictLength Name: "condition-check-very-very-very-very-very-very-very-very-very-ve", Image: "ubuntu", @@ -267,7 +267,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "$(params.name)", Image: "$(params.img)", WorkingDir: "$(params.not.replaced)", @@ -286,7 +286,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, }, want: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "$(inputs.params.name)", Image: "$(inputs.params.img)", WorkingDir: "$(params.not.replaced)", @@ -307,7 +307,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "name", Image: "ubuntu", Args: []string{"$(resources.git-resource.revision)"}, @@ -334,7 +334,7 @@ func TestResolvedConditionCheck_ConditionToTaskSpec(t *testing.T) { }, }, want: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "name", Image: "ubuntu", Args: []string{"master"}, diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go index ad4da12b550..c16c97d554d 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunresolution_test.go @@ -140,7 +140,7 @@ var task = &v1beta1.Task{ Name: "task", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, }, @@ -627,7 +627,7 @@ var taskWithOptionalResourcesDeprecated = &v1beta1.Task{ Name: "task", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, Resources: &v1beta1.TaskResources{ @@ -657,7 +657,7 @@ var taskWithOptionalResources = &v1beta1.Task{ Name: "task", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, Resources: &v1beta1.TaskResources{ @@ -1795,7 +1795,7 @@ func TestResolvePipelineRun(t *testing.T) { TaskSpec: &v1beta1.EmbeddedTask{ TaskSpec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{Name: "step1"}, + Container: v1beta1.Container{Name: "step1"}, }}, }, }, diff --git a/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go b/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go index ffc8ddff6c7..a0abfa39b39 100644 --- a/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go +++ b/pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go @@ -894,7 +894,7 @@ func buildPipelineStateWithLargeDepencyGraph(t *testing.T) PipelineRunState { Name: "task", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, }, diff --git a/pkg/reconciler/taskrun/resources/apply_test.go b/pkg/reconciler/taskrun/resources/apply_test.go index 29c256969b6..0fc8c389eef 100644 --- a/pkg/reconciler/taskrun/resources/apply_test.go +++ b/pkg/reconciler/taskrun/resources/apply_test.go @@ -50,7 +50,7 @@ var ( simpleTaskSpec = &v1beta1.TaskSpec{ Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "foo", Image: `$(params["myimage"])`, Env: []corev1.EnvVar{{ @@ -59,37 +59,37 @@ var ( }}, }, }}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Env: []corev1.EnvVar{{ Name: "template-var", Value: `$(params["FOO"])`, }}, }, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "foo", Image: "$(params.myimage)", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "baz", Image: "bat", WorkingDir: "$(inputs.resources.workspace.path)", Args: []string{"$(inputs.resources.workspace.url)"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "qux", Image: "$(params.something)", Args: []string{"$(outputs.resources.imageToUse.url)"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "foo", Image: `$(params["myimage"])`, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "baz", Image: "$(params.somethingelse)", WorkingDir: "$(inputs.resources.workspace.path)", Args: []string{"$(inputs.resources.workspace.url)"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "qux", Image: "quux", Args: []string{"$(outputs.resources.imageToUse.url)"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "foo", Image: "busybox:$(params.FOO)", VolumeMounts: []corev1.VolumeMount{{ @@ -97,7 +97,7 @@ var ( MountPath: "path/to/$(params.FOO)", SubPath: "sub/$(params.FOO)/path", }}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "foo", Image: "busybox:$(params.FOO)", Env: []corev1.EnvVar{{ @@ -131,10 +131,10 @@ var ( LocalObjectReference: corev1.LocalObjectReference{Name: "secret-$(params.FOO)"}, }, }}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "outputs-resources-path-ab", Image: "$(outputs.resources.imageToUse-ab.path)", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "outputs-resources-path-re", Image: "$(outputs.resources.imageToUse-re.path)", }}}, @@ -224,7 +224,7 @@ var ( } gcsTaskSpec = &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "foobar", Image: "someImage", Args: []string{"$(outputs.resources.bucket.path)"}, @@ -239,10 +239,10 @@ var ( } arrayParamTaskSpec = &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "simple-image", Image: "some-image", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "image-with-c-specified", Image: "some-other-image", Command: []string{"echo"}, @@ -251,10 +251,10 @@ var ( } arrayAndStringParamTaskSpec = &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "simple-image", Image: "some-image", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "image-with-c-specified", Image: "some-other-image", Command: []string{"echo"}, @@ -263,10 +263,10 @@ var ( } multipleArrayParamsTaskSpec = &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "simple-image", Image: "some-image", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "image-with-c-specified", Image: "some-other-image", Command: []string{"cmd", "$(params.another-array-param)"}, @@ -275,10 +275,10 @@ var ( } multipleArrayAndStringsParamsTaskSpec = &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "simple-image", Image: "image-$(params.string-param2)", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "image-with-c-specified", Image: "some-other-image", Command: []string{"cmd", "$(params.array-param1)"}, @@ -641,7 +641,7 @@ func TestApplyResources(t *testing.T) { func TestApplyWorkspaces(t *testing.T) { names.TestingSeed() ts := &v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Env: []corev1.EnvVar{{ Name: "template-var", Value: "$(workspaces.myws.volume)", @@ -653,12 +653,12 @@ func TestApplyWorkspaces(t *testing.T) { Value: "$(workspaces.otherws.claim)", }}, }, - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "$(workspaces.myws.volume)", Image: "$(workspaces.otherws.volume)", WorkingDir: "$(workspaces.otherws.volume)", Args: []string{"$(workspaces.myws.path)"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "foo", Image: "bar", VolumeMounts: []corev1.VolumeMount{{ @@ -666,7 +666,7 @@ func TestApplyWorkspaces(t *testing.T) { MountPath: "path/to/$(workspaces.otherws.path)", SubPath: "$(workspaces.myws.volume)", }}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "foo", Image: "bar", Env: []corev1.EnvVar{{ @@ -886,7 +886,7 @@ func TestContext(t *testing.T) { tr: v1beta1.TaskRun{}, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.task.name)-1", }, @@ -894,7 +894,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "Task1-1", }, @@ -910,7 +910,7 @@ func TestContext(t *testing.T) { }, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.task.name)-1", }, @@ -918,7 +918,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "Task1-1", }, @@ -934,7 +934,7 @@ func TestContext(t *testing.T) { }, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.taskRun.name)-1", }, @@ -942,7 +942,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "taskrunName-1", }, @@ -954,7 +954,7 @@ func TestContext(t *testing.T) { tr: v1beta1.TaskRun{}, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.taskRun.name)-1", }, @@ -962,7 +962,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "-1", }, @@ -974,7 +974,7 @@ func TestContext(t *testing.T) { tr: v1beta1.TaskRun{}, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.taskRun.namespace)-1", }, @@ -982,7 +982,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "-1", }, @@ -999,7 +999,7 @@ func TestContext(t *testing.T) { }, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.taskRun.namespace)-1", }, @@ -1007,7 +1007,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "trNamespace-1", }, @@ -1018,7 +1018,7 @@ func TestContext(t *testing.T) { tr: v1beta1.TaskRun{}, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.task.name)-1", }, @@ -1026,7 +1026,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "-1", }, @@ -1042,7 +1042,7 @@ func TestContext(t *testing.T) { }, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.taskRun.uid)", }, @@ -1050,7 +1050,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "UID-1", }, @@ -1081,7 +1081,7 @@ func TestContext(t *testing.T) { }, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.task.retry-count)-1", }, @@ -1089,7 +1089,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "2-1", }, @@ -1100,7 +1100,7 @@ func TestContext(t *testing.T) { tr: v1beta1.TaskRun{}, spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "$(context.task.retry-count)-1", }, @@ -1108,7 +1108,7 @@ func TestContext(t *testing.T) { }, want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "ImageName", Image: "0-1", }, @@ -1135,20 +1135,20 @@ func TestTaskResults(t *testing.T) { Description: "The current date in humand readable format"}, }, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "print-date-unix-timestamp", Image: "bash:latest", Args: []string{"$(results[\"current.date.unix.timestamp\"].path)"}, }, Script: "#!/usr/bin/env bash\ndate +%s | tee $(results[\"current.date.unix.timestamp\"].path)", }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "print-date-human-readable", Image: "bash:latest", }, Script: "#!/usr/bin/env bash\ndate | tee $(results.current-date-human-readable.path)", }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "print-date-human-readable-again", Image: "bash:latest", }, @@ -1171,18 +1171,18 @@ func TestApplyStepExitCodePath(t *testing.T) { names.TestingSeed() ts := &v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "bash:latest", }, Script: "#!/usr/bin/env bash\nexit 11", }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "failing-step", Image: "bash:latest", }, Script: "#!/usr/bin/env bash\ncat $(steps.step-unnamed-0.exitCode.path)", }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "check-failing-step", Image: "bash:latest", }, @@ -1209,7 +1209,7 @@ func TestApplyCredentialsPath(t *testing.T) { description: "replacement in spec container", spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Command: []string{"cp"}, Args: []string{"-R", "$(credentials.path)/", "$HOME"}, }, @@ -1218,7 +1218,7 @@ func TestApplyCredentialsPath(t *testing.T) { path: "/tekton/creds", want: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Command: []string{"cp"}, Args: []string{"-R", "/tekton/creds/", "$HOME"}, }, diff --git a/pkg/reconciler/taskrun/resources/image_exporter.go b/pkg/reconciler/taskrun/resources/image_exporter.go index 8634378cb36..bd2bed58be7 100644 --- a/pkg/reconciler/taskrun/resources/image_exporter.go +++ b/pkg/reconciler/taskrun/resources/image_exporter.go @@ -24,7 +24,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/image" "github.com/tektoncd/pipeline/pkg/names" - corev1 "k8s.io/api/core/v1" ) const imageDigestExporterContainerName = "image-digest-exporter" @@ -91,7 +90,7 @@ func AddOutputImageDigestExporter( } func imageDigestExporterStep(imageDigestExporterImage string, imagesJSON []byte) v1beta1.Step { - return v1beta1.Step{Container: corev1.Container{ + return v1beta1.Step{Container: v1beta1.Container{ Name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(imageDigestExporterContainerName), Image: imageDigestExporterImage, Command: []string{"/ko-app/imagedigestexporter"}, diff --git a/pkg/reconciler/taskrun/resources/image_exporter_test.go b/pkg/reconciler/taskrun/resources/image_exporter_test.go index f90cea50988..d68bc9bccda 100644 --- a/pkg/reconciler/taskrun/resources/image_exporter_test.go +++ b/pkg/reconciler/taskrun/resources/image_exporter_test.go @@ -24,7 +24,6 @@ import ( resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" "github.com/tektoncd/pipeline/test/diff" "github.com/tektoncd/pipeline/test/names" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -42,7 +41,7 @@ func TestAddOutputImageDigestExporter(t *testing.T) { Namespace: "marshmallow", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, Resources: &v1beta1.TaskResources{ @@ -87,9 +86,9 @@ func TestAddOutputImageDigestExporter(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "image-digest-exporter-9l9zj", Image: "override-with-imagedigest-exporter-image:latest", Command: []string{"/ko-app/imagedigestexporter"}, @@ -103,9 +102,9 @@ func TestAddOutputImageDigestExporter(t *testing.T) { Namespace: "marshmallow", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "step2", }}}, Resources: &v1beta1.TaskResources{ @@ -150,11 +149,11 @@ func TestAddOutputImageDigestExporter(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "step2", - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "image-digest-exporter-9l9zj", Image: "override-with-imagedigest-exporter-image:latest", Command: []string{"/ko-app/imagedigestexporter"}, diff --git a/pkg/reconciler/taskrun/resources/input_resource_test.go b/pkg/reconciler/taskrun/resources/input_resource_test.go index 6a7751d85cc..ebff484ccbf 100644 --- a/pkg/reconciler/taskrun/resources/input_resource_test.go +++ b/pkg/reconciler/taskrun/resources/input_resource_test.go @@ -363,7 +363,7 @@ func TestAddInputResourceToTask(t *testing.T) { taskRun: taskRun, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -405,7 +405,7 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -454,7 +454,7 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-with-branch-mz4c7", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -465,7 +465,7 @@ func TestAddInputResourceToTask(t *testing.T) { {Name: "HOME", Value: pipeline.HomeDir}, }, SecurityContext: gitResourceSecurityContext, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -507,7 +507,7 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -549,7 +549,7 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -593,11 +593,11 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-gitspace-mz4c7", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gitspace"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-copy-gitspace-9l9zj", Image: "busybox", Command: []string{"cp", "-r", "prev-task-path/.", "/workspace/gitspace"}, @@ -640,7 +640,7 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-with-sslVerify-false-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -679,7 +679,7 @@ func TestAddInputResourceToTask(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-storage1-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-dir"}, @@ -691,7 +691,7 @@ if [[ "${GOOGLE_APPLICATION_CREDENTIALS}" != "" ]]; then fi gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir `, - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "fetch-storage1-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Env: []corev1.EnvVar{{ @@ -732,11 +732,11 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-workspace-mz4c7", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-dir"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-copy-workspace-9l9zj", Image: "busybox", Command: []string{"cp", "-r", "prev-task-path/.", "/workspace/gcs-dir"}, @@ -857,7 +857,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir want: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "kubeconfig-9l9zj", Image: "override-with-kubeconfig-writer:latest", Command: []string{"/ko-app/kubeconfigwriter"}, @@ -912,7 +912,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir want: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "kubeconfig-9l9zj", Image: "override-with-kubeconfig-writer:latest", Command: []string{"/ko-app/kubeconfigwriter"}, @@ -965,7 +965,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-dir }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "git-source-the-git-with-branch-9l9zj", Image: "override-with-git:latest", Command: []string{"/ko-app/git-init"}, @@ -1085,7 +1085,7 @@ func TestStorageInputResource(t *testing.T) { }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-gcs-input-resource-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-input-resource"}, @@ -1097,7 +1097,7 @@ if [[ "${GOOGLE_APPLICATION_CREDENTIALS}" != "" ]]; then fi gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource `, - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "fetch-gcs-input-resource-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Env: []corev1.EnvVar{{Name: "HOME", Value: pipeline.HomeDir}}, @@ -1156,7 +1156,7 @@ gsutil cp gs://fake-bucket/rules.zip /workspace/gcs-input-resource }, wantErr: false, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-storage-gcs-keys-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-input-resource"}, @@ -1168,7 +1168,7 @@ if [[ "${GOOGLE_APPLICATION_CREDENTIALS}" != "" ]]; then fi gsutil rsync -d -r gs://fake-bucket/rules.zip /workspace/gcs-input-resource `, - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "fetch-storage-gcs-keys-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: []corev1.VolumeMount{ @@ -1320,11 +1320,11 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }, }, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "artifact-dest-mkdir-gitspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gitspace"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-copy-from-gitspace-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1364,11 +1364,11 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }, }, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "artifact-dest-mkdir-workspace-mssqb", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-dir"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-copy-from-workspace-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1416,22 +1416,22 @@ func TestAddStepsToTaskWithBucketFromConfigMap(t *testing.T) { }, }, want: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "artifact-dest-mkdir-workspace-vr6ds", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-dir"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-copy-from-workspace-l22wn", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, Args: []string{"cp", "-P", "-r", "gs://fake-bucket/prev-task-path/*", "/workspace/gcs-dir"}, Env: gcsEnv, VolumeMounts: gcsVolumeMounts, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-dest-mkdir-workspace2-6nl7g", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/gcs-dir"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-copy-from-workspace2-j2tds", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, diff --git a/pkg/reconciler/taskrun/resources/output_resource_test.go b/pkg/reconciler/taskrun/resources/output_resource_test.go index 165fa7da7d4..01f90f88db9 100644 --- a/pkg/reconciler/taskrun/resources/output_resource_test.go +++ b/pkg/reconciler/taskrun/resources/output_resource_test.go @@ -220,11 +220,11 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-mkdir-source-git-mz4c7", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -235,7 +235,7 @@ func TestValidOutputResources(t *testing.T) { Name: "pipelinerun-pvc", MountPath: "/pvc", }}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-copy-source-git-mssqb", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -300,11 +300,11 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-mkdir-source-git-mz4c7", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -315,7 +315,7 @@ func TestValidOutputResources(t *testing.T) { Name: "pipelinerun-pvc", MountPath: "/pvc", }}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "source-copy-source-git-mssqb", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -380,7 +380,7 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, @@ -422,7 +422,7 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, @@ -483,12 +483,12 @@ func TestValidOutputResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "source-mkdir-source-gcs-mz4c7", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -497,7 +497,7 @@ func TestValidOutputResources(t *testing.T) { Command: []string{"mkdir", "-p", "pipeline-task-path"}, VolumeMounts: []corev1.VolumeMount{{Name: "pipelinerun-parent-pvc", MountPath: "/pvc"}}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "source-copy-source-gcs-mssqb", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -509,7 +509,7 @@ func TestValidOutputResources(t *testing.T) { {Name: "TEKTON_RESOURCE_NAME", Value: "source-gcs"}, }, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: []corev1.VolumeMount{{ @@ -583,12 +583,12 @@ func TestValidOutputResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "source-mkdir-source-gcs-mz4c7", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -597,7 +597,7 @@ func TestValidOutputResources(t *testing.T) { Command: []string{"mkdir", "-p", "pipeline-task-path"}, VolumeMounts: []corev1.VolumeMount{{Name: "pipelinerun-pvc", MountPath: "/pvc"}}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "source-copy-source-gcs-mssqb", Image: "busybox", SecurityContext: &corev1.SecurityContext{ @@ -609,7 +609,7 @@ func TestValidOutputResources(t *testing.T) { {Name: "TEKTON_RESOURCE_NAME", Value: "source-gcs"}, }, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: []corev1.VolumeMount{{ @@ -676,12 +676,12 @@ func TestValidOutputResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: []corev1.VolumeMount{{ @@ -738,12 +738,12 @@ func TestValidOutputResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: []corev1.VolumeMount{{ @@ -803,7 +803,7 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, @@ -849,7 +849,7 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace"}, @@ -889,7 +889,7 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, @@ -940,11 +940,11 @@ func TestValidOutputResources(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-1-mz4c7", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace-1"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, @@ -1032,11 +1032,11 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-copy-to-source-git-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1083,11 +1083,11 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "artifact-copy-to-source-git-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1129,7 +1129,7 @@ func TestValidOutputResourcesWithBucketStorage(t *testing.T) { }, }, }, - wantSteps: []v1beta1.Step{{Container: corev1.Container{ + wantSteps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, @@ -1473,18 +1473,18 @@ func TestInputOutputBucketResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-mssqb", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "artifact-dest-mkdir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/faraway-disk"}, VolumeMounts: nil, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "artifact-copy-from-source-workspace-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1501,7 +1501,7 @@ func TestInputOutputBucketResources(t *testing.T) { }}, VolumeMounts: []corev1.VolumeMount{{Name: "volume-bucket-sname", MountPath: "/var/bucketsecret/sname"}}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-bucket-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: nil, @@ -1588,18 +1588,18 @@ func TestInputOutputBucketResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-3-6nl7g", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace-3"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "artifact-dest-mkdir-source-workspace-mssqb", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/faraway-disk"}, VolumeMounts: nil, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "artifact-copy-from-source-workspace-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1618,14 +1618,14 @@ func TestInputOutputBucketResources(t *testing.T) { }, VolumeMounts: []corev1.VolumeMount{{Name: "volume-bucket-sname", MountPath: "/var/bucketsecret/sname"}}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "artifact-dest-mkdir-source-workspace-2-9l9zj", Image: "busybox", VolumeMounts: nil, Command: []string{"mkdir", "-p", "/workspace/faraway-disk-2"}, Env: nil, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "artifact-copy-from-source-workspace-2-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1637,7 +1637,7 @@ func TestInputOutputBucketResources(t *testing.T) { }, }, VolumeMounts: []corev1.VolumeMount{{Name: "volume-bucket-sname", MountPath: "/var/bucketsecret/sname"}}, - }}, {Container: corev1.Container{ + }}, {Container: v1beta1.Container{ Name: "upload-source-gcs-bucket-3-j2tds", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1707,18 +1707,18 @@ func TestInputOutputBucketResources(t *testing.T) { }, }, wantSteps: []v1beta1.Step{ - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-2-mssqb", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace-2"}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "create-dir-source-workspace-9l9zj", Image: "busybox", Command: []string{"mkdir", "-p", "/workspace/output/source-workspace"}, VolumeMounts: nil, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-bucket-mz4c7", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", Command: []string{"gsutil"}, @@ -1734,7 +1734,7 @@ func TestInputOutputBucketResources(t *testing.T) { Value: pipeline.HomeDir, }}, }}, - {Container: corev1.Container{ + {Container: v1beta1.Container{ Name: "upload-source-gcs-bucket-2-78c5n", Image: "gcr.io/google.com/cloudsdktool/cloud-sdk", VolumeMounts: nil, diff --git a/pkg/reconciler/taskrun/resources/taskref_test.go b/pkg/reconciler/taskrun/resources/taskref_test.go index 8f06538288f..b7d938f76a7 100644 --- a/pkg/reconciler/taskrun/resources/taskref_test.go +++ b/pkg/reconciler/taskrun/resources/taskref_test.go @@ -51,7 +51,7 @@ var ( }, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "something", }, }}, @@ -67,7 +67,7 @@ var ( }, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "something", }, }}, @@ -252,7 +252,7 @@ func TestGetTaskFunc(t *testing.T) { }, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "something", }, }}, @@ -277,7 +277,7 @@ func TestGetTaskFunc(t *testing.T) { }, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "something", }, }}, @@ -307,7 +307,7 @@ func TestGetTaskFunc(t *testing.T) { Name: "foo", }}, Steps: []v1alpha1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "something", }, }}, @@ -326,7 +326,7 @@ func TestGetTaskFunc(t *testing.T) { }, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "something", }, }}, @@ -460,7 +460,7 @@ func TestGetTaskFuncFromTaskRunSpecAlreadyFetched(t *testing.T) { name := "anyname-really" TaskSpec := v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", }, Script: ` diff --git a/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go b/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go index ab608daa669..0edc58ffac1 100644 --- a/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go +++ b/pkg/reconciler/taskrun/resources/taskresourceresolution_test.go @@ -22,7 +22,6 @@ import ( "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" - corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -77,7 +76,7 @@ func TestResolveTaskRun(t *testing.T) { taskName := "orchestrate" kind := v1beta1.NamespacedTaskKind taskSpec := v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}, }} @@ -207,7 +206,7 @@ func TestResolveTaskRun_missingInput(t *testing.T) { func TestResolveTaskRun_noResources(t *testing.T) { taskSpec := v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}, }} diff --git a/pkg/reconciler/taskrun/resources/taskspec_test.go b/pkg/reconciler/taskrun/resources/taskspec_test.go index 1f8f9450aec..06ff2e361f0 100644 --- a/pkg/reconciler/taskrun/resources/taskspec_test.go +++ b/pkg/reconciler/taskrun/resources/taskspec_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -32,7 +31,7 @@ func TestGetTaskSpec_Ref(t *testing.T) { Name: "orchestrate", }, Spec: v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, }, @@ -70,7 +69,7 @@ func TestGetTaskSpec_Embedded(t *testing.T) { }, Spec: v1beta1.TaskRunSpec{ TaskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Name: "step1", }}}, }, diff --git a/pkg/reconciler/taskrun/taskrun_test.go b/pkg/reconciler/taskrun/taskrun_test.go index 9927a2fd281..8c6b033c4af 100644 --- a/pkg/reconciler/taskrun/taskrun_test.go +++ b/pkg/reconciler/taskrun/taskrun_test.go @@ -112,7 +112,7 @@ var ( cloudEventTarget2 = "https://bar" simpleStep = v1beta1.Step{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "simple-step", Image: "foo", Command: []string{"/mycmd"}, @@ -145,7 +145,7 @@ var ( ObjectMeta: objectMeta("test-task-sidecar", "foo"), Spec: v1beta1.TaskSpec{ Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sidecar", Image: "image-id", }, @@ -157,13 +157,13 @@ var ( Spec: v1beta1.TaskSpec{ Sidecars: []v1beta1.Sidecar{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sidecar", Image: "image-id", }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sidecar2", Image: "image-id", }, @@ -205,7 +205,7 @@ var ( ObjectMeta: objectMeta("test-with-sa", "foo"), Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "sa-step", Image: "foo", Command: []string{"/mycmd"}, @@ -253,7 +253,7 @@ var ( }, Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Name: "mycontainer", Command: []string{"/mycmd"}, @@ -268,7 +268,7 @@ var ( }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myotherimage", Name: "myothercontainer", Command: []string{"/mycmd"}, @@ -3823,12 +3823,12 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { taskSpec: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{ { - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, }, }}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("4"), @@ -3840,7 +3840,7 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { }, { name: "no limit configured", taskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, Resources: corev1.ResourceRequirements{ @@ -3854,7 +3854,7 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { }, { name: "request less or equal than step limit but larger than steptemplate limit", taskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, Resources: corev1.ResourceRequirements{ @@ -3868,7 +3868,7 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { }, }, }}}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("4"), @@ -3880,7 +3880,7 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { }, { name: "request less or equal than step limit", taskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, Resources: corev1.ResourceRequirements{ @@ -3898,7 +3898,7 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { }, { name: "request less or equal than steptemplate limit", taskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, Resources: corev1.ResourceRequirements{ @@ -3908,7 +3908,7 @@ func Test_validateTaskSpecRequestResources_ValidResources(t *testing.T) { }, }, }}}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("8"), @@ -3937,7 +3937,7 @@ func Test_validateTaskSpecRequestResources_InvalidResources(t *testing.T) { }{{ name: "step request larger than step limit", taskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, Resources: corev1.ResourceRequirements{ @@ -3954,7 +3954,7 @@ func Test_validateTaskSpecRequestResources_InvalidResources(t *testing.T) { }, { name: "step request larger than steptemplate limit", taskSpec: &v1beta1.TaskSpec{ - Steps: []v1beta1.Step{{Container: corev1.Container{ + Steps: []v1beta1.Step{{Container: v1beta1.Container{ Image: "image", Command: []string{"cmd"}, Resources: corev1.ResourceRequirements{ @@ -3964,7 +3964,7 @@ func Test_validateTaskSpecRequestResources_InvalidResources(t *testing.T) { }, }, }}}, - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("8"), diff --git a/pkg/reconciler/taskrun/validate_resources_test.go b/pkg/reconciler/taskrun/validate_resources_test.go index c5e84be8338..4b9fb937c4b 100644 --- a/pkg/reconciler/taskrun/validate_resources_test.go +++ b/pkg/reconciler/taskrun/validate_resources_test.go @@ -21,7 +21,6 @@ import ( "testing" "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/tektoncd/pipeline/pkg/apis/config" @@ -38,7 +37,7 @@ func TestValidateResolvedTaskResources_ValidResources(t *testing.T) { }, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Command: []string{"mycmd"}, }, @@ -129,7 +128,7 @@ func TestValidateResolvedTaskResources_ValidParams(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Command: []string{"mycmd"}, }, @@ -178,7 +177,7 @@ func TestValidateResolvedTaskResources_InvalidParams(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Spec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Image: "myimage", Command: []string{"mycmd"}, }, @@ -432,11 +431,11 @@ func TestValidateOverrides(t *testing.T) { name: "valid stepOverrides", ts: &v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "step1", }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "step2", }, }}, @@ -450,11 +449,11 @@ func TestValidateOverrides(t *testing.T) { name: "valid sidecarOverrides", ts: &v1beta1.TaskSpec{ Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "step1", }, }, { - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "step2", }, }}, diff --git a/pkg/workspace/apply.go b/pkg/workspace/apply.go index 21d173ba76a..a0f1031cc63 100644 --- a/pkg/workspace/apply.go +++ b/pkg/workspace/apply.go @@ -98,7 +98,7 @@ func Apply(ctx context.Context, ts v1beta1.TaskSpec, wb []v1beta1.WorkspaceBindi // Initialize StepTemplate if it hasn't been already if ts.StepTemplate == nil { - ts.StepTemplate = &corev1.Container{} + ts.StepTemplate = &v1beta1.Container{} } isolatedWorkspaces := sets.NewString() diff --git a/pkg/workspace/apply_test.go b/pkg/workspace/apply_test.go index 6fcaa3a03b6..8ef1adc6989 100644 --- a/pkg/workspace/apply_test.go +++ b/pkg/workspace/apply_test.go @@ -217,7 +217,7 @@ func TestApply(t *testing.T) { SubPath: "/foo/bar/baz", }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-9l9zj", MountPath: "/workspace/custom", @@ -251,7 +251,7 @@ func TestApply(t *testing.T) { SubPath: "/foo/bar/baz", }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-mz4c7", MountPath: "/workspace/custom", @@ -273,7 +273,7 @@ func TestApply(t *testing.T) { }, { name: "task spec already has volumes and stepTemplate", ts: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "awesome-volume", MountPath: "/", @@ -297,7 +297,7 @@ func TestApply(t *testing.T) { SubPath: "/foo/bar/baz", }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "awesome-volume", MountPath: "/", @@ -328,14 +328,14 @@ func TestApply(t *testing.T) { name: "0 workspace bindings", ts: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "foo", }}}, }, workspaces: []v1beta1.WorkspaceBinding{}, expectedTaskSpec: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "foo", }}}, }, @@ -361,7 +361,7 @@ func TestApply(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-78c5n", MountPath: "/workspace/custom", @@ -415,7 +415,7 @@ func TestApply(t *testing.T) { SubPath: "/very/professional/work/space", }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-j2tds", MountPath: "/workspace/custom", @@ -455,7 +455,7 @@ func TestApply(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-l22wn", MountPath: "/my/fancy/mount/path", @@ -490,7 +490,7 @@ func TestApply(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-twkr2", MountPath: "/my/fancy/mount/path", @@ -540,7 +540,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { Name: "source", }}, }}, - Sidecars: []v1beta1.Sidecar{{Container: corev1.Container{Name: "foo"}}}, + Sidecars: []v1beta1.Sidecar{{Container: v1beta1.Container{Name: "foo"}}}, Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "source", }}, @@ -552,7 +552,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{}, + StepTemplate: &v1beta1.Container{}, Volumes: []corev1.Volume{{ Name: "ws-9l9zj", VolumeSource: corev1.VolumeSource{ @@ -562,7 +562,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-9l9zj", MountPath: "/workspace/source", @@ -572,7 +572,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { Name: "source", }}, }}, - Sidecars: []v1beta1.Sidecar{{Container: corev1.Container{Name: "foo"}}}, + Sidecars: []v1beta1.Sidecar{{Container: v1beta1.Container{Name: "foo"}}}, Workspaces: []v1beta1.WorkspaceDeclaration{{ Name: "source", }}, @@ -581,7 +581,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { name: "workspace isolated to sidecar does not appear in steps", ts: v1beta1.TaskSpec{ Steps: []v1beta1.Step{{ - Container: corev1.Container{Name: "step1"}, + Container: v1beta1.Container{Name: "step1"}, }}, Sidecars: []v1beta1.Sidecar{{ Workspaces: []v1beta1.WorkspaceUsage{{ @@ -599,7 +599,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{}, + StepTemplate: &v1beta1.Container{}, Volumes: []corev1.Volume{{ Name: "ws-mz4c7", VolumeSource: corev1.VolumeSource{ @@ -609,10 +609,10 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{Name: "step1"}, + Container: v1beta1.Container{Name: "step1"}, }}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-mz4c7", MountPath: "/workspace/source", @@ -634,7 +634,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { Name: "source", }}, }, { - Container: corev1.Container{Name: "step2"}, + Container: v1beta1.Container{Name: "step2"}, }}, Sidecars: []v1beta1.Sidecar{{ Workspaces: []v1beta1.WorkspaceUsage{{ @@ -652,7 +652,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{}, + StepTemplate: &v1beta1.Container{}, Volumes: []corev1.Volume{{ Name: "ws-mssqb", VolumeSource: corev1.VolumeSource{ @@ -662,7 +662,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, Steps: []v1beta1.Step{{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-mssqb", MountPath: "/workspace/source", @@ -672,10 +672,10 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { Name: "source", }}, }, { - Container: corev1.Container{Name: "step2"}, + Container: v1beta1.Container{Name: "step2"}, }}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-mssqb", MountPath: "/workspace/source", @@ -705,7 +705,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-78c5n", MountPath: "/workspace/source", }}, @@ -720,7 +720,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }}, Steps: []v1beta1.Step{{}}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-78c5n", MountPath: "/workspace/source", @@ -757,7 +757,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{}, + StepTemplate: &v1beta1.Container{}, Volumes: []corev1.Volume{{ Name: "ws-6nl7g", VolumeSource: corev1.VolumeSource{ @@ -771,7 +771,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { Name: "source", MountPath: "/foo", }}, - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-6nl7g", MountPath: "/foo", @@ -783,7 +783,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { Name: "source", MountPath: "/bar", }}, - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-6nl7g", MountPath: "/bar", @@ -803,7 +803,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { ReadOnly: true, }}, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "conflicting volume mount sidecar", VolumeMounts: []corev1.VolumeMount{{ Name: "mount-path-conflicts", @@ -819,7 +819,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }, }}, expectedTaskSpec: v1beta1.TaskSpec{ - StepTemplate: &corev1.Container{ + StepTemplate: &v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "ws-j2tds", MountPath: "/my/fancy/mount/path", @@ -827,7 +827,7 @@ func TestApply_IsolatedWorkspaces(t *testing.T) { }}, }, Sidecars: []v1beta1.Sidecar{{ - Container: corev1.Container{ + Container: v1beta1.Container{ Name: "conflicting volume mount sidecar", VolumeMounts: []corev1.VolumeMount{{ Name: "mount-path-conflicts", @@ -901,7 +901,7 @@ func TestAddSidecarVolumeMount(t *testing.T) { MountPath: "/workspace/foo", }, expectedSidecar: v1beta1.Sidecar{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "foo", MountPath: "/workspace/foo", @@ -915,7 +915,7 @@ func TestAddSidecarVolumeMount(t *testing.T) { MountPath: "/workspace/foo", }, expectedSidecar: v1beta1.Sidecar{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "foo", MountPath: "/workspace/foo", @@ -932,7 +932,7 @@ func TestAddSidecarVolumeMount(t *testing.T) { MountPath: "/workspace/bar", }, expectedSidecar: v1beta1.Sidecar{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "bar", MountPath: "/workspace/bar", @@ -949,7 +949,7 @@ func TestAddSidecarVolumeMount(t *testing.T) { MountPath: "/workspace/foo", }, expectedSidecar: v1beta1.Sidecar{ - Container: corev1.Container{ + Container: v1beta1.Container{ VolumeMounts: []corev1.VolumeMount{{ Name: "bar", MountPath: "/workspace/bar", diff --git a/test/pipelinerun_test.go b/test/pipelinerun_test.go index d9c35d21cc4..a7f7a2b87dd 100644 --- a/test/pipelinerun_test.go +++ b/test/pipelinerun_test.go @@ -899,7 +899,7 @@ func getFailingCondition() *v1alpha1.Condition { }, Spec: v1alpha1.ConditionSpec{ Check: v1alpha1.Step{ - Container: corev1.Container{ + Container: v1alpha1.Container{ Image: "ubuntu", Command: []string{"/bin/bash"}, Args: []string{"exit 1"}, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 431bf47ddc4..71037169c40 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v62.0.0" +const Number = "v63.3.0" diff --git a/vendor/modules.txt b/vendor/modules.txt index 011cfa8ecf0..efbded65b5f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,7 +7,7 @@ contrib.go.opencensus.io/exporter/ocagent # contrib.go.opencensus.io/exporter/prometheus v0.4.0 ## explicit; go 1.13 contrib.go.opencensus.io/exporter/prometheus -# github.com/Azure/azure-sdk-for-go v62.0.0+incompatible +# github.com/Azure/azure-sdk-for-go v63.3.0+incompatible ## explicit github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry github.com/Azure/azure-sdk-for-go/version