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
1 change: 0 additions & 1 deletion apis/v1alpha2/referencegrant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
// +genclient
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=gateway-api,shortName=refgrant
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
Comment thread
KillianGolds marked this conversation as resolved.
// +kubebuilder:skipversion
// +kubebuilder:deprecatedversion:warning="The v1alpha2 version of ReferenceGrant has been deprecated and will be removed in a future release of the API. Please upgrade to v1beta1."

Expand Down
18 changes: 17 additions & 1 deletion apisx/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type (
Hostname = v1.Hostname
Kind = v1.Kind
ObjectName = v1.ObjectName
PortNumber = v1.PortNumber
ProtocolType = v1.ProtocolType
RouteGroupKind = v1.RouteGroupKind
SectionName = v1.SectionName
Expand All @@ -38,6 +37,23 @@ type (
SessionPersistence = v1.SessionPersistence
)

// PortNumberWith0 defines a network port that allows 0 to indicate dynamic
// port assignment. This type should only be used in spec fields where port 0
// has the special meaning of "auto-assign a port". In most cases,
// StatusPortNumber (which excludes 0) should be preferred.
//
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
type PortNumberWith0 int32

// StatusPortNumber defines a network port in status fields.
// Unlike PortNumberWith0, this does not allow 0 since status fields
// reflect actual assigned ports.
//
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
type StatusPortNumber int32

// ParentGatewayReference identifies an API object including its namespace,
// defaulting to Gateway.
type ParentGatewayReference struct {
Expand Down
9 changes: 2 additions & 7 deletions apisx/v1alpha1/xlistenerset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ type ListenerEntry struct {
// +optional
//
// +kubebuilder:default=0
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
Port PortNumber `json:"port,omitempty"`
Port PortNumberWith0 `json:"port,omitempty"`

// Protocol specifies the network protocol this listener expects to receive.
// +required
Expand Down Expand Up @@ -253,11 +251,8 @@ type ListenerEntryStatus struct {

// Port is the network port the listener is configured to listen on.
//
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
//
// +required
Port PortNumber `json:"port"`
Port StatusPortNumber `json:"port"`

// SupportedKinds is the list indicating the Kinds supported by this
// listener. This MUST represent the kinds an implementation supports for
Expand Down
5 changes: 3 additions & 2 deletions applyconfiguration/apisx/v1alpha1/listenerentry.go

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

5 changes: 3 additions & 2 deletions applyconfiguration/apisx/v1alpha1/listenerentrystatus.go

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

7 changes: 7 additions & 0 deletions hack/update-clientset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ go run sigs.k8s.io/controller-tools/cmd/controller-gen \
object:headerFile=${SCRIPT_ROOT}/hack/boilerplate/boilerplate.generatego.txt \
paths="./apis/..." \
paths="./apisx/..."

echo "Validating CRD markers"
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
crd \
paths="./apis/..." \
paths="./apisx/..." \
output:none