From 1b531121ecbc56b81247269e57a773c0b0d75cda Mon Sep 17 00:00:00 2001 From: mikeykhalil Date: Sat, 27 Apr 2019 22:45:29 -0700 Subject: [PATCH] resource types: leave comment to explain problem --- pkg/apis/pipeline/v1alpha1/resource_types.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/apis/pipeline/v1alpha1/resource_types.go b/pkg/apis/pipeline/v1alpha1/resource_types.go index 26b5ffa6d5e..0c75199a84b 100644 --- a/pkg/apis/pipeline/v1alpha1/resource_types.go +++ b/pkg/apis/pipeline/v1alpha1/resource_types.go @@ -170,6 +170,13 @@ func ResourceFromType(r *PipelineResource) (PipelineResourceInterface, error) { func AttributesFromType(prt PipelineResourceType) ([]string, error) { r := &PipelineResource{} r.Spec.Type = prt + // Todo (mk): We have run into this unfortunate event where technically we cannot determine + // what attributes an object has strictly from the PipelineResourceType alone. + // This is because of the subtypes that exists for the PipelineResourceTypeStorage type. + // At the moment, both of the subtypes happen to have equivalent keys in their + // Replacements(). So technically we can just pick one of the subtypes and still return the + // proper attributes. However, we may want to reconsider the approach on how we obtain or + // store these attributes. if prt == PipelineResourceTypeStorage { r.Spec.Params = []Param{