-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Integrate v1 types #5483
Integrate v1 types #5483
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgerd: 12 warnings.
In response to this:
- Enable v1 API when v1beta1 is enabled
- Add v1 to the set of APIs webhook understands
v1alpha1:
- Replace inlined references with v1
v1beta1:
- Replaces all but outer shape to prevent drifting duplication. Embed v1
directly into v1beta1.- Move context logic into v1
Fixes #5246
Release Note
Add v1 API types
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@@ -97,19 +98,19 @@ func (sink *Revision) ConvertDown(ctx context.Context, obj apis.Convertible) err | |||
} | |||
|
|||
// ConvertDown helps implement apis.Convertible | |||
func (sink *RevisionTemplateSpec) ConvertDown(ctx context.Context, source v1beta1.RevisionTemplateSpec) error { | |||
func (sink *RevisionTemplateSpec) ConvertDown(ctx context.Context, source v1.RevisionTemplateSpec) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for RevisionTemplateSpec. More info.
sink.ObjectMeta = source.ObjectMeta | ||
return sink.Spec.ConvertDown(ctx, source.Spec) | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *RevisionSpec) ConvertDown(ctx context.Context, source v1beta1.RevisionSpec) error { | ||
func (sink *RevisionSpec) ConvertDown(ctx context.Context, source v1.RevisionSpec) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for RevisionSpec. More info.
sink.RevisionSpec = *source.DeepCopy() | ||
return nil | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *RevisionStatus) ConvertDown(ctx context.Context, source v1beta1.RevisionStatus) { | ||
func (sink *RevisionStatus) ConvertDown(ctx context.Context, source v1.RevisionStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for RevisionStatus. More info.
default: | ||
return fmt.Errorf("unknown version, got: %T", source) | ||
} | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *ServiceSpec) ConvertDown(ctx context.Context, source v1beta1.ServiceSpec) error { | ||
func (sink *ServiceSpec) ConvertDown(ctx context.Context, source v1.ServiceSpec) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for ServiceSpec. More info.
sink.RouteSpec.ConvertDown(ctx, source.RouteSpec) | ||
return sink.ConfigurationSpec.ConvertDown(ctx, source.ConfigurationSpec) | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *ServiceStatus) ConvertDown(ctx context.Context, source v1beta1.ServiceStatus) error { | ||
func (sink *ServiceStatus) ConvertDown(ctx context.Context, source v1.ServiceStatus) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for ServiceStatus. More info.
sink.TrafficTarget = source | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *RouteStatus) ConvertDown(ctx context.Context, source v1beta1.RouteStatus) { | ||
func (sink *RouteStatus) ConvertDown(ctx context.Context, source v1.RouteStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for RouteStatus. More info.
source.Status.ConvertTo(ctx, &sink.Status) | ||
|
||
sink.RouteStatusFields.ConvertDown(ctx, source.RouteStatusFields) | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *RouteStatusFields) ConvertDown(ctx context.Context, source v1beta1.RouteStatusFields) { | ||
func (sink *RouteStatusFields) ConvertDown(ctx context.Context, source v1.RouteStatusFields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for RouteStatusFields. More info.
default: | ||
return fmt.Errorf("unknown version, got: %T", source) | ||
} | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *ConfigurationSpec) ConvertDown(ctx context.Context, source v1beta1.ConfigurationSpec) error { | ||
func (sink *ConfigurationSpec) ConvertDown(ctx context.Context, source v1.ConfigurationSpec) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for ConfigurationSpec. More info.
sink.Template = &RevisionTemplateSpec{} | ||
return sink.Template.ConvertDown(ctx, source.Template) | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *ConfigurationStatus) ConvertDown(ctx context.Context, source v1beta1.ConfigurationStatus) error { | ||
func (sink *ConfigurationStatus) ConvertDown(ctx context.Context, source v1.ConfigurationStatus) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for ConfigurationStatus. More info.
source.Status.ConvertTo(ctx, &sink.Status) | ||
|
||
return sink.ConfigurationStatusFields.ConvertDown(ctx, source.ConfigurationStatusFields) | ||
} | ||
|
||
// ConvertDown helps implement apis.Convertible | ||
func (sink *ConfigurationStatusFields) ConvertDown(ctx context.Context, source v1beta1.ConfigurationStatusFields) error { | ||
func (sink *ConfigurationStatusFields) ConvertDown(ctx context.Context, source v1.ConfigurationStatusFields) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golint naming: receiver name sink should be consistent with previous receiver name source for ConfigurationStatusFields. More info.
/test pull-knative-serving-unit-tests |
* Enable v1 API when v1beta1 is enabled * Add v1 to the set of APIs webhook understands v1alpha1: * Replace inlined references with v1 v1beta1: * Replaces all but outer shape to prevent drifting duplication. Embed v1 directly into v1beta1. * Move context logic into v1
The following jobs failed due to test flakiness:
Automatically retrying... |
} | ||
t.Errorf("ConvertUp() = %v", err) | ||
} else if test.badField != "" { | ||
t.Errorf("CovnertUp() = %#v, wanted bad field %q", ver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Errorf("CovnertUp() = %#v, wanted bad field %q", ver, | |
t.Errorf("ConvertUp() = %#v, wanted bad field %q", ver, |
The following is the coverage report on pkg/.
|
Tests failures are existing races and don't seem relevant to this change. /test pull-knative-serving-unit-tests |
/assign @mattmoor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgerd, mattmoor The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
v1alpha1:
v1beta1:
directly into v1beta1.
Fixes #5246
Release Note