Skip to content

Commit

Permalink
Remove support for the name parameter to cluster resources.
Browse files Browse the repository at this point in the history
This was deprecated in tektoncd#1474 which was released in 0.9.0. It can safely
be deleted in the next release.
  • Loading branch information
dlorenc committed Dec 3, 2019
1 parent 610c7a5 commit d3d35e7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 0 additions & 2 deletions pkg/apis/pipeline/v1alpha1/cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ func NewClusterResource(kubeconfigWriterImage string, r *PipelineResource) (*Clu
}
for _, param := range r.Spec.Params {
switch {
case strings.EqualFold(param.Name, "Name"):
clusterResource.Name = param.Value
case strings.EqualFold(param.Name, "URL"):
clusterResource.URL = param.Value
case strings.EqualFold(param.Name, "Revision"):
Expand Down
9 changes: 1 addition & 8 deletions pkg/apis/pipeline/v1alpha1/pipelineresource_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/tektoncd/pipeline/pkg/apis/validate"
"k8s.io/apimachinery/pkg/api/equality"
"knative.dev/pkg/apis"
logging "knative.dev/pkg/logging"
)

var _ apis.Validatable = (*PipelineResource)(nil)
Expand All @@ -43,7 +42,7 @@ func (rs *PipelineResourceSpec) Validate(ctx context.Context) *apis.FieldError {
return apis.ErrMissingField(apis.CurrentField)
}
if rs.Type == PipelineResourceTypeCluster {
var authFound, cadataFound, nameFound, isInsecure bool
var authFound, cadataFound, isInsecure bool
for _, param := range rs.Params {
switch {
case strings.EqualFold(param.Name, "URL"):
Expand All @@ -57,8 +56,6 @@ func (rs *PipelineResourceSpec) Validate(ctx context.Context) *apis.FieldError {
cadataFound = true
case strings.EqualFold(param.Name, "Token"):
authFound = true
case strings.EqualFold(param.Name, "name"):
nameFound = true
case strings.EqualFold(param.Name, "insecure"):
b, _ := strconv.ParseBool(param.Value)
isInsecure = b
Expand All @@ -75,10 +72,6 @@ func (rs *PipelineResourceSpec) Validate(ctx context.Context) *apis.FieldError {
}
}

if nameFound {
logging.FromContext(ctx).Warn(
"The name parameter on the cluster resource is deprecated. Support will be removed in a future release")
}
// One auth method must be supplied
if !(authFound) {
return apis.ErrMissingField("username or CAData or token param")
Expand Down

0 comments on commit d3d35e7

Please sign in to comment.