Skip to content

Commit

Permalink
Remove cmd/nop
Browse files Browse the repository at this point in the history
The raison d'être for this image was to be able to replace a running
container with another image that would simply exit successfully,
regardless of the user-defined args/env/etc. (since we can't update
args, only the image name)

Instead of building and providing our own image, we can simply use an
image that contains only `true` as an entrypoint. `tianon/true` is such
an image, which is _125 bytes_ in size.

The image that's used is configurable by operators, the only requirement
is that the image exit successfully regardless of provided inputs.
  • Loading branch information
imjasonh authored and tekton-robot committed Nov 1, 2019
1 parent 13342cc commit c654fd9
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 55 deletions.
3 changes: 1 addition & 2 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ const (
var (
entrypointImage = flag.String("entrypoint-image", "override-with-entrypoint:latest",
"The container image containing our entrypoint binary.")
nopImage = flag.String("nop-image", "override-with-nop:latest",
"The container image used to kill sidecars")
nopImage = flag.String("nop-image", "tianon/true", "The container image used to stop sidecars")
gitImage = flag.String("git-image", "override-with-git:latest",
"The container image containing our Git binary.")
credsImage = flag.String("creds-image", "override-with-creds:latest",
Expand Down
1 change: 0 additions & 1 deletion cmd/nop/kodata/HEAD

This file was deleted.

1 change: 0 additions & 1 deletion cmd/nop/kodata/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion cmd/nop/kodata/VENDOR-LICENSE

This file was deleted.

29 changes: 0 additions & 29 deletions cmd/nop/main.go

This file was deleted.

2 changes: 1 addition & 1 deletion config/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ 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",
"-nop-image", "tianon/true",
"-shell-image", "busybox",
"-gsutil-image", "google/cloud-sdk",
"-entrypoint-image", "github.com/tektoncd/pipeline/cmd/entrypoint",
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/build_gcs_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

var images = pipeline.Images{
EntryPointImage: "override-with-entrypoint:latest",
NopImage: "override-with-nop:latest",
NopImage: "tianon/true",
GitImage: "override-with-git:latest",
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
Expand Down
2 changes: 1 addition & 1 deletion pkg/artifacts/artifact_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
var (
images = pipeline.Images{
EntryPointImage: "override-with-entrypoint:latest",
NopImage: "override-with-nop:latest",
NopImage: "tianon/true",
GitImage: "override-with-git:latest",
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (
ignoreLastTransitionTime = cmpopts.IgnoreTypes(apis.Condition{}.LastTransitionTime.Inner.Time)
images = pipeline.Images{
EntryPointImage: "override-with-entrypoint:latest",
NopImage: "override-with-nop:latest",
NopImage: "tianon/true",
GitImage: "override-with-git:latest",
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/taskrun/resources/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
var (
images = pipeline.Images{
EntryPointImage: "override-with-entrypoint:latest",
NopImage: "override-with-nop:latest",
NopImage: "tianon/true",
GitImage: "override-with-git:latest",
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer-image:latest",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/taskrun/resources/input_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
var (
images = pipeline.Images{
EntryPointImage: "override-with-entrypoint:latest",
NopImage: "override-with-nop:latest",
NopImage: "tianon/true",
GitImage: "override-with-git:latest",
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/taskrun/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const (
var (
images = pipeline.Images{
EntryPointImage: "override-with-entrypoint:latest",
NopImage: "override-with-nop:latest",
NopImage: "tianon/true",
GitImage: "override-with-git:latest",
CredsImage: "override-with-creds:latest",
KubeconfigWriterImage: "override-with-kubeconfig-writer:latest",
Expand Down
2 changes: 0 additions & 2 deletions tekton/koparse/test_koparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/kubeconfigwriter@sha256:68453f5bb4b76c0eab98964754114d4f79d3a50413872520d8919a6786ea2b35",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/creds-init@sha256:67448da79e4731ab534b91df08da547bc434ab08e41d905858f2244e70290f48",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:7d5520efa2d55e1346c424797988c541327ee52ef810a840b5c6f278a9de934a",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/nop@sha256:3784d6b8f73043a29d2c1d6196801bee46fe808fbb94ba4fd21ca52dce503183",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller@sha256:bdc6f22a44944c829983c30213091b60f490b41f89577e8492f6a2936be0df41",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook@sha256:cca7069a11aaf0d9d214306d456bc40b2e33e5839429bf07c123ad964d495d8a",
]
EXPECTED_IMAGES = [
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/kubeconfigwriter",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/creds-init",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/nop",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller",
"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook",
]
Expand Down
2 changes: 0 additions & 2 deletions tekton/koparse/test_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ spec:
- gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/creds-init@sha256:67448da79e4731ab534b91df08da547bc434ab08e41d905858f2244e70290f48
- -git-image
- gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:7d5520efa2d55e1346c424797988c541327ee52ef810a840b5c6f278a9de934a
- -nop-image
- gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/nop@sha256:3784d6b8f73043a29d2c1d6196801bee46fe808fbb94ba4fd21ca52dce503183
image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller@sha256:bdc6f22a44944c829983c30213091b60f490b41f89577e8492f6a2936be0df41
name: tekton-pipelines-controller
volumeMounts:
Expand Down
10 changes: 0 additions & 10 deletions tekton/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,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: controller-image
spec:
Expand Down

0 comments on commit c654fd9

Please sign in to comment.