Skip to content
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

Merged
merged 5 commits into from
Sep 12, 2019
Merged

Integrate v1 types #5483

merged 5 commits into from
Sep 12, 2019

Conversation

dgerd
Copy link

@dgerd dgerd commented Sep 11, 2019

  • 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

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 11, 2019
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 11, 2019
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/API API objects and controllers area/networking area/test-and-release It flags unit/e2e/conformance/perf test issues for product features labels Sep 11, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a 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 {
Copy link
Contributor

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 {
Copy link
Contributor

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) {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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.

@dgerd
Copy link
Author

dgerd commented Sep 11, 2019

/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
@knative-test-reporter-robot

The following jobs failed due to test flakiness:

Test name Triggers Retries
pull-knative-serving-integration-tests pull-knative-serving-integration-tests 1/3

Automatically retrying...
/test pull-knative-serving-integration-tests

@dgerd dgerd changed the title [WIP] Integrate v1 types Integrate v1 types Sep 11, 2019
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 11, 2019
}
t.Errorf("ConvertUp() = %v", err)
} else if test.badField != "" {
t.Errorf("CovnertUp() = %#v, wanted bad field %q", ver,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.Errorf("CovnertUp() = %#v, wanted bad field %q", ver,
t.Errorf("ConvertUp() = %#v, wanted bad field %q", ver,

@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/configuration_conversion.go 90.3% 94.9% 4.5
pkg/apis/serving/v1alpha1/service_conversion.go 97.2% 95.5% -1.8
pkg/apis/serving/v1beta1/configuration_lifecycle.go 50.0% 100.0% 50.0
pkg/apis/serving/v1beta1/revision_defaults.go 88.6% 100.0% 11.4
pkg/apis/serving/v1beta1/revision_validation.go 95.2% 93.3% -1.9
pkg/apis/serving/v1beta1/route_lifecycle.go 50.0% 100.0% 50.0
pkg/apis/serving/v1beta1/service_lifecycle.go 50.0% 100.0% 50.0

@dgerd
Copy link
Author

dgerd commented Sep 12, 2019

Tests failures are existing races and don't seem relevant to this change.

/test pull-knative-serving-unit-tests

@dgerd
Copy link
Author

dgerd commented Sep 12, 2019

/assign @mattmoor

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2019
@knative-prow-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 12, 2019
@knative-prow-robot knative-prow-robot merged commit b818dce into knative:master Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/networking area/test-and-release It flags unit/e2e/conformance/perf test issues for product features cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add v1 API Types
6 participants