Skip to content

Commit

Permalink
Remove v1alpha1 Pipeline, PipelineRun, Task, TaskRun, and ClusterTask
Browse files Browse the repository at this point in the history
Closes #4982

This removes the long deprecated pipeline v1alpha1 APIs for everything that's replicated in v1beta1.

Signed-off-by: Andrew Bayer <[email protected]>
  • Loading branch information
abayer committed Jun 21, 2022
1 parent 09c7ce4 commit 0f665ac
Show file tree
Hide file tree
Showing 209 changed files with 168 additions and 23,783 deletions.
58 changes: 3 additions & 55 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"os"

defaultconfig "github.com/tektoncd/pipeline/pkg/apis/config"
"github.com/tektoncd/pipeline/pkg/apis/pipeline"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1"
"k8s.io/apimachinery/pkg/runtime/schema"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
Expand All @@ -46,12 +46,7 @@ import (

var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
// v1alpha1
v1alpha1.SchemeGroupVersion.WithKind("Pipeline"): &v1alpha1.Pipeline{},
v1alpha1.SchemeGroupVersion.WithKind("Task"): &v1alpha1.Task{},
v1alpha1.SchemeGroupVersion.WithKind("ClusterTask"): &v1alpha1.ClusterTask{},
v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{},
v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &resourcev1alpha1.PipelineResource{},
v1alpha1.SchemeGroupVersion.WithKind("Run"): &v1alpha1.Run{},
// v1beta1
v1beta1.SchemeGroupVersion.WithKind("Pipeline"): &v1beta1.Pipeline{},
Expand Down Expand Up @@ -131,59 +126,12 @@ func newConfigValidationController(ctx context.Context, cmw configmap.Watcher) *
}

func newConversionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
// nolint: revive
var (
v1alpha1GroupVersion = v1alpha1.SchemeGroupVersion.Version
v1beta1GroupVersion = v1beta1.SchemeGroupVersion.Version
)

return conversion.NewConversionController(ctx,
// The path on which to serve the webhook
"/resource-conversion",

// Specify the types of custom resource definitions that should be converted
map[schema.GroupKind]conversion.GroupKindConversion{
v1beta1.Kind("Task"): {
DefinitionName: pipeline.TaskResource.String(),
HubVersion: v1alpha1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1alpha1GroupVersion: &v1alpha1.Task{},
v1beta1GroupVersion: &v1beta1.Task{},
},
},
v1beta1.Kind("ClusterTask"): {
DefinitionName: pipeline.ClusterTaskResource.String(),
HubVersion: v1alpha1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1alpha1GroupVersion: &v1alpha1.ClusterTask{},
v1beta1GroupVersion: &v1beta1.ClusterTask{},
},
},
v1beta1.Kind("TaskRun"): {
DefinitionName: pipeline.TaskRunResource.String(),
HubVersion: v1alpha1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1alpha1GroupVersion: &v1alpha1.TaskRun{},
v1beta1GroupVersion: &v1beta1.TaskRun{},
},
},
v1beta1.Kind("Pipeline"): {
DefinitionName: pipeline.PipelineResource.String(),
HubVersion: v1alpha1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1alpha1GroupVersion: &v1alpha1.Pipeline{},
v1beta1GroupVersion: &v1beta1.Pipeline{},
},
},
v1beta1.Kind("PipelineRun"): {
DefinitionName: pipeline.PipelineRunResource.String(),
HubVersion: v1alpha1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1alpha1GroupVersion: &v1alpha1.PipelineRun{},
v1beta1GroupVersion: &v1beta1.PipelineRun{},
},
},
},
map[schema.GroupKind]conversion.GroupKindConversion{},

// A function that infuses the context passed to ConvertTo/ConvertFrom/SetDefaults with custom metadata
func(ctx context.Context) context.Context {
Expand Down
30 changes: 0 additions & 30 deletions examples/v1alpha1/pipelineruns/clustertask-pipelinerun.yaml

This file was deleted.

Empty file.
56 changes: 0 additions & 56 deletions examples/v1alpha1/pipelineruns/no-ci/limitrange.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions examples/v1alpha1/pipelineruns/no-ci/pipeline-timeout.yaml

This file was deleted.

105 changes: 0 additions & 105 deletions examples/v1alpha1/pipelineruns/output-pipelinerun.yaml

This file was deleted.

Loading

0 comments on commit 0f665ac

Please sign in to comment.