Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
399f3ab
chore: bump Gateway API to v1.4.0-rc.1
zirain Sep 29, 2025
1921a99
bump to rc.2
zirain Sep 30, 2025
fded917
fix test
zirain Sep 30, 2025
e98591f
fix gen
zirain Sep 30, 2025
185e16f
skip BackendTLSPolicyInvalidCACertificateRef
zirain Sep 30, 2025
803a803
skip BackendTLSPolicyInvalidKind
zirain Sep 30, 2025
608e6a0
fix test
zirain Sep 30, 2025
21a0ed1
skip
zirain Sep 30, 2025
e383c87
fix test and skip more
zirain Sep 30, 2025
dd710fe
fix cmp.Equal
zirain Sep 30, 2025
a259655
skip TLSRoute tests
zirain Sep 30, 2025
34655e3
fix
zirain Sep 30, 2025
cd5e19c
golint integration
zirain Sep 30, 2025
c64691a
skip UDPRoute
zirain Sep 30, 2025
d82ac29
Merge branch 'main' into bump-gatewayapi
zirain Sep 30, 2025
2b70b21
Merge branch 'main' into bump-gatewayapi
zirain Oct 1, 2025
4c33cab
use gwapiv1a3.TLSRoute
zirain Oct 1, 2025
f2bd539
fix test
zirain Oct 1, 2025
ce57cec
fix test
zirain Oct 1, 2025
c603148
fix test
zirain Oct 2, 2025
72dbc6f
use gwapiv1.BackendTLSPolicy and fix lint
zirain Oct 2, 2025
11c205d
fix e2e
zirain Oct 2, 2025
79ef3ae
enable UDPRoute
zirain Oct 2, 2025
d3337f8
fix e2e
zirain Oct 2, 2025
013dfd6
revert
zirain Oct 2, 2025
f4abc1e
skip on dual
zirain Oct 2, 2025
7d24a4e
Merge branch 'main' into bump-gatewayapi
zirain Oct 2, 2025
7d1bbd3
Merge branch 'main' into bump-gatewayapi
zirain Oct 3, 2025
d837568
Merge branch 'main' into bump-gatewayapi
zirain Oct 6, 2025
a51add4
fix merge
zirain Oct 6, 2025
cc4e8fb
Merge branch 'main' into bump-gatewayapi
zirain Oct 7, 2025
04699e0
bump v1.4.0
zirain Oct 7, 2025
57e2606
revert to v1alpha3
zirain Oct 7, 2025
7b09cb7
Merge branch 'main' into bump-gatewayapi
zirain Oct 9, 2025
28ad29c
fix gen
zirain Oct 9, 2025
c5bdc58
fix after merge
zirain Oct 9, 2025
8d579cf
use v1
zirain Oct 9, 2025
4332c70
Merge branch 'main' into bump-gatewayapi
zirain Oct 9, 2025
650cb85
Merge branch 'main' into bump-gatewayapi
zirain Oct 11, 2025
b0b91ba
Merge branch 'main' into bump-gatewayapi
zirain Oct 12, 2025
063c03f
Merge branch 'main' into bump-gatewayapi
zirain Oct 12, 2025
28342be
Merge branch 'main' into bump-gatewayapi
zirain Oct 14, 2025
8d6622b
Merge branch 'main' into bump-gatewayapi
zirain Oct 16, 2025
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
3 changes: 1 addition & 2 deletions api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
gwapiv1a3 "sigs.k8s.io/gateway-api/apis/v1alpha3"
)

const (
Expand Down Expand Up @@ -196,7 +195,7 @@ type BackendTLSSettings struct {
// CACertificateRefs or WellKnownCACertificates may be specified, not both.
//
// +optional
WellKnownCACertificates *gwapiv1a3.WellKnownCACertificatesType `json:"wellKnownCACertificates,omitempty"`
WellKnownCACertificates *gwapiv1.WellKnownCACertificatesType `json:"wellKnownCACertificates,omitempty"`

// InsecureSkipVerify indicates whether the upstream's certificate verification
// should be skipped. Defaults to "false".
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/backendtrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)

const (
Expand All @@ -31,7 +31,7 @@ type BackendTrafficPolicy struct {
Spec BackendTrafficPolicySpec `json:"spec"`

// status defines the current status of BackendTrafficPolicy.
Status gwapiv1a2.PolicyStatus `json:"status,omitempty"`
Status gwapiv1.PolicyStatus `json:"status,omitempty"`
}

// BackendTrafficPolicySpec defines the desired state of BackendTrafficPolicy.
Expand Down
9 changes: 4 additions & 5 deletions api/v1alpha1/clienttrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)

const (
Expand All @@ -30,17 +30,16 @@ type ClientTrafficPolicy struct {
Spec ClientTrafficPolicySpec `json:"spec"`

// Status defines the current status of ClientTrafficPolicy.
Status gwapiv1a2.PolicyStatus `json:"status,omitempty"`
Status gwapiv1.PolicyStatus `json:"status,omitempty"`
}

// +kubebuilder:validation:XValidation:rule="(has(self.targetRef) && !has(self.targetRefs)) || (!has(self.targetRef) && has(self.targetRefs)) || (has(self.targetSelectors) && self.targetSelectors.size() > 0) ", message="either targetRef or targetRefs must be used"
// ClientTrafficPolicySpec defines the desired state of ClientTrafficPolicy.
//
// +kubebuilder:validation:XValidation:rule="(has(self.targetRef) && !has(self.targetRefs)) || (!has(self.targetRef) && has(self.targetRefs)) || (has(self.targetSelectors) && self.targetSelectors.size() > 0) ", message="either targetRef or targetRefs must be used"
// +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.group == 'gateway.networking.k8s.io' : true", message="this policy can only have a targetRef.group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.kind == 'Gateway' : true", message="this policy can only have a targetRef.kind of Gateway"
// +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.group == 'gateway.networking.k8s.io') : true", message="this policy can only have a targetRefs[*].group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.kind == 'Gateway') : true", message="this policy can only have a targetRefs[*].kind of Gateway"
//
// ClientTrafficPolicySpec defines the desired state of ClientTrafficPolicy.
type ClientTrafficPolicySpec struct {
PolicyTargetReferences `json:",inline"`

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/envoyextensionypolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)

const (
Expand All @@ -29,7 +29,7 @@ type EnvoyExtensionPolicy struct {
Spec EnvoyExtensionPolicySpec `json:"spec"`

// Status defines the current status of EnvoyExtensionPolicy.
Status gwapiv1a2.PolicyStatus `json:"status,omitempty"`
Status gwapiv1.PolicyStatus `json:"status,omitempty"`
}

// EnvoyExtensionPolicySpec defines the desired state of EnvoyExtensionPolicy.
Expand Down
16 changes: 8 additions & 8 deletions api/v1alpha1/envoypatchpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package v1alpha1
import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)

const (
Expand All @@ -32,7 +32,7 @@ type EnvoyPatchPolicy struct {
Spec EnvoyPatchPolicySpec `json:"spec"`

// Status defines the current status of EnvoyPatchPolicy.
Status gwapiv1a2.PolicyStatus `json:"status,omitempty"`
Status gwapiv1.PolicyStatus `json:"status,omitempty"`
}

// EnvoyPatchPolicySpec defines the desired state of EnvoyPatchPolicy.
Expand All @@ -54,7 +54,7 @@ type EnvoyPatchPolicySpec struct {
// This Policy and the TargetRef MUST be in the same namespace
// for this Policy to have effect and be applied to the Gateway
// TargetRef
TargetRef gwapiv1a2.LocalPolicyTargetReference `json:"targetRef"`
TargetRef gwapiv1.LocalPolicyTargetReference `json:"targetRef"`
// Priority of the EnvoyPatchPolicy.
// If multiple EnvoyPatchPolicies are applied to the same
// TargetRef, they will be applied in the ascending order of
Expand Down Expand Up @@ -147,23 +147,23 @@ const (
// * "Invalid"
// * "ResourceNotFound"
//
PolicyConditionProgrammed gwapiv1a2.PolicyConditionType = "Programmed"
PolicyConditionProgrammed gwapiv1.PolicyConditionType = "Programmed"

// PolicyReasonProgrammed is used with the "Programmed" condition when the policy
// is ready to be programmed into the data plane.
PolicyReasonProgrammed gwapiv1a2.PolicyConditionReason = "Programmed"
PolicyReasonProgrammed gwapiv1.PolicyConditionReason = "Programmed"

// PolicyReasonInvalid is used with the "Programmed" condition when the patch
// is syntactically or semantically invalid.
PolicyReasonInvalid gwapiv1a2.PolicyConditionReason = "Invalid"
PolicyReasonInvalid gwapiv1.PolicyConditionReason = "Invalid"

// PolicyReasonResourceNotFound is used with the "Programmed" condition when the
// policy cannot find the resource type to patch to.
PolicyReasonResourceNotFound gwapiv1a2.PolicyConditionReason = "ResourceNotFound"
PolicyReasonResourceNotFound gwapiv1.PolicyConditionReason = "ResourceNotFound"

// PolicyReasonDisabled is used with the "Accepted" condition when the policy
// feature is disabled by the configuration.
PolicyReasonDisabled gwapiv1a2.PolicyConditionReason = "Disabled"
PolicyReasonDisabled gwapiv1.PolicyConditionReason = "Disabled"
)

//+kubebuilder:object:root=true
Expand Down
13 changes: 6 additions & 7 deletions api/v1alpha1/policy_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
)

const (
Expand All @@ -19,11 +18,11 @@ const (
//
// * "Aggregated"
//
PolicyConditionAggregated gwapiv1a2.PolicyConditionType = "Aggregated"
PolicyConditionAggregated gwapiv1.PolicyConditionType = "Aggregated"

// PolicyReasonAggregated is used with the "Aggregated" condition when the policy
// is aggregated to satisfy CEL constraints in PolicyAncestorStatus (not exceeding 16).
PolicyReasonAggregated gwapiv1a2.PolicyConditionReason = "Aggregated"
PolicyReasonAggregated gwapiv1.PolicyConditionReason = "Aggregated"
)

type PolicyTargetReferences struct {
Expand All @@ -32,11 +31,11 @@ type PolicyTargetReferences struct {
// Policy to have effect
//
// Deprecated: use targetRefs/targetSelectors instead
TargetRef *gwapiv1a2.LocalPolicyTargetReferenceWithSectionName `json:"targetRef,omitempty"`
TargetRef *gwapiv1.LocalPolicyTargetReferenceWithSectionName `json:"targetRef,omitempty"`

// TargetRefs are the names of the Gateway resources this policy
// is being attached to.
TargetRefs []gwapiv1a2.LocalPolicyTargetReferenceWithSectionName `json:"targetRefs,omitempty"`
TargetRefs []gwapiv1.LocalPolicyTargetReferenceWithSectionName `json:"targetRefs,omitempty"`

// TargetSelectors allow targeting resources for this policy based on labels
TargetSelectors []TargetSelector `json:"targetSelectors,omitempty"`
Expand All @@ -63,9 +62,9 @@ type TargetSelector struct {
MatchExpressions []metav1.LabelSelectorRequirement `json:"matchExpressions,omitempty"`
}

func (p PolicyTargetReferences) GetTargetRefs() []gwapiv1a2.LocalPolicyTargetReferenceWithSectionName {
func (p PolicyTargetReferences) GetTargetRefs() []gwapiv1.LocalPolicyTargetReferenceWithSectionName {
if p.TargetRef != nil {
return []gwapiv1a2.LocalPolicyTargetReferenceWithSectionName{*p.TargetRef}
return []gwapiv1.LocalPolicyTargetReferenceWithSectionName{*p.TargetRef}
}
return p.TargetRefs
}
19 changes: 9 additions & 10 deletions api/v1alpha1/securitypolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)

const (
Expand All @@ -30,24 +30,23 @@ type SecurityPolicy struct {
Spec SecurityPolicySpec `json:"spec"`

// Status defines the current status of SecurityPolicy.
Status gwapiv1a2.PolicyStatus `json:"status,omitempty"`
Status gwapiv1.PolicyStatus `json:"status,omitempty"`
}

// +kubebuilder:validation:XValidation:rule="(has(self.targetRef) && !has(self.targetRefs)) || (!has(self.targetRef) && has(self.targetRefs)) || (has(self.targetSelectors) && self.targetSelectors.size() > 0) ", message="either targetRef or targetRefs must be used"
//
// +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.group == 'gateway.networking.k8s.io' : true", message="this policy can only have a targetRef.group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.kind in ['Gateway', 'HTTPRoute', 'GRPCRoute', 'TCPRoute'] : true", message="this policy can only have a targetRef.kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute"
// +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.group == 'gateway.networking.k8s.io') : true ", message="this policy can only have a targetRefs[*].group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.kind in ['Gateway', 'HTTPRoute', 'GRPCRoute', 'TCPRoute']) : true ", message="this policy can only have a targetRefs[*].kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute"
// +kubebuilder:validation:XValidation:rule="(has(self.authorization) && has(self.authorization.rules) && self.authorization.rules.exists(r, has(r.principal.jwt))) ? has(self.jwt) : true", message="if authorization.rules.principal.jwt is used, jwt must be defined"
//
// SecurityPolicySpec defines the desired state of SecurityPolicy.
//
// NOTE: SecurityPolicy can target Gateway, HTTPRoute, GRPCRoute, and TCPRoute.
// When a SecurityPolicy targets a TCPRoute, only client-IP based authorization
// (Authorization rules that use Principal.ClientCIDRs) is applied. Other
// authentication/authorization features such as JWT, API Key, Basic Auth,
// OIDC, or External Authorization are not applicable to TCPRoute targets.
//
// +kubebuilder:validation:XValidation:rule="(has(self.targetRef) && !has(self.targetRefs)) || (!has(self.targetRef) && has(self.targetRefs)) || (has(self.targetSelectors) && self.targetSelectors.size() > 0) ", message="either targetRef or targetRefs must be used"
// +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.group == 'gateway.networking.k8s.io' : true", message="this policy can only have a targetRef.group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.kind in ['Gateway', 'HTTPRoute', 'GRPCRoute', 'TCPRoute'] : true", message="this policy can only have a targetRef.kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute"
// +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.group == 'gateway.networking.k8s.io') : true ", message="this policy can only have a targetRefs[*].group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.kind in ['Gateway', 'HTTPRoute', 'GRPCRoute', 'TCPRoute']) : true ", message="this policy can only have a targetRefs[*].kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute"
// +kubebuilder:validation:XValidation:rule="(has(self.authorization) && has(self.authorization.rules) && self.authorization.rules.exists(r, has(r.principal.jwt))) ? has(self.jwt) : true", message="if authorization.rules.principal.jwt is used, jwt must be defined"
type SecurityPolicySpec struct {
PolicyTargetReferences `json:",inline"`

Expand Down
9 changes: 4 additions & 5 deletions api/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/intstr"
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
)

const (
Expand Down Expand Up @@ -47,18 +46,18 @@ const (
//
// * "Overridden"
//
PolicyConditionOverridden gwapiv1a2.PolicyConditionType = "Overridden"
PolicyConditionOverridden gwapiv1.PolicyConditionType = "Overridden"

// PolicyReasonOverridden is used with the "Overridden" condition when the policy
// has been overridden by another policy targeting a section within the same target.
PolicyReasonOverridden gwapiv1a2.PolicyConditionReason = "Overridden"
PolicyReasonOverridden gwapiv1.PolicyConditionReason = "Overridden"

// PolicyConditionMerged indicates whether the policy has
// been merged with another policy targeting the parent(e.g. Gateway).
PolicyConditionMerged gwapiv1a2.PolicyConditionType = "Merged"
PolicyConditionMerged gwapiv1.PolicyConditionType = "Merged"
// PolicyReasonMerged is used with the "Merged" condition when the policy
// has been merged with another policy targeting the parent(e.g. Gateway).
PolicyReasonMerged gwapiv1a2.PolicyConditionReason = "Merged"
PolicyReasonMerged gwapiv1.PolicyConditionReason = "Merged"
)

// GroupVersionKind unambiguously identifies a Kind.
Expand Down
10 changes: 4 additions & 6 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading
Loading