From dc07fcc1343db15348396e4e35b9fd3cc213a22f Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Tue, 25 Aug 2020 10:08:03 +0200 Subject: [PATCH] change storage version to v1beta1 Signed-off-by: Matthias Wessendorf --- kafka/channel/config/300-kafka-channel.yaml | 4 ++-- .../pkg/apis/messaging/v1alpha1/kafka_channel_defaults.go | 2 +- .../apis/messaging/v1alpha1/kafka_channel_defaults_test.go | 6 +++--- .../pkg/apis/messaging/v1beta1/kafka_channel_defaults.go | 2 +- .../apis/messaging/v1beta1/kafka_channel_defaults_test.go | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/kafka/channel/config/300-kafka-channel.yaml b/kafka/channel/config/300-kafka-channel.yaml index 8c3cfddf93..fdc2d5629e 100644 --- a/kafka/channel/config/300-kafka-channel.yaml +++ b/kafka/channel/config/300-kafka-channel.yaml @@ -62,10 +62,10 @@ spec: versions: - name: v1alpha1 served: true - storage: true + storage: false - name: v1beta1 served: true - storage: false + storage: true conversion: strategy: Webhook conversionReviewVersions: ["v1beta1", "v1alpha1"] diff --git a/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults.go b/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults.go index 0e70753487..c55afc58a6 100644 --- a/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults.go +++ b/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults.go @@ -34,7 +34,7 @@ func (c *KafkaChannel) SetDefaults(ctx context.Context) { c.Annotations = make(map[string]string) } if _, ok := c.Annotations[messaging.SubscribableDuckVersionAnnotation]; !ok { - c.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1alpha1" + c.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1beta1" } c.Spec.SetDefaults(ctx) diff --git a/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults_test.go b/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults_test.go index 01b2b3fa56..a0fea1b308 100644 --- a/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults_test.go +++ b/kafka/channel/pkg/apis/messaging/v1alpha1/kafka_channel_defaults_test.go @@ -38,7 +38,7 @@ func TestKafkaChannelDefaults(t *testing.T) { initial: KafkaChannel{}, expected: KafkaChannel{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1alpha1"}, + Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1beta1"}, }, Spec: KafkaChannelSpec{ NumPartitions: utils.DefaultNumPartitions, @@ -54,7 +54,7 @@ func TestKafkaChannelDefaults(t *testing.T) { }, expected: KafkaChannel{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1alpha1"}, + Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1beta1"}, }, Spec: KafkaChannelSpec{ NumPartitions: utils.DefaultNumPartitions, @@ -70,7 +70,7 @@ func TestKafkaChannelDefaults(t *testing.T) { }, expected: KafkaChannel{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1alpha1"}, + Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1beta1"}, }, Spec: KafkaChannelSpec{ NumPartitions: testNumPartitions, diff --git a/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go b/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go index 7f1b19cfbd..951ec0ceaa 100644 --- a/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go +++ b/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go @@ -34,7 +34,7 @@ func (c *KafkaChannel) SetDefaults(ctx context.Context) { c.Annotations = make(map[string]string) } if _, ok := c.Annotations[messaging.SubscribableDuckVersionAnnotation]; !ok { - c.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1" + c.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1beta1" } c.Spec.SetDefaults(ctx) diff --git a/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go b/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go index dae40b7dbd..79601afd36 100644 --- a/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go +++ b/kafka/channel/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go @@ -38,7 +38,7 @@ func TestKafkaChannelDefaults(t *testing.T) { initial: KafkaChannel{}, expected: KafkaChannel{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1"}, + Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1beta1"}, }, Spec: KafkaChannelSpec{ NumPartitions: utils.DefaultNumPartitions, @@ -54,7 +54,7 @@ func TestKafkaChannelDefaults(t *testing.T) { }, expected: KafkaChannel{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1"}, + Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1beta1"}, }, Spec: KafkaChannelSpec{ NumPartitions: utils.DefaultNumPartitions, @@ -70,7 +70,7 @@ func TestKafkaChannelDefaults(t *testing.T) { }, expected: KafkaChannel{ ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1"}, + Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1beta1"}, }, Spec: KafkaChannelSpec{ NumPartitions: testNumPartitions,