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
75 changes: 39 additions & 36 deletions config/channels/in-memory-channel/300-in-memory-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: inmemorychannels.messaging.knative.dev
Expand All @@ -22,15 +22,38 @@ metadata:
duck.knative.dev/addressable: "true"
spec:
group: messaging.knative.dev
preserveUnknownFields: false
validation:
openAPIV3Schema:
type: object
# this is a work around so we don't need to flush out the
# schema for each version at this time
#
# see issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
versions:
- &version
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, we do that already with everything on the verbs ;-)

but yeah 🙄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it is fine :) Just some YAML magic that I didn't know before :)
Actually gets rid of some dupes, which is nice

name: v1alpha1
served: false
storage: false
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
# this is a work around so we don't need to flush out the
# schema for each version at this time
#
# see issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
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
- << : *version
name: v1beta1
served: true
storage: true
names:
kind: InMemoryChannel
plural: inmemorychannels
Expand All @@ -43,31 +66,11 @@ spec:
shortNames:
- imc
scope: Namespaced
subresources:
status: {}
conversion:
strategy: Webhook
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: v1alpha1
served: false
storage: false
- name: v1beta1
served: true
storage: true
webhook:
conversionReviewVersions: ["v1", "v1beta1"]
clientConfig:
service:
name: eventing-webhook
namespace: knative-eventing
77 changes: 40 additions & 37 deletions config/core/resources/apiserversource.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 The Knative Authors
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
Expand All @@ -35,6 +35,38 @@ metadata:
name: apiserversources.sources.knative.dev
spec:
group: sources.knative.dev
versions:
- &version
name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
# this is a work around so we don't need to flush out the
# schema for each version at this time
#
# see issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Ready
type: string
jsonPath: ".status.conditions[?(@.type==\"Ready\")].status"
- name: Reason
type: string
jsonPath: ".status.conditions[?(@.type==\"Ready\")].reason"
- name: Sink
type: string
jsonPath: ".status.sinkUri"
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
- << : *version
name: v1alpha2
served: true
storage: false
names:
categories:
- all
Expand All @@ -44,40 +76,11 @@ spec:
kind: ApiServerSource
plural: apiserversources
scope: Namespaced
subresources:
status: {}
preserveUnknownFields: false
validation:
openAPIV3Schema:
type: object
# this is a work around so we don't need to flesh out the
# schema for each version at this time
#
# see issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
conversion:
strategy: Webhook
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: Sink
type: string
JSONPath: ".status.sinkUri"
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
versions:
- name: v1alpha1
served: true
storage: true
- name: v1alpha2
served: true
storage: false
webhook:
conversionReviewVersions: ["v1", "v1beta1"]
clientConfig:
service:
name: eventing-webhook
namespace: knative-eventing
79 changes: 40 additions & 39 deletions config/core/resources/broker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 The Knative Authors
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: brokers.eventing.knative.dev
Expand All @@ -22,17 +22,38 @@ metadata:
duck.knative.dev/addressable: "true"
spec:
group: eventing.knative.dev
preserveUnknownFields: false
validation:
openAPIV3Schema:
type: object
# this is a work around so we don't need to flush out the
# schema for each version at this time as well as ensure
# that different Broker Classes that might have different
# fields that are not in the Broker Spec will work.
#
# see issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
versions:
- &version
name: v1alpha1
served: false
storage: false
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
# this is a work around so we don't need to flush out the
# schema for each version at this time
#
# see issue: https://github.com/knative/serving/issues/912
x-kubernetes-preserve-unknown-fields: true
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
- << : *version
name: v1beta1
served: true
storage: true
names:
kind: Broker
plural: brokers
Expand All @@ -42,31 +63,11 @@ spec:
- knative
- eventing
scope: Namespaced
subresources:
status: {}
conversion:
strategy: Webhook
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: v1alpha1
served: false
storage: false
- name: v1beta1
served: true
storage: true
webhook:
conversionReviewVersions: ["v1", "v1beta1"]
clientConfig:
service:
name: eventing-webhook
namespace: knative-eventing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you can't drop the v1alpha1 for the brokers based on this from the failed upgrade tests:
for: "STDIN": CustomResourceDefinition.apiextensions.k8s.io "brokers.eventing.knative.dev" is invalid: status.storedVersions[0]: Invalid value: "v1alpha1": must appear in spec.versions
Error from server (Invalid): error when applying patch:
Or:
for: "STDIN": CustomResourceDefinition.apiextensions.k8s.io "pingsources.sources.knative.dev" is invalid: status.storedVersions[0]: Invalid value: "v1alpha1": must appear in spec.versions

Copy link
Copy Markdown
Member

@dprotaso dprotaso Jun 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this requires the storage migration job to be run before the upgrade

I do this after the upgrade in serving which is technically wrong (we've never dropped a version yet so we didn't catch it)

Loading