Skip to content

Commit

Permalink
Automatic gen bump for configmappropagation (#3227)
Browse files Browse the repository at this point in the history
  • Loading branch information
whaught authored May 29, 2020
1 parent 022e95a commit d87d228
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/apis/configs/v1alpha1/configmappropagation_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const (
ConfigMapPropagationConditionPropagated apis.ConditionType = "Propagated"
)

// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.
func (*ConfigMapPropagation) GetConditionSet() apis.ConditionSet {
return configMapPropagationCondSet
}

// GetCondition returns the condition currently associated with the given type, or nil.
func (cmps *ConfigMapPropagationStatus) GetCondition(t apis.ConditionType) *apis.Condition {
return configMapPropagationCondSet.Manage(cmps).GetCondition(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ var (
}
)

func TestConfigMapPropagationGetConditionSet(t *testing.T) {
cmp := &ConfigMapPropagation{}

if got, want := cmp.GetConditionSet().GetTopLevelConditionType(), apis.ConditionReady; got != want {
t.Errorf("GetTopLevelCondition=%v, want=%v", got, want)
}
}

func TestConfigMapPropagationGetCondition(t *testing.T) {
tests := []struct {
name string
Expand Down
10 changes: 9 additions & 1 deletion pkg/apis/configs/v1alpha1/configmappropagation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

// +genclient
// +genreconciler
// +genreconciler:krshapedlogic=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ConfigMapPropagation is used to propagate configMaps from original namespace to current namespace
Expand Down Expand Up @@ -57,6 +57,9 @@ var (

// Check that we can create OwnerReferences to a ConfigMapPropagation.
_ kmeta.OwnerRefable = (*ConfigMapPropagation)(nil)

// Check that the type conforms to the duck Knative Resource shape.
_ duckv1.KRShaped = (*ConfigMapPropagation)(nil)
)

type ConfigMapPropagationSpec struct {
Expand Down Expand Up @@ -122,3 +125,8 @@ func (cmp *ConfigMapPropagation) GetGroupVersionKind() schema.GroupVersionKind {
func (cmp *ConfigMapPropagation) GetUntypedSpec() interface{} {
return cmp.Spec
}

// GetStatus retrieves the status of the ConfigMapPropagation. Implements the KRShaped interface.
func (cmp *ConfigMapPropagation) GetStatus() *duckv1.Status {
return &cmp.Status.Status
}
9 changes: 9 additions & 0 deletions pkg/apis/configs/v1alpha1/configmappropagation_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ import (
"testing"
)

func TestConfigMapPropagation_GetStatus(t *testing.T) {
r := &ConfigMapPropagation{
Status: ConfigMapPropagationStatus{},
}
if got, want := r.GetStatus(), &r.Status.Status; got != want {
t.Errorf("GetStatus=%v, want=%v", got, want)
}
}

func TestConfigMapPropagation_GetGroupVersionKind(t *testing.T) {
cmp := ConfigMapPropagation{}
gvk := cmp.GetGroupVersionKind()
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/eventing/v1beta1/broker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ var (
// Check that we can create OwnerReferences to a Broker.
_ kmeta.OwnerRefable = (*Broker)(nil)

// Check that the type conforms to the duck Knative Resource shape.
_ duckv1.KRShaped = (*Broker)(nil)
)

Expand Down
1 change: 1 addition & 0 deletions pkg/apis/eventing/v1beta1/eventtype_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var (
// Check that we can create OwnerReferences to an EventType.
_ kmeta.OwnerRefable = (*EventType)(nil)

// Check that the type conforms to the duck Knative Resource shape.
_ duckv1.KRShaped = (*EventType)(nil)
)

Expand Down
1 change: 1 addition & 0 deletions pkg/apis/eventing/v1beta1/trigger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var (
// Check that we can create OwnerReferences to a Trigger.
_ kmeta.OwnerRefable = (*Trigger)(nil)

// Check that the type conforms to the duck Knative Resource shape.
_ duckv1.KRShaped = (*Trigger)(nil)
)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d87d228

Please sign in to comment.