From 03328094b0b4a7940cb8d0a6ff4400fa52d64495 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Thu, 25 Jun 2020 16:18:22 -0400 Subject: [PATCH 1/2] v1 <-> v1beta1 flow conversion webhook --- cmd/webhook/main.go | 15 +++++++++++++++ .../flows/v1beta1/parallel_conversion_test.go | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 92488d9ab8d..b4f3dfea131 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -227,6 +227,7 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro } var ( +<<<<<<< HEAD eventingv1beta1_ = eventingv1beta1.SchemeGroupVersion.Version eventingv1_ = eventingv1.SchemeGroupVersion.Version messagingv1beta1_ = messagingv1beta1.SchemeGroupVersion.Version @@ -235,6 +236,14 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro flowsv1_ = flowsv1.SchemeGroupVersion.Version sourcesv1alpha1_ = sourcesv1alpha1.SchemeGroupVersion.Version sourcesv1alpha2_ = sourcesv1alpha2.SchemeGroupVersion.Version +======= + eventingv1beta1_ = eventingv1beta1.SchemeGroupVersion.Version + eventingv1_ = eventingv1.SchemeGroupVersion.Version + flowsv1beta1_ = flowsv1beta1.SchemeGroupVersion.Version + flowsv1_ = flowsv1.SchemeGroupVersion.Version + sourcesv1alpha1_ = sourcesv1alpha1.SchemeGroupVersion.Version + sourcesv1alpha2_ = sourcesv1alpha2.SchemeGroupVersion.Version +>>>>>>> v1 <-> v1beta1 flow conversion webhook ) return conversion.NewConversionController(ctx, @@ -260,6 +269,7 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro eventingv1_: &eventingv1.Broker{}, }, }, +<<<<<<< HEAD // Messaging messagingv1.Kind("Channel"): { @@ -287,6 +297,8 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro }, }, +======= +>>>>>>> v1 <-> v1beta1 flow conversion webhook // flows flowsv1.Kind("Sequence"): { DefinitionName: flows.SequenceResource.String(), @@ -304,7 +316,10 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro flowsv1_: &flowsv1.Parallel{}, }, }, +<<<<<<< HEAD +======= +>>>>>>> v1 <-> v1beta1 flow conversion webhook // Sources sourcesv1alpha2.Kind("ApiServerSource"): { DefinitionName: sources.ApiServerSourceResource.String(), diff --git a/pkg/apis/flows/v1beta1/parallel_conversion_test.go b/pkg/apis/flows/v1beta1/parallel_conversion_test.go index 88a42eba906..720ca752b24 100644 --- a/pkg/apis/flows/v1beta1/parallel_conversion_test.go +++ b/pkg/apis/flows/v1beta1/parallel_conversion_test.go @@ -157,9 +157,9 @@ func TestParallelRoundTripV1beta1(t *testing.T) { APIVersion: "d2APIVersion", }, URI: apis.HTTP("d2.example.com")}, - Retry: pointer.Int32Ptr(1), + Retry: &one, BackoffPolicy: &linear, - BackoffDelay: pointer.StringPtr("1m"), + BackoffDelay: &onemn, }, }, }, From 8e17e271175169ae2a3d6a129ff6f4f8619eb945 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Thu, 25 Jun 2020 17:41:46 -0400 Subject: [PATCH 2/2] serve flow v1 API --- cmd/webhook/main.go | 15 --------------- config/core/resources/parallel.yaml | 4 ++++ config/core/resources/sequence.yaml | 4 ++++ .../flows/v1beta1/parallel_conversion_test.go | 4 ++-- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index b4f3dfea131..92488d9ab8d 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -227,7 +227,6 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro } var ( -<<<<<<< HEAD eventingv1beta1_ = eventingv1beta1.SchemeGroupVersion.Version eventingv1_ = eventingv1.SchemeGroupVersion.Version messagingv1beta1_ = messagingv1beta1.SchemeGroupVersion.Version @@ -236,14 +235,6 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro flowsv1_ = flowsv1.SchemeGroupVersion.Version sourcesv1alpha1_ = sourcesv1alpha1.SchemeGroupVersion.Version sourcesv1alpha2_ = sourcesv1alpha2.SchemeGroupVersion.Version -======= - eventingv1beta1_ = eventingv1beta1.SchemeGroupVersion.Version - eventingv1_ = eventingv1.SchemeGroupVersion.Version - flowsv1beta1_ = flowsv1beta1.SchemeGroupVersion.Version - flowsv1_ = flowsv1.SchemeGroupVersion.Version - sourcesv1alpha1_ = sourcesv1alpha1.SchemeGroupVersion.Version - sourcesv1alpha2_ = sourcesv1alpha2.SchemeGroupVersion.Version ->>>>>>> v1 <-> v1beta1 flow conversion webhook ) return conversion.NewConversionController(ctx, @@ -269,7 +260,6 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro eventingv1_: &eventingv1.Broker{}, }, }, -<<<<<<< HEAD // Messaging messagingv1.Kind("Channel"): { @@ -297,8 +287,6 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro }, }, -======= ->>>>>>> v1 <-> v1beta1 flow conversion webhook // flows flowsv1.Kind("Sequence"): { DefinitionName: flows.SequenceResource.String(), @@ -316,10 +304,7 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro flowsv1_: &flowsv1.Parallel{}, }, }, -<<<<<<< HEAD -======= ->>>>>>> v1 <-> v1beta1 flow conversion webhook // Sources sourcesv1alpha2.Kind("ApiServerSource"): { DefinitionName: sources.ApiServerSourceResource.String(), diff --git a/config/core/resources/parallel.yaml b/config/core/resources/parallel.yaml index 4c6e55e4249..ce4297fbd5b 100644 --- a/config/core/resources/parallel.yaml +++ b/config/core/resources/parallel.yaml @@ -53,6 +53,10 @@ spec: name: v1beta1 served: true storage: true + - <<: *version + name: v1 + served: true + storage: false names: kind: Parallel plural: parallels diff --git a/config/core/resources/sequence.yaml b/config/core/resources/sequence.yaml index 4707b1cc956..37b6a88f550 100644 --- a/config/core/resources/sequence.yaml +++ b/config/core/resources/sequence.yaml @@ -53,6 +53,10 @@ spec: name: v1beta1 served: true storage: true + - <<: *version + name: v1 + served: true + storage: false names: kind: Sequence plural: sequences diff --git a/pkg/apis/flows/v1beta1/parallel_conversion_test.go b/pkg/apis/flows/v1beta1/parallel_conversion_test.go index 720ca752b24..88a42eba906 100644 --- a/pkg/apis/flows/v1beta1/parallel_conversion_test.go +++ b/pkg/apis/flows/v1beta1/parallel_conversion_test.go @@ -157,9 +157,9 @@ func TestParallelRoundTripV1beta1(t *testing.T) { APIVersion: "d2APIVersion", }, URI: apis.HTTP("d2.example.com")}, - Retry: &one, + Retry: pointer.Int32Ptr(1), BackoffPolicy: &linear, - BackoffDelay: &onemn, + BackoffDelay: pointer.StringPtr("1m"), }, }, },