From 4ed5a62c439e70e9dfa82d21a58b0e44c9477523 Mon Sep 17 00:00:00 2001 From: gabemontero Date: Tue, 9 Nov 2021 14:27:53 -0500 Subject: [PATCH] add TODO placeholders and a deprecation notice for implicit tekton workspace emptydir volumes --- pkg/apis/build/v1alpha1/build_types.go | 5 ++++- pkg/reconciler/buildrun/resources/taskrun.go | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/apis/build/v1alpha1/build_types.go b/pkg/apis/build/v1alpha1/build_types.go index da1d6d871e..fc448cdf5a 100644 --- a/pkg/apis/build/v1alpha1/build_types.go +++ b/pkg/apis/build/v1alpha1/build_types.go @@ -74,7 +74,10 @@ const ( // BuildSpec defines the desired state of Build type BuildSpec struct { // Source refers to the Git repository containing the - // source code to be built. + // source code to be built. Currently, a Tekton Workspace with an EmptyDir Binding + // is implicitly created to store the contents retrieved from the Git repository referenced + // here. However, that behavior is deprecated with the release of Shipwright v0.7.0, and will + // be replaced in v0.8.0 with the creation of an implicit Build Strategy Volume per the SHIP 22 Enhancement Proposal. Source Source `json:"source"` // Sources slice of BuildSource, defining external build artifacts complementary to VCS diff --git a/pkg/reconciler/buildrun/resources/taskrun.go b/pkg/reconciler/buildrun/resources/taskrun.go index cdc081c7c7..46e8cd6ffe 100644 --- a/pkg/reconciler/buildrun/resources/taskrun.go +++ b/pkg/reconciler/buildrun/resources/taskrun.go @@ -28,6 +28,10 @@ const ( paramSourceRoot = "source-root" paramSourceContext = "source-context" + //TODO when SHIP 22 is fully implemented, it calls for the removal of this tekton workspace/emptyDir volume, + // with it replaced with an explicit emptyDir volume that is applied for the source tree. A constant to + // declare this well known volume will probably still exist, but most likely we'll want to change the name, + // and move it out of taskrun.go and into where the build strategy volumes are implemented. workspaceSource = "source" inputParamBuilder = "BUILDER_IMAGE" @@ -105,6 +109,8 @@ func GenerateTaskSpec( Type: taskv1.ParamTypeString, }, }, + //TODO when SHIP 22 is fully implemented, it calls for the removal of this tekton workspace/emptyDir volume, + // with it replaced with an explicit emptyDir volume that is applied for the source tree Workspaces: []v1beta1.WorkspaceDeclaration{ // workspace for the source files { @@ -264,6 +270,8 @@ func GenerateTaskRun( Spec: v1beta1.TaskRunSpec{ ServiceAccountName: serviceAccountName, TaskSpec: taskSpec, + //TODO when SHIP 22 is fully implemented, it calls for the removal of this tekton workspace/emptyDir volume, + // with it replaced with an explicit emptyDir volume that is applied for the source tree Workspaces: []v1beta1.WorkspaceBinding{ // workspace for the source files {