Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove v1alpha1 sources APIs #5317

Merged
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
11 changes: 2 additions & 9 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"knative.dev/eventing/pkg/apis/sources"
pingdefaultconfig "knative.dev/eventing/pkg/apis/sources/config"
sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1"
sourcesv1alpha1 "knative.dev/eventing/pkg/apis/sources/v1alpha1"
sourcesv1alpha2 "knative.dev/eventing/pkg/apis/sources/v1alpha2"
sourcesv1beta1 "knative.dev/eventing/pkg/apis/sources/v1beta1"
sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2"
Expand All @@ -71,9 +70,6 @@ var ourTypes = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
messagingv1.SchemeGroupVersion.WithKind("Subscription"): &messagingv1.Subscription{},

// For group sources.knative.dev.
// v1alpha1
sourcesv1alpha1.SchemeGroupVersion.WithKind("ApiServerSource"): &sourcesv1alpha1.ApiServerSource{},
sourcesv1alpha1.SchemeGroupVersion.WithKind("SinkBinding"): &sourcesv1alpha1.SinkBinding{},
// v1alpha2
sourcesv1alpha2.SchemeGroupVersion.WithKind("ApiServerSource"): &sourcesv1alpha2.ApiServerSource{},
sourcesv1alpha2.SchemeGroupVersion.WithKind("PingSource"): &sourcesv1alpha2.PingSource{},
Expand Down Expand Up @@ -223,7 +219,6 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro
}

var (
sourcesv1alpha1_ = sourcesv1alpha1.SchemeGroupVersion.Version
sourcesv1alpha2_ = sourcesv1alpha2.SchemeGroupVersion.Version
sourcesv1beta1_ = sourcesv1beta1.SchemeGroupVersion.Version
sourcesv1beta2_ = sourcesv1beta2.SchemeGroupVersion.Version
Expand All @@ -239,9 +234,8 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro
// Sources
sourcesv1.Kind("ApiServerSource"): {
DefinitionName: sources.ApiServerSourceResource.String(),
HubVersion: sourcesv1alpha1_,
HubVersion: sourcesv1alpha2_,
Zygotes: map[string]conversion.ConvertibleObject{
sourcesv1alpha1_: &sourcesv1alpha1.ApiServerSource{},
sourcesv1alpha2_: &sourcesv1alpha2.ApiServerSource{},
sourcesv1beta1_: &sourcesv1beta1.ApiServerSource{},
sourcesv1_: &sourcesv1.ApiServerSource{},
Expand All @@ -258,9 +252,8 @@ func NewConversionController(ctx context.Context, cmw configmap.Watcher) *contro
},
sourcesv1.Kind("SinkBinding"): {
DefinitionName: sources.SinkBindingResource.String(),
HubVersion: sourcesv1alpha1_,
HubVersion: sourcesv1alpha2_,
Zygotes: map[string]conversion.ConvertibleObject{
sourcesv1alpha1_: &sourcesv1alpha1.SinkBinding{},
sourcesv1alpha2_: &sourcesv1alpha2.SinkBinding{},
sourcesv1beta1_: &sourcesv1beta1.SinkBinding{},
sourcesv1_: &sourcesv1.SinkBinding{},
Expand Down
302 changes: 14 additions & 288 deletions config/core/resources/apiserversource.yaml

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions config/core/resources/sinkbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
group: sources.knative.dev
versions:
- &version
name: v1alpha1
name: v1alpha2
served: true
storage: false
subresources:
Expand All @@ -52,10 +52,6 @@ spec:
- name: Reason
type: string
jsonPath: ".status.conditions[?(@.type=='Ready')].reason"
- <<: *version
name: v1alpha2
served: true
storage: false
- <<: *version
name: v1beta1
served: true
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1117,13 +1117,11 @@ k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
knative.dev/hack v0.0.0-20210325223819-b6ab329907d3 h1:km0Rrh0T9/wA2pivQm1hqSPVwgNgGCHC2WNn3GakZmE=
knative.dev/hack v0.0.0-20210325223819-b6ab329907d3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack v0.0.0-20210426064739-88c69cd1eca7 h1:Z5icQ2KNCDSzTcHWMGI3KzdK/BpmgkGYdTX0RRzZul0=
knative.dev/hack v0.0.0-20210426064739-88c69cd1eca7/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/hack/schema v0.0.0-20210426064739-88c69cd1eca7 h1:ztK9WrMIOXLvCKDftybJs+AS8gNywgOiJyZEuKSEyBw=
knative.dev/hack/schema v0.0.0-20210426064739-88c69cd1eca7/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
knative.dev/pkg v0.0.0-20210420053235-1afd04993622 h1:wSyDPp/LuOLeDCpvUHgKXqb4DfmCEPelsaYzC0Fojm0=
knative.dev/pkg v0.0.0-20210420053235-1afd04993622/go.mod h1:UtcSLHy2XIz5blWoPTA40F87zk4O7erxkCwv+7Tsmws=
knative.dev/pkg v0.0.0-20210426180040-cfc1eed82870 h1:22gVDwcYqqZDGJOEBTBCthJH88dyTSLokOWlz1E9GIg=
knative.dev/pkg v0.0.0-20210426180040-cfc1eed82870/go.mod h1:UtcSLHy2XIz5blWoPTA40F87zk4O7erxkCwv+7Tsmws=
Expand Down
4 changes: 2 additions & 2 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ group "Kubernetes Codegen"
# instead of the $GOPATH directly. For normal projects this can be dropped.
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
knative.dev/eventing/pkg/client knative.dev/eventing/pkg/apis \
"eventing:v1beta1 eventing:v1 messaging:v1 flows:v1 sources:v1alpha1 sources:v1alpha2 sources:v1beta1 sources:v1beta2 sources:v1" \
"eventing:v1beta1 eventing:v1 messaging:v1 flows:v1 sources:v1alpha2 sources:v1beta1 sources:v1beta2 sources:v1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt

# Deep copy config
Expand All @@ -59,7 +59,7 @@ group "Knative Codegen"
# Knative Injection
${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \
knative.dev/eventing/pkg/client knative.dev/eventing/pkg/apis \
"eventing:v1beta1 eventing:v1 messaging:v1 flows:v1 sources:v1alpha1 sources:v1alpha2 sources:v1beta1 sources:v1beta2 sources:v1 duck:v1beta1 duck:v1" \
"eventing:v1beta1 eventing:v1 messaging:v1 flows:v1 sources:v1alpha2 sources:v1beta1 sources:v1beta2 sources:v1 duck:v1beta1 duck:v1" \
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt

group "Update deps post-codegen"
Expand Down
162 changes: 0 additions & 162 deletions pkg/apis/sources/v1alpha1/apiserver_conversion.go

This file was deleted.

Loading