From df74d869ef4f5bc09226da07d014ce873e83f3b0 Mon Sep 17 00:00:00 2001 From: Alex DiCarlo Date: Wed, 3 Apr 2019 06:11:10 -0700 Subject: [PATCH] Remove nop container and binary --- cmd/nop/kodata/HEAD | 1 - cmd/nop/kodata/LICENSE | 1 - cmd/nop/kodata/VENDOR-LICENSE | 1 - cmd/nop/main.go | 23 ------------------- config/controller.yaml | 1 - .../v1alpha1/taskrun/resources/pod.go | 5 ---- .../v1alpha1/taskrun/resources/pod_test.go | 9 -------- .../v1alpha1/taskrun/taskrun_test.go | 8 ------- tekton/koparse/test_koparse.py | 2 -- tekton/koparse/test_release.yaml | 2 -- tekton/publish-run.yaml | 13 ----------- test/builder/pod_test.go | 6 ++--- 12 files changed, 3 insertions(+), 69 deletions(-) delete mode 120000 cmd/nop/kodata/HEAD delete mode 120000 cmd/nop/kodata/LICENSE delete mode 120000 cmd/nop/kodata/VENDOR-LICENSE delete mode 100644 cmd/nop/main.go diff --git a/cmd/nop/kodata/HEAD b/cmd/nop/kodata/HEAD deleted file mode 120000 index 8f63681d362..00000000000 --- a/cmd/nop/kodata/HEAD +++ /dev/null @@ -1 +0,0 @@ -../../../.git/HEAD \ No newline at end of file diff --git a/cmd/nop/kodata/LICENSE b/cmd/nop/kodata/LICENSE deleted file mode 120000 index 5853aaea53b..00000000000 --- a/cmd/nop/kodata/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../../LICENSE \ No newline at end of file diff --git a/cmd/nop/kodata/VENDOR-LICENSE b/cmd/nop/kodata/VENDOR-LICENSE deleted file mode 120000 index 3cc89764519..00000000000 --- a/cmd/nop/kodata/VENDOR-LICENSE +++ /dev/null @@ -1 +0,0 @@ -../../../third_party/VENDOR-LICENSE \ No newline at end of file diff --git a/cmd/nop/main.go b/cmd/nop/main.go deleted file mode 100644 index 31343ae727c..00000000000 --- a/cmd/nop/main.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 The Knative Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import "fmt" - -func main() { - fmt.Println("Build successful") -} diff --git a/config/controller.yaml b/config/controller.yaml index fb85f479922..a4e32bbd45f 100644 --- a/config/controller.yaml +++ b/config/controller.yaml @@ -33,7 +33,6 @@ spec: "-kubeconfig-writer-image", "github.com/tektoncd/pipeline/cmd/kubeconfigwriter", "-creds-image", "github.com/tektoncd/pipeline/cmd/creds-init", "-git-image", "github.com/tektoncd/pipeline/cmd/git-init", - "-nop-image", "github.com/tektoncd/pipeline/cmd/nop", "-bash-noop-image", "github.com/tektoncd/pipeline/cmd/bash", "-gsutil-image","github.com/tektoncd/pipeline/cmd/gsutil", "-entrypoint-image", "github.com/tektoncd/pipeline/cmd/entrypoint", diff --git a/pkg/reconciler/v1alpha1/taskrun/resources/pod.go b/pkg/reconciler/v1alpha1/taskrun/resources/pod.go index f6ca4a9cecf..a379aedc5d0 100644 --- a/pkg/reconciler/v1alpha1/taskrun/resources/pod.go +++ b/pkg/reconciler/v1alpha1/taskrun/resources/pod.go @@ -92,9 +92,6 @@ var ( // The container used to initialize credentials before the build runs. credsImage = flag.String("creds-image", "override-with-creds:latest", "The container image for preparing our Build's credentials.") - // The container that just prints build successful. - nopImage = flag.String("nop-image", "override-with-nop:latest", - "The container image run at the end of the build to log build success") ) func makeCredentialInitializer(serviceAccountName, namespace string, kubeclient kubernetes.Interface) (*corev1.Container, []corev1.Volume, error) { @@ -220,8 +217,6 @@ func MakePod(taskRun *v1alpha1.TaskRun, taskSpec v1alpha1.TaskSpec, kubeclient k } gibberish := hex.EncodeToString(b) - podContainers = append(podContainers, corev1.Container{Name: "nop", Image: *nopImage, Command: []string{"/ko-app/nop"}}) - return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ // We execute the build's pod in the same namespace as where the build was diff --git a/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go b/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go index 3c67598d40f..2b0eec4b890 100644 --- a/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go +++ b/pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go @@ -34,11 +34,6 @@ import ( var ( ignorePrivateResourceFields = cmpopts.IgnoreUnexported(resource.Quantity{}) - nopContainer = corev1.Container{ - Name: "nop", - Image: *nopImage, - Command: []string{"/ko-app/nop"}, - } ) func TestMakePod(t *testing.T) { @@ -105,7 +100,6 @@ func TestMakePod(t *testing.T) { VolumeMounts: implicitVolumeMounts, WorkingDir: workspaceDir, }, - nopContainer, }, Volumes: implicitVolumes, }, @@ -144,7 +138,6 @@ func TestMakePod(t *testing.T) { VolumeMounts: implicitVolumeMounts, WorkingDir: workspaceDir, }, - nopContainer, }, Volumes: implicitVolumesWithSecrets, }, @@ -177,7 +170,6 @@ func TestMakePod(t *testing.T) { VolumeMounts: implicitVolumeMounts, WorkingDir: workspaceDir, }, - nopContainer, }, Volumes: implicitVolumes, }, @@ -210,7 +202,6 @@ func TestMakePod(t *testing.T) { VolumeMounts: implicitVolumeMounts, WorkingDir: workspaceDir, }, - nopContainer, }, Volumes: implicitVolumes, }, diff --git a/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go b/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go index 320e774a908..f74eb537bbd 100644 --- a/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go +++ b/pkg/reconciler/v1alpha1/taskrun/taskrun_test.go @@ -312,7 +312,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -339,7 +338,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -393,7 +391,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -491,7 +488,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -527,7 +523,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -553,7 +548,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -589,7 +583,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }, { @@ -616,7 +609,6 @@ func TestReconcile(t *testing.T) { tb.VolumeMount("workspace", workspaceDir), tb.VolumeMount("home", "/builder/home"), ), - tb.PodContainer("nop", "override-with-nop:latest", tb.Command("/ko-app/nop")), ), ), }} { diff --git a/tekton/koparse/test_koparse.py b/tekton/koparse/test_koparse.py index 867082c0ee8..54c0fda8822 100755 --- a/tekton/koparse/test_koparse.py +++ b/tekton/koparse/test_koparse.py @@ -15,7 +15,6 @@ "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/kubeconfigwriter@sha256:68453f5bb4b76c0eab98964754114d4f79d3a50413872520d8919a6786ea2b35", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/creds-init@sha256:67448da79e4731ab534b91df08da547bc434ab08e41d905858f2244e70290f48", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/git-init@sha256:7d5520efa2d55e1346c424797988c541327ee52ef810a840b5c6f278a9de934a", - "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/nop@sha256:3784d6b8f73043a29d2c1d6196801bee46fe808fbb94ba4fd21ca52dce503183", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/bash@sha256:d55917ef5c92627027e3755bfc577fbfa2fb783cccfb13a98632cb6ba6088cd6", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/gsutil@sha256:421a261436e16af4057b4a069fdae8a5aca6e37269952209ad9932a774aa0003", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/controller@sha256:bdc6f22a44944c829983c30213091b60f490b41f89577e8492f6a2936be0df41", @@ -25,7 +24,6 @@ "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/kubeconfigwriter", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/creds-init", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/git-init", - "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/nop", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/bash", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/gsutil", "gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/controller", diff --git a/tekton/koparse/test_release.yaml b/tekton/koparse/test_release.yaml index eb80e19148b..809ed2fc8a1 100644 --- a/tekton/koparse/test_release.yaml +++ b/tekton/koparse/test_release.yaml @@ -350,8 +350,6 @@ spec: - gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/creds-init@sha256:67448da79e4731ab534b91df08da547bc434ab08e41d905858f2244e70290f48 - -git-image - gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/git-init@sha256:7d5520efa2d55e1346c424797988c541327ee52ef810a840b5c6f278a9de934a - - -nop-image - - gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/nop@sha256:3784d6b8f73043a29d2c1d6196801bee46fe808fbb94ba4fd21ca52dce503183 - -bash-noop-image - gcr.io/knative-releases/github.com/knative/build-pipeline/cmd/bash@sha256:d55917ef5c92627027e3755bfc577fbfa2fb783cccfb13a98632cb6ba6088cd6 - -gsutil-image diff --git a/tekton/publish-run.yaml b/tekton/publish-run.yaml index cc846e0e0c3..d0ea513b918 100644 --- a/tekton/publish-run.yaml +++ b/tekton/publish-run.yaml @@ -76,16 +76,6 @@ spec: --- apiVersion: tekton.dev/v1alpha1 kind: PipelineResource -metadata: - name: nop-image -spec: - type: image - params: - - name: url - value: cmd/nop # Registry is provided via parameter, this is a hack see #569 ---- -apiVersion: tekton.dev/v1alpha1 -kind: PipelineResource metadata: name: bash-image spec: @@ -169,9 +159,6 @@ spec: - name: builtGitInitImage resourceRef: name: git-init-image - - name: builtNopImage - resourceRef: - name: nop-image - name: builtBashImage resourceRef: name: bash-image diff --git a/test/builder/pod_test.go b/test/builder/pod_test.go index 3e7a2c57f8c..b183ae47acb 100644 --- a/test/builder/pod_test.go +++ b/test/builder/pod_test.go @@ -36,7 +36,7 @@ func TestPod(t *testing.T) { tb.PodSpec( tb.PodServiceAccountName("sa"), tb.PodRestartPolicy(corev1.RestartPolicyNever), - tb.PodContainer("nop", "nop:latest"), + tb.PodContainer("bash", "bash:latest"), tb.PodInitContainer("basic", "ubuntu", tb.Command("/bin/sh"), tb.Args("-c", "ls -l"), @@ -69,8 +69,8 @@ func TestPod(t *testing.T) { ServiceAccountName: "sa", RestartPolicy: corev1.RestartPolicyNever, Containers: []corev1.Container{{ - Name: "nop", - Image: "nop:latest", + Name: "bash", + Image: "bash:latest", }}, InitContainers: []corev1.Container{{ Name: "basic",