@@ -22,41 +22,8 @@ import (
2222	"github.com/google/go-cmp/cmp" 
2323	"github.com/tektoncd/pipeline/pkg/apis/pipeline" 
2424	"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha2" 
25- 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 
2625)
2726
28- // PipelineResourceType represents the type of endpoint the pipelineResource is, so that the 
29- // controller will know this pipelineResource should be fetched and optionally what 
30- // additional metatdata should be provided for it. 
31- type  PipelineResourceType  =  v1alpha2.PipelineResourceType 
32- 
33- var  (
34- 	AllowedOutputResources  =  v1alpha2 .AllowedOutputResources 
35- )
36- 
37- const  (
38- 	// PipelineResourceTypeGit indicates that this source is a GitHub repo. 
39- 	PipelineResourceTypeGit  PipelineResourceType  =  v1alpha2 .PipelineResourceTypeGit 
40- 
41- 	// PipelineResourceTypeStorage indicates that this source is a storage blob resource. 
42- 	PipelineResourceTypeStorage  PipelineResourceType  =  v1alpha2 .PipelineResourceTypeStorage 
43- 
44- 	// PipelineResourceTypeImage indicates that this source is a docker Image. 
45- 	PipelineResourceTypeImage  PipelineResourceType  =  v1alpha2 .PipelineResourceTypeImage 
46- 
47- 	// PipelineResourceTypeCluster indicates that this source is a k8s cluster Image. 
48- 	PipelineResourceTypeCluster  PipelineResourceType  =  v1alpha2 .PipelineResourceTypeCluster 
49- 
50- 	// PipelineResourceTypePullRequest indicates that this source is a SCM Pull Request. 
51- 	PipelineResourceTypePullRequest  PipelineResourceType  =  v1alpha2 .PipelineResourceTypePullRequest 
52- 
53- 	// PipelineResourceTypeCloudEvent indicates that this source is a cloud event URI 
54- 	PipelineResourceTypeCloudEvent  PipelineResourceType  =  v1alpha2 .PipelineResourceTypeCloudEvent 
55- )
56- 
57- // AllResourceTypes can be used for validation to check if a provided Resource type is one of the known types. 
58- var  AllResourceTypes  =  v1alpha2 .AllResourceTypes 
59- 
6027// PipelineResourceInterface interface to be implemented by different PipelineResource types 
6128type  PipelineResourceInterface  interface  {
6229	// GetName returns the name of this PipelineResource instance. 
@@ -132,51 +99,6 @@ func ApplyTaskModifier(ts *TaskSpec, tm TaskModifier) error {
13299	return  nil 
133100}
134101
135- // SecretParam indicates which secret can be used to populate a field of the resource 
136- type  SecretParam  struct  {
137- 	FieldName   string  `json:"fieldName"` 
138- 	SecretKey   string  `json:"secretKey"` 
139- 	SecretName  string  `json:"secretName"` 
140- }
141- 
142- // PipelineResourceSpec defines  an individual resources used in the pipeline. 
143- type  PipelineResourceSpec  struct  {
144- 	Type    PipelineResourceType  `json:"type"` 
145- 	Params  []ResourceParam       `json:"params"` 
146- 	// Secrets to fetch to populate some of resource fields 
147- 	// +optional 
148- 	SecretParams  []SecretParam  `json:"secrets,omitempty"` 
149- }
150- 
151- // +genclient 
152- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 
153- // +genclient:noStatus 
154- 
155- // PipelineResource describes a resource that is an input to or output from a 
156- // Task. 
157- // 
158- // +k8s:openapi-gen=true 
159- type  PipelineResource  struct  {
160- 	metav1.TypeMeta  `json:",inline"` 
161- 	// +optional 
162- 	metav1.ObjectMeta  `json:"metadata,omitempty"` 
163- 
164- 	// Spec holds the desired state of the PipelineResource from the client 
165- 	Spec  PipelineResourceSpec  `json:"spec,omitempty"` 
166- 
167- 	// Status is deprecated. 
168- 	// It usually is used to communicate the observed state of the PipelineResource from 
169- 	// the controller, but was unused as there is no controller for PipelineResource. 
170- 	// +optional 
171- 	Status  * PipelineResourceStatus  `json:"status,omitempty"` 
172- }
173- 
174- // PipelineResourceStatus does not contain anything because PipelineResources on their own 
175- // do not have a status 
176- // Deprecated 
177- type  PipelineResourceStatus  struct  {
178- }
179- 
180102// PipelineResourceBinding connects a reference to an instance of a PipelineResource 
181103// with a PipelineResource dependency that the Pipeline has declared 
182104type  PipelineResourceBinding  struct  {
@@ -203,23 +125,6 @@ type PipelineResourceResult struct {
203125	ResourceRef  PipelineResourceRef  `json:"resourceRef,omitempty"` 
204126}
205127
206- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 
207- 
208- // PipelineResourceList contains a list of PipelineResources 
209- type  PipelineResourceList  struct  {
210- 	metav1.TypeMeta  `json:",inline"` 
211- 	// +optional 
212- 	metav1.ListMeta  `json:"metadata,omitempty"` 
213- 	Items            []PipelineResource  `json:"items"` 
214- }
215- 
216- // ResourceDeclaration defines an input or output PipelineResource declared as a requirement 
217- // by another type such as a Task or Condition. The Name field will be used to refer to these 
218- // PipelineResources within the type's definition, and when provided as an Input, the Name will be the 
219- // path to the volume mounted containing this PipelineResource as an input (e.g. 
220- // an input Resource named `workspace` will be mounted at `/workspace`). 
221- type  ResourceDeclaration  =  v1alpha2.ResourceDeclaration 
222- 
223128// ResourceFromType returns an instance of the correct PipelineResource object type which can be 
224129// used to add input and output containers as well as volumes to a TaskRun's pod in order to realize 
225130// a PipelineResource in a pod. 
0 commit comments