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
9 changes: 4 additions & 5 deletions pkg/apis/feeds/v1alpha1/cluster_event_source_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ limitations under the License.

package v1alpha1

func (ces *ClusterEventSource) SetDefaults() {
ces.Spec.SetDefaults()
func (es *ClusterEventSource) SetDefaults() {
es.Spec.SetDefaults()
}

func (cess *ClusterEventSourceSpec) SetDefaults() {
cess.CommonEventSourceSpec.SetDefaults()
// TODO anything?
func (ess *ClusterEventSourceSpec) SetDefaults() {
ess.CommonEventSourceSpec.SetDefaults()
}
1 change: 0 additions & 1 deletion pkg/apis/feeds/v1alpha1/cluster_event_source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type ClusterEventSource struct {
// Check that ClusterEventSource can be validated, can be defaulted, and has immutable fields.
var _ apis.Validatable = (*ClusterEventSource)(nil)
var _ apis.Defaultable = (*ClusterEventSource)(nil)
var _ apis.Immutable = (*ClusterEventSource)(nil)
var _ runtime.Object = (*ClusterEventSource)(nil)
var _ webhook.GenericCRD = (*ClusterEventSource)(nil)

Expand Down
22 changes: 4 additions & 18 deletions pkg/apis/feeds/v1alpha1/cluster_event_source_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,10 @@ import (
"github.com/knative/pkg/apis"
)

func (ces *ClusterEventSource) Validate() *apis.FieldError {
return ces.Spec.Validate().ViaField("spec")
func (es *ClusterEventSource) Validate() *apis.FieldError {
return es.Spec.Validate().ViaField("spec")
}

func (cess *ClusterEventSourceSpec) Validate() *apis.FieldError {
return cess.CommonEventSourceSpec.Validate()
}

func (current *ClusterEventSource) CheckImmutableFields(og apis.Immutable) *apis.FieldError {
original, ok := og.(*ClusterEventSource)
if !ok {
return &apis.FieldError{Message: "The provided original was not a ClusterEventSource"}
}
if original == nil {
return nil
}

// TODO

return nil
func (ess *ClusterEventSourceSpec) Validate() *apis.FieldError {
return ess.CommonEventSourceSpec.Validate()
}
2 changes: 1 addition & 1 deletion pkg/apis/feeds/v1alpha1/common_event_source_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ limitations under the License.
package v1alpha1

func (cess *CommonEventSourceSpec) SetDefaults() {
// TODO anything?
// nothing to default
}
2 changes: 1 addition & 1 deletion pkg/apis/feeds/v1alpha1/common_event_source_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ import (
)

func (cess *CommonEventSourceSpec) Validate() *apis.FieldError {
// TODO
// nothing to validate
return nil
}
1 change: 0 additions & 1 deletion pkg/apis/feeds/v1alpha1/event_source_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ func (es *EventSource) SetDefaults() {

func (ess *EventSourceSpec) SetDefaults() {
ess.CommonEventSourceSpec.SetDefaults()
// TODO anything?
}
1 change: 0 additions & 1 deletion pkg/apis/feeds/v1alpha1/event_source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type EventSource struct {
// Check that EventSource can be validated, can be defaulted, and has immutable fields.
var _ apis.Validatable = (*EventSource)(nil)
var _ apis.Defaultable = (*EventSource)(nil)
var _ apis.Immutable = (*EventSource)(nil)
var _ runtime.Object = (*EventSource)(nil)
var _ webhook.GenericCRD = (*EventSource)(nil)

Expand Down
14 changes: 0 additions & 14 deletions pkg/apis/feeds/v1alpha1/event_source_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,3 @@ func (es *EventSource) Validate() *apis.FieldError {
func (ess *EventSourceSpec) Validate() *apis.FieldError {
return ess.CommonEventSourceSpec.Validate()
}

func (current *EventSource) CheckImmutableFields(og apis.Immutable) *apis.FieldError {
original, ok := og.(*EventSource)
if !ok {
return &apis.FieldError{Message: "The provided original was not a EventSource"}
}
if original == nil {
return nil
}

// TODO

return nil
}