Skip to content

Commit

Permalink
remove v1alpha1 sources APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Apr 27, 2021
1 parent 83a1713 commit 0057654
Show file tree
Hide file tree
Showing 67 changed files with 5 additions and 5,722 deletions.
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
289 changes: 0 additions & 289 deletions config/core/resources/apiserversource.yaml

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions config/core/resources/sinkbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ spec:
group: sources.knative.dev
versions:
- &version
name: v1alpha1
name: v1alpha2
served: true
storage: false
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
Expand All @@ -52,10 +50,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
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

0 comments on commit 0057654

Please sign in to comment.