-
Notifications
You must be signed in to change notification settings - Fork 472
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
Delete RouteObjectReference; make group optional; add godoc #111
Delete RouteObjectReference; make group optional; add godoc #111
Conversation
Hi @Miciah. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @bowei |
@Miciah can you run |
/ok-to-test |
89212ae
to
94c34a7
Compare
Rebased for #110. |
94c34a7
to
2911ad9
Compare
Rebased for #30. |
@@ -140,7 +140,6 @@ type HTTPRouteMatch struct { | |||
// within a known namespace. | |||
// | |||
// +k8s:deepcopy-gen=false | |||
// +protobuf=false |
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.
@howardjohn, I had to delete this specific marker or else go-to-protobuf
failed with the following output:
topological order io
topological order bytes
topological order go/ast
topological order encoding/base64
topological order strings
topological order k8s.io/apimachinery/pkg/fields
topological order sync
topological order go/token
topological order k8s.io/apimachinery/pkg/watch
topological order k8s.io/apimachinery/pkg/selection
topological order k8s.io/apimachinery/pkg/conversion/queryparams
topological order strconv
topological order github.com/google/gofuzz
topological order go/parser
topological order reflect
topological order sync/atomic
topological order encoding/json
topological order github.com/gogo/protobuf/sortkeys
topological order fmt
topological order k8s.io/apimachinery/pkg/util/runtime
topological order k8s.io/apimachinery/pkg/util/naming
topological order time
topological order k8s.io/apimachinery/pkg/util/json
topological order github.com/gogo/protobuf/proto
topological order k8s.io/apimachinery/pkg/api/resource
topological order net/url
topological order k8s.io/apimachinery/pkg/types
topological order k8s.io/klog
topological order k8s.io/apimachinery/pkg/util/errors
topological order k8s.io/apimachinery/pkg/conversion
topological order math/bits
topological order errors
topological order go/doc
topological order math
topological order k8s.io/apimachinery/pkg/runtime/schema
topological order k8s.io/apimachinery/pkg/util/intstr
topological order unsafe
topological order k8s.io/apimachinery/pkg/labels
topological order os
topological order k8s.io/apimachinery/pkg/util/sets
topological order k8s.io/apimachinery/pkg/runtime
topological order k8s.io/apimachinery/pkg/apis/meta/v1
topological order sigs.k8s.io/controller-runtime/pkg/scheme
topological order k8s.io/api/core/v1
topological order sigs.k8s.io/service-apis/api/v1alpha1
2020/02/27 23:33:32 sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:142:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:300:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:312:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:334:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:371:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:424:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:513:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto:586:12: "LocalObjectReference" is not defined.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto: warning: Import sigs.k8s.io/controller-runtime/pkg/scheme/generated.proto but not used.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto: warning: Import k8s.io/apimachinery/pkg/runtime/schema/generated.proto but not used.
sigs.k8s.io/service-apis/api/v1alpha1/generated.proto: warning: Import k8s.io/api/core/v1/generated.proto but not used.
2020/02/27 23:33:32 protoc -I . -I /home/mmasters/src -I /home/mmasters/src/sigs.k8s.io/service-apis/vendor -I /home/mmasters/src/sigs.k8s.io/service-apis/third_party/protobuf --gogo_out=/home/mmasters/src /home/mmasters/src/sigs.k8s.io/service-apis/api/v1alpha1/generated.proto
2020/02/27 23:33:32 Unable to generate protoc on k8s.io.service_apis.api.v1alpha1: exit status 1
exit status 1
I have not tried using the container image, but I cannot see how that would make a difference. Anyway, go-to-protobuf
was happy whether I deleted this marker or all of them, so I deleted all of them.
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.
Ok as long as it builds it should be good, maybe your change fixed the issue we were working around. I am not sure the CI would fail if it doesn't build though, maybe be worth running a quick go build ./...
?
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.
go build ./...
succeeded (no output; exit status 0).
2911ad9
to
1f6da51
Compare
192a970
to
809a65d
Compare
809a65d
to
c002ee4
Compare
Rebased. Latest push also deletes |
api/v1alpha1/gateway_types.go
Outdated
// the empty string for the group) or an implementation-defined resource | ||
// (for example, resource "mylistener" in group "networking.acme.io"). | ||
// ExtensionRef for this Listener. The resource may be "configmaps" | ||
// (omit or use the empty string for the group) or an |
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.
@Miciah IMO this is easier to read when "(omit or use the empty string for the group)" is removed.
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.
Updated.
api/v1alpha1/generated.proto
Outdated
// the empty string for the group) or an implementation-defined resource | ||
// (for example, resource "mylistener" in group "networking.acme.io"). | ||
// ExtensionRef for this Listener. The resource may be "configmaps" | ||
// (omit or use the empty string for the group) or an |
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.
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.
Regenerated. Thanks!
Other than a nit to improve the |
c002ee4
to
d056a47
Compare
/lgtm |
/lgtm |
Delete the unused RouteObjectReference type. Delete +protobuf=false markers on type aliases for LocalObjectReference as the markers now cause go-to-protobuf to fail with '"LocalObjectReference" is not defined'. Follow-up to commit 8dcf12b. * api/v1alpha1/gateway_types.go (CertificateObjectReference) (ListenerExtensionObjectReference): Delete +protobuf=false markers. (RouteObjectReference): Delete definition. * api/v1alpha1/gatewayclass_types.go (GatewayClassParametersObjectReference): * api/v1alpha1/httproute_types.go (RouteMatchExtensionObjectReference) (RouteFilterExtensionObjectReference, RouteActionTargetObjectReference) (RouteActionExtensionObjectReference, RouteHostExtensionObjectReference): Delete +protobuf=false markers. * api/v1alpha1/generated.proto: Regenerate.
Allow omitting the group specification in object references, and document default values for group and resource. Before this commit, the group could be the empty string but could not be omitted (that is, left unspecified in json or yaml definitions). * api/v1alpha1/gateway_types.go (Listener): Document the default values for group and resource for the listener extension object reference (the defaults are core and configmaps, respectively). (ListenerTLS): Document the default values for group and resource for certificate object references (the defaults are core and secrets, respectively). (LocalObjectReference): Make group optional. * api/v1alpha1/gatewayclass_types.go (GatewayClassSpec): Document the default values for group and resource for the parameters object reference (the defaults are core and configmaps, respectively). * api/v1alpha1/httproute_types.go (HTTPRouteHost): Document the default values for group and resource for the extension object reference (the defaults are core and configmaps, respectively). (HTTPRouteMatch): Document the default values for group and resource for the extension object reference (the defaults are core and configmaps, respectively). (HTTPRouteFilter): Document the default values for group and resource for the extension object reference (the defaults are core and configmaps, respectively). (HTTPRouteAction): Document the default values for group and resource for the target object reference (for which the defaults are core and services, respectively) and for the extension object reference (for which the defaults are core and configmaps, respectively). * api/v1alpha1/generated.proto: * config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml: * config/crd/bases/networking.x-k8s.io_gateways.yaml: * config/crd/bases/networking.x-k8s.io_httproutes.yaml: Regenerate.
For each API field that specifies an object reference, document the expected behavior when the field's referent cannot be found. * api/v1alpha1/gateway_types.go (GatewaySpec, Listener, ListenerTLS): * api/v1alpha1/gatewayclass_types.go (GatewayClassSpec): * api/v1alpha1/httproute_types.go (HTTPRouteHost, HTTPRouteMatch) (HTTPRouteFilter, HTTPRouteAction): Document behavior for missing referents. * api/v1alpha1/generated.proto: * config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml: * config/crd/bases/networking.x-k8s.io_gateways.yaml: * config/crd/bases/networking.x-k8s.io_httproutes.yaml: Regenerate.
Add an example reference to a service object and an example reference to a custom resource. * api/v1alpha1/gateway_types.go (LocalObjectReference): Add example reference specifications. * api/v1alpha1/generated.proto: * config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml: * config/crd/bases/networking.x-k8s.io_gateways.yaml: * config/crd/bases/networking.x-k8s.io_httproutes.yaml: Regenerate.
Rename fields that are object references in order to follow the community API conventions. * api/v1alpha1/gateway_types.go (Listener): Rename "extension" field to "extensionRef". (ListenerTLS): Rename "certificates" field to "certificateRefs". * api/v1alpha1/gatewayclass_types.go (GatewayClassSpec): Rename "parameters" field to "parametersRef". * api/v1alpha1/httproute_types.go (HTTPRouteHost, HTTPRouteMatch) (HTTPRouteFilter, HTTPRouteAction): Rename "extension" fields to "extensionRef". (HTTPRouteAction): Rename "forwardTo" field to "forwardTargetRef". (HTTPRouteStatus): Rename "gateways" field to "gatewayRefs". * api/v1alpha1/generated.pb.go: * api/v1alpha1/generated.proto: * api/v1alpha1/zz_generated.deepcopy.go: * config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml: * config/crd/bases/networking.x-k8s.io_gateways.yaml: * config/crd/bases/networking.x-k8s.io_httproutes.yaml: Regenerate.
d056a47
to
bb8f995
Compare
Rebased; dropped "Regenerate CRDs with new group name" (superseded by #155). |
Thanks! /lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, Miciah 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 |
Follow-up to #73.
Related to #83, which discusses the relationship between gateways and routes.
Related to #109, which discusses inferring group and resource in references.
Delete
RouteObjectReference
Delete the unused
RouteObjectReference
type.Delete
+protobuf=false
markers on type aliases forLocalObjectReference
as the markers now causego-to-protobuf
to fail with"LocalObjectReference" is not defined
.Follow-up to #12.
api/v1alpha1/gateway_types.go
(CertificateObjectReference
,ListenerExtensionObjectReference
): Delete+protobuf=false
markers.(
RouteObjectReference
): Delete definition.api/v1alpha1/gatewayclass_types.go
(GatewayClassParametersObjectReference
):api/v1alpha1/httproute_types.go
(RouteMatchExtensionObjectReference
,RouteFilterExtensionObjectReference
,RouteActionTargetObjectReference
,RouteActionExtensionObjectReference
,RouteHostExtensionObjectReference
): Delete+protobuf=false
markers.api/v1alpha1/generated.proto
: Regenerate.Make group optional in object references
Allow omitting the group specification in object references, and document default values for group and resource.
Before this commit, the group could be the empty string but could not be omitted (that is, left unspecified in json or yaml definitions).
api/v1alpha1/gateway_types.go
(Listener
): Document the default values for group and resource for the listener extension object reference (the defaults are core and configmaps, respectively).(
ListenerTLS
): Document the default values for group and resource for certificate object references (the defaults are core and secrets, respectively).(
LocalObjectReference
): Make group optional.api/v1alpha1/gatewayclass_types.go
(GatewayClassSpec
): Document the default values for group and resource for the parameters object reference (the defaults are core and configmaps, respectively).api/v1alpha1/httproute_types.go
(HTTPRouteHost
): Document the default values for group and resource for the extension object reference (the defaults are core and configmaps, respectively).(
HTTPRouteMatch
): Document the default values for group and resource for the extension object reference (the defaults are core and configmaps, respectively).(
HTTPRouteFilter
): Document the default values for group and resource for the extension object reference (the defaults are core and configmaps, respectively).(
HTTPRouteAction
): Document the default values for group and resource for the target object reference (for which the defaults are core and services, respectively) and for the extension object reference (for which the defaults are core and configmaps, respectively).api/v1alpha1/generated.proto
:config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml
:config/crd/bases/networking.x-k8s.io_gateways.yaml
:config/crd/bases/networking.x-k8s.io_httproutes.yaml
: Regenerate.Document behavior for missing referents
For each API field that specifies an object reference, document the expected behavior when the field's referent cannot be found.
api/v1alpha1/gateway_types.go
(GatewaySpec
,Listener
,ListenerTLS
):api/v1alpha1/gatewayclass_types.go
(GatewayClassSpec
):api/v1alpha1/httproute_types.go
(HTTPRouteHost
,HTTPRouteMatch
,HTTPRouteFilter
,HTTPRouteAction
): Document behavior for missing referents.api/v1alpha1/generated.proto
:config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml
:config/crd/bases/networking.x-k8s.io_gateways.yaml
:config/crd/bases/networking.x-k8s.io_httproutes.yaml
: Regenerate.Add examples to
LocalObjectReference
Add an example reference to a service object and an example reference to a custom resource.
api/v1alpha1/gateway_types.go
(LocalObjectReference
): Add example reference specifications.api/v1alpha1/generated.proto
:config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml
:config/crd/bases/networking.x-k8s.io_gateways.yaml
:config/crd/bases/networking.x-k8s.io_httproutes.yaml
: Regenerate.Use
fooRef
naming convention for object referencesRename fields that are object references in order to follow the community API conventions.
api/v1alpha1/gateway_types.go
(Listener
): Rename "extension" field to "extensionRef".(
ListenerTLS
): Rename "certificates" field to "certificateRefs".api/v1alpha1/gatewayclass_types.go
(GatewayClassSpec
): Rename "parameters" field to "parametersRef".api/v1alpha1/httproute_types.go
(HTTPRouteHost
,HTTPRouteMatch
,HTTPRouteFilter
,HTTPRouteAction
): Rename "extension" fields to "extensionRef".(
HTTPRouteAction
): Rename "forwardTo" field to "forwardTargetRef".(
HTTPRouteStatus
): Rename "gateways" field to "gatewayRefs".api/v1alpha1/generated.pb.go
:api/v1alpha1/generated.proto
:api/v1alpha1/zz_generated.deepcopy.go
:config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml
:config/crd/bases/networking.x-k8s.io_gateways.yaml
:config/crd/bases/networking.x-k8s.io_httproutes.yaml
: Regenerate.