Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions docs/developers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Tasks can define results by adding a result on the task spec. This is an
example:

```yaml
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: print-date
Expand Down Expand Up @@ -290,7 +290,7 @@ A user can defined more than one result for a single task.
For this task definition,

```yaml
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: print-date
Expand Down Expand Up @@ -319,7 +319,7 @@ spec:
you end up with this task run status:

```yaml
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1beta1
kind: TaskRun
# ...
status:
Expand Down Expand Up @@ -357,7 +357,7 @@ result in a pipeline by using the syntax
result at the location of the variable.

```yaml
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: sum-and-multiply-pipeline
Expand Down
2 changes: 1 addition & 1 deletion docs/taskruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ in order to stop `TaskRun` step containers from running.
Example of cancelling a `TaskRun`:

```yaml
apiVersion: tekton.dev/v1alpha1
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: go-example-git
Expand Down
2 changes: 1 addition & 1 deletion docs/tekton-bundle-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Each layer must contain all of the following annotations:
- `dev.tekton.image.name` => `ObjectMeta.Name` of the resource
- `dev.tekton.image.kind` => `TypeMeta.Kind` of the resource, all lower-cased and singular (eg, `task`)
- `dev.tekton.image.apiVersion` => `TypeMeta.APIVersion` of the resource (eg
"tekton.dev/v1alpha1")
"tekton.dev/v1beta1")

The union of the { `dev.tekton.image.apiVersion`, `dev.tekton.image.kind`, `dev.tekton.image.name` }
annotations on a given layer must be unique among all layers of that image. In practical terms, this means no two
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