Skip to content

Commit

Permalink
Removes build word references from TaskRun
Browse files Browse the repository at this point in the history
At present `TaskRun's` `status`, it's pod containers name(`step name`
prefix) and logs has references to `build` keyword.
Which kind of gives the perception that `Task` is intended to
perform only build operations.

This patch removes those references from `TaskRun`.

Fixes
 - #815

Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
hrishin authored and vdemeester committed May 29, 2019
1 parent 9c52c69 commit 5e530f3
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion cmd/nop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ package main
import "fmt"

func main() {
fmt.Println("Build successful")
fmt.Println("Task completed successfully")
}
8 changes: 4 additions & 4 deletions pkg/reconciler/v1alpha1/taskrun/resources/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const (
// Prefixes to add to the name of the init containers.
// IMPORTANT: Changing these values without changing fluentd collection configuration
// will break log collection for init containers.
containerPrefix = "build-step-"
unnamedInitContainerPrefix = "build-step-unnamed-"
containerPrefix = "step-"
unnamedInitContainerPrefix = "step-unnamed-"
// Name of the credential initialization container.
credsInit = "credential-initializer"
// Name of the working dir initialization container.
Expand All @@ -102,9 +102,9 @@ 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.
// The container that just prints Task completed successfully.
nopImage = flag.String("nop-image", "override-with-nop:latest",
"The container image run at the end of the build to log build success")
"The container image run at the end of the build to log task success")
)

func makeCredentialInitializer(serviceAccountName, namespace string, kubeclient kubernetes.Interface) (*corev1.Container, []corev1.Volume, error) {
Expand Down
12 changes: 6 additions & 6 deletions pkg/reconciler/v1alpha1/taskrun/resources/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestMakePod(t *testing.T) {
WorkingDir: workspaceDir,
}},
Containers: []corev1.Container{{
Name: "build-step-name",
Name: "step-name",
Image: "image",
Env: implicitEnvVars,
VolumeMounts: implicitVolumeMounts,
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestMakePod(t *testing.T) {
WorkingDir: workspaceDir,
}},
Containers: []corev1.Container{{
Name: "build-step-name",
Name: "step-name",
Image: "image",
Env: implicitEnvVars,
VolumeMounts: implicitVolumeMounts,
Expand All @@ -226,7 +226,7 @@ func TestMakePod(t *testing.T) {
desc: "very-long-step-name",
ts: v1alpha1.TaskSpec{
Steps: []corev1.Container{{
Name: "a-very-long-character-step-name-to-trigger-max-len----and-invalid-characters",
Name: "a-very-very-long-character-step-name-to-trigger-max-len----and-invalid-characters",
Image: "image",
}},
},
Expand All @@ -245,7 +245,7 @@ func TestMakePod(t *testing.T) {
WorkingDir: workspaceDir,
}},
Containers: []corev1.Container{{
Name: "build-step-a-very-long-character-step-name-to-trigger-max-len",
Name: "step-a-very-very-long-character-step-name-to-trigger-max-len",
Image: "image",
Env: implicitEnvVars,
VolumeMounts: implicitVolumeMounts,
Expand Down Expand Up @@ -285,7 +285,7 @@ func TestMakePod(t *testing.T) {
WorkingDir: workspaceDir,
}},
Containers: []corev1.Container{{
Name: "build-step-ends-with-invalid",
Name: "step-ends-with-invalid",
Image: "image",
Env: implicitEnvVars,
VolumeMounts: implicitVolumeMounts,
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestMakePod(t *testing.T) {
WorkingDir: workspaceDir,
}},
Containers: []corev1.Container{{
Name: "build-step-name",
Name: "step-name",
Image: "image",
Env: implicitEnvVars,
VolumeMounts: implicitVolumeMounts,
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/v1alpha1/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const (

// imageDigestExporterContainerName defines the name of the container that will collect the
// built images digest
imageDigestExporterContainerName = "build-step-image-digest-exporter"
imageDigestExporterContainerName = "step-image-digest-exporter"
)

// Reconciler implements controller.Reconciler for Configuration resources.
Expand Down Expand Up @@ -386,7 +386,7 @@ func updateStatusFromPod(taskRun *v1alpha1.TaskRun, pod *corev1.Pod, resourceLis
taskRun.Status.SetCondition(&apis.Condition{
Type: apis.ConditionSucceeded,
Status: corev1.ConditionUnknown,
Reason: "Building",
Reason: reasonRunning,
})
case corev1.PodFailed:
msg := getFailureMessage(pod)
Expand Down
Loading

0 comments on commit 5e530f3

Please sign in to comment.