Skip to content

Commit

Permalink
serve flow v1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Jun 29, 2020
1 parent 0332809 commit eaba468
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
15 changes: 0 additions & 15 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -269,7 +260,6 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro
eventingv1_: &eventingv1.Broker{},
},
},
<<<<<<< HEAD

// Messaging
messagingv1.Kind("Channel"): {
Expand Down Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
4 changes: 4 additions & 0 deletions config/core/resources/parallel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ spec:
name: v1beta1
served: true
storage: true
- <<: *version
name: v1
served: true
storage: false
names:
kind: Parallel
plural: parallels
Expand Down
31 changes: 31 additions & 0 deletions config/core/resources/sequence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ spec:
name: v1beta1
served: true
storage: true
- <<: *version
name: v1
served: true
storage: false
names:
kind: Sequence
plural: sequences
Expand All @@ -65,9 +69,36 @@ spec:
scope: Namespaced
conversion:
strategy: Webhook
<<<<<<< HEAD
webhook:
conversionReviewVersions: ["v1", "v1beta1"]
clientConfig:
service:
name: eventing-webhook
namespace: knative-eventing
=======
webhookClientConfig:
service:
name: eventing-webhook
namespace: knative-eventing
additionalPrinterColumns:
- name: Ready
type: string
JSONPath: ".status.conditions[?(@.type==\"Ready\")].status"
- name: Reason
type: string
JSONPath: ".status.conditions[?(@.type==\"Ready\")].reason"
- name: URL
type: string
JSONPath: .status.address.url
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
versions:
- name: v1beta1
served: true
storage: true
- name: v1
served: true
storage: false
>>>>>>> serve flow v1 API
4 changes: 2 additions & 2 deletions pkg/apis/flows/v1beta1/parallel_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
},
},
Expand Down

0 comments on commit eaba468

Please sign in to comment.