Skip to content

Commit

Permalink
Fix the Kind in the GVK returned by KnativeEventing. (knative#214) (k…
Browse files Browse the repository at this point in the history
…native#24)

Co-authored-by: Markus Thömmes <[email protected]>

Co-authored-by: Jim Crossley <[email protected]>
Co-authored-by: Markus Thömmes <[email protected]>
  • Loading branch information
3 people authored Jul 24, 2020
1 parent b366cf8 commit 410ecb5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/operator/v1alpha1/knativeeventing_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var eventingCondSet = apis.NewLivingConditionSet(

// GroupVersionKind returns SchemeGroupVersion of an KnativeEventing
func (e *KnativeEventing) GroupVersionKind() schema.GroupVersionKind {
return SchemeGroupVersion.WithKind(Kind)
return SchemeGroupVersion.WithKind(KindKnativeEventing)
}

// GetCondition returns the current condition of a given condition type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestKnativeEventingGroupVersionKind(t *testing.T) {
want := schema.GroupVersionKind{
Group: GroupName,
Version: SchemaVersion,
Kind: Kind,
Kind: KindKnativeEventing,
}
if got := r.GroupVersionKind(); got != want {
t.Errorf("got: %v, want: %v", got, want)
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/operator/v1alpha1/knativeserving_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var conditions = apis.NewLivingConditionSet(

// GroupVersionKind returns SchemeGroupVersion of a KnativeServing
func (ks *KnativeServing) GroupVersionKind() schema.GroupVersionKind {
return SchemeGroupVersion.WithKind(Kind)
return SchemeGroupVersion.WithKind(KindKnativeServing)
}

func (is *KnativeServingStatus) IsReady() bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestKnativeServingGroupVersionKind(t *testing.T) {
want := schema.GroupVersionKind{
Group: GroupName,
Version: SchemaVersion,
Kind: Kind,
Kind: KindKnativeServing,
}
if got := r.GroupVersionKind(); got != want {
t.Errorf("got: %v, want: %v", got, want)
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/operator/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ const (
// The Version of the schema. This is used for CRDs.
SchemaVersion = "v1alpha1"

// The Kind of the custom resource. This is used for CRDs.
Kind = "KnativeServing"
// KindKnativeEventing is the Kind of Knative Eventing in a GVK context.
KindKnativeEventing = "KnativeEventing"
// KindKnativeServing is the Kind of Knative Serving in a GVK context.
KindKnativeServing = "KnativeServing"
)

// Resource takes an unqualified resource and returns a Group qualified GroupResource
Expand Down

0 comments on commit 410ecb5

Please sign in to comment.