From d74efd5320a2f9a99091bd02260049b256b7d918 Mon Sep 17 00:00:00 2001 From: Jim Fitzpatrick Date: Fri, 8 Nov 2024 15:24:52 +0000 Subject: [PATCH] Policy:Bump:v1 (#993) Bump the Auth and Rate Limit policies to v1 Signed-off-by: Jim Fitzpatrick --- Makefile | 2 +- api/{v1beta3 => v1}/authpolicy_types.go | 61 +- api/{v1beta3 => v1}/authpolicy_types_test.go | 2 +- api/{v1beta3 => v1}/common_types.go | 8 +- api/v1/groupversion_info.go | 5 +- api/{v1beta3 => v1}/ratelimitpolicy_types.go | 29 +- .../ratelimitpolicy_types_test.go | 2 +- api/v1/zz_generated.deepcopy.go | 665 +++++++++++++++++ api/v1beta3/groupversion_info.go | 46 -- api/v1beta3/zz_generated.deepcopy.go | 691 ------------------ ...adrant-operator.clusterserviceversion.yaml | 103 +-- .../manifests/kuadrant.io_authpolicies.yaml | 2 +- .../kuadrant.io_ratelimitpolicies.yaml | 2 +- .../templates/manifests.yaml | 4 +- .../crd/bases/kuadrant.io_authpolicies.yaml | 2 +- .../bases/kuadrant.io_ratelimitpolicies.yaml | 2 +- ...adrant-operator.clusterserviceversion.yaml | 4 +- ...olicy.yaml => kuadrant_v1_authpolicy.yaml} | 2 +- ....yaml => kuadrant_v1_ratelimitpolicy.yaml} | 2 +- config/samples/kustomization.yaml | 4 +- controllers/auth_policies_validator.go | 10 +- controllers/auth_policy_status_updater.go | 15 +- controllers/auth_workflow_helpers.go | 4 +- controllers/authconfigs_reconciler.go | 18 +- controllers/common.go | 9 +- controllers/data_plane_policies_workflow.go | 6 +- .../effective_auth_policies_reconciler.go | 7 +- ...effective_ratelimit_policies_reconciler.go | 7 +- .../envoy_gateway_auth_cluster_reconciler.go | 4 +- .../envoy_gateway_extension_reconciler.go | 6 +- ...oy_gateway_ratelimit_cluster_reconciler.go | 4 +- ...teway_policy_discoverability_reconciler.go | 5 +- ...route_policy_discoverability_reconciler.go | 5 +- .../httprouteparentrefs_eventmapper.go | 6 +- controllers/istio_auth_cluster_reconciler.go | 4 +- controllers/istio_extension_reconciler.go | 6 +- .../istio_ratelimit_cluster_reconciler.go | 4 +- controllers/limitador_limits_reconciler.go | 9 +- controllers/ratelimit_policies_validator.go | 10 +- .../ratelimit_policy_status_updater.go | 15 +- controllers/ratelimit_workflow_helpers.go | 15 +- controllers/ratelimit_workflow_test.go | 28 +- controllers/state_of_the_world.go | 17 +- controllers/test_common.go | 2 - doc/auth.md | 6 +- doc/proposals/rlp-target-gateway-resource.md | 2 +- doc/rate-limiting.md | 6 +- ...uth-for-app-devs-and-platform-engineers.md | 6 +- .../authenticated-rl-for-app-developers.md | 4 +- ...uthenticated-rl-with-jwt-and-k8s-authnz.md | 4 +- .../gateway-rl-for-cluster-operators.md | 2 +- ...re-protect-connect-single-multi-cluster.md | 4 +- doc/user-guides/secure-protect-connect.md | 8 +- .../simple-rl-for-app-developers.md | 2 +- examples/toystore/authpolicy.yaml | 4 +- .../toystore/authpolicy_jwt-k8s-authnz.yaml | 2 +- .../toystore/ratelimitpolicy_gateway.yaml | 2 +- .../toystore/ratelimitpolicy_httproute.yaml | 2 +- main.go | 2 - pkg/library/mappers/gateway_test.go | 18 +- pkg/library/mappers/utils_test.go | 10 +- .../authpolicy/authpolicy_controller_test.go | 117 ++- .../ratelimitpolicy_controller_test.go | 220 +++--- .../target_status_controller_test.go | 79 +- tests/commons.go | 29 +- .../envoygateway/extension_reconciler_test.go | 37 +- .../rate_limit_cluster_reconciler_test.go | 24 +- tests/istio/extension_reconciler_test.go | 215 +++--- .../rate_limit_cluster_reconciler_test.go | 16 +- 69 files changed, 1293 insertions(+), 1382 deletions(-) rename api/{v1beta3 => v1}/authpolicy_types.go (91%) rename api/{v1beta3 => v1}/authpolicy_types_test.go (96%) rename api/{v1beta3 => v1}/common_types.go (86%) rename api/{v1beta3 => v1}/ratelimitpolicy_types.go (92%) rename api/{v1beta3 => v1}/ratelimitpolicy_types_test.go (99%) delete mode 100644 api/v1beta3/groupversion_info.go delete mode 100644 api/v1beta3/zz_generated.deepcopy.go rename config/samples/{kuadrant_v1beta3_authpolicy.yaml => kuadrant_v1_authpolicy.yaml} (90%) rename config/samples/{kuadrant_v1beta3_ratelimitpolicy.yaml => kuadrant_v1_ratelimitpolicy.yaml} (87%) diff --git a/Makefile b/Makefile index 5056d3f5d..7082a80a9 100644 --- a/Makefile +++ b/Makefile @@ -296,7 +296,7 @@ endef .PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) crd paths="./api/v1beta1;./api/v1beta3;./api/v1" output:crd:artifacts:config=config/crd/bases + $(CONTROLLER_GEN) crd paths="./api/v1beta1;./api/v1" output:crd:artifacts:config=config/crd/bases $(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." .PHONY: dependencies-manifests diff --git a/api/v1beta3/authpolicy_types.go b/api/v1/authpolicy_types.go similarity index 91% rename from api/v1beta3/authpolicy_types.go rename to api/v1/authpolicy_types.go index 5edba1cdc..c51459af9 100644 --- a/api/v1beta3/authpolicy_types.go +++ b/api/v1/authpolicy_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( "fmt" @@ -29,7 +29,6 @@ import ( gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi" "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" "github.com/kuadrant/kuadrant-operator/pkg/library/utils" @@ -42,8 +41,8 @@ const ( ) var ( - AuthPolicyGroupKind = schema.GroupKind{Group: SchemeGroupVersion.Group, Kind: "AuthPolicy"} - AuthPoliciesResource = SchemeGroupVersion.WithResource("authpolicies") + AuthPolicyGroupKind = schema.GroupKind{Group: GroupVersion.Group, Kind: "AuthPolicy"} + AuthPoliciesResource = GroupVersion.WithResource("authpolicies") ) // +kubebuilder:object:root=true @@ -81,7 +80,7 @@ func (p *AuthPolicy) GetLocator() string { // TODO: remove func (p *AuthPolicy) IsAtomicOverride() bool { - return p.Spec.Overrides != nil && p.Spec.Overrides.Strategy == kuadrantv1.AtomicMergeStrategy + return p.Spec.Overrides != nil && p.Spec.Overrides.Strategy == AtomicMergeStrategy } // DEPRECATED: Use GetTargetRefs instead @@ -100,12 +99,12 @@ func (p *AuthPolicy) GetTargetRefs() []machinery.PolicyTargetReference { func (p *AuthPolicy) GetMergeStrategy() machinery.MergeStrategy { if spec := p.Spec.Defaults; spec != nil { - return kuadrantv1.DefaultsMergeStrategy(spec.Strategy) + return DefaultsMergeStrategy(spec.Strategy) } if spec := p.Spec.Overrides; spec != nil { - return kuadrantv1.OverridesMergeStrategy(spec.Strategy) + return OverridesMergeStrategy(spec.Strategy) } - return kuadrantv1.AtomicDefaultsMergeStrategy + return AtomicDefaultsMergeStrategy } func (p *AuthPolicy) Merge(other machinery.Policy) machinery.Policy { @@ -116,24 +115,24 @@ func (p *AuthPolicy) Merge(other machinery.Policy) machinery.Policy { return source.GetMergeStrategy()(source, p) } -var _ kuadrantv1.MergeablePolicy = &AuthPolicy{} +var _ MergeablePolicy = &AuthPolicy{} func (p *AuthPolicy) Empty() bool { return p.Spec.Proper().AuthScheme == nil } -func (p *AuthPolicy) Rules() map[string]kuadrantv1.MergeableRule { - rules := make(map[string]kuadrantv1.MergeableRule) +func (p *AuthPolicy) Rules() map[string]MergeableRule { + rules := make(map[string]MergeableRule) policyLocator := p.GetLocator() spec := p.Spec.Proper() for ruleID := range spec.NamedPatterns { rule := spec.NamedPatterns[ruleID] - rules[fmt.Sprintf("patterns#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("patterns#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } if whenPredicates := spec.MergeableWhenPredicates; len(whenPredicates.Predicates) > 0 { - rules["conditions#"] = kuadrantv1.NewMergeableRule(&whenPredicates, policyLocator) + rules["conditions#"] = NewMergeableRule(&whenPredicates, policyLocator) } if spec.AuthScheme == nil { @@ -142,22 +141,22 @@ func (p *AuthPolicy) Rules() map[string]kuadrantv1.MergeableRule { for ruleID := range spec.AuthScheme.Authentication { rule := spec.AuthScheme.Authentication[ruleID] - rules[fmt.Sprintf("authentication#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("authentication#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } for ruleID := range spec.AuthScheme.Metadata { rule := spec.AuthScheme.Metadata[ruleID] - rules[fmt.Sprintf("metadata#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("metadata#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } for ruleID := range spec.AuthScheme.Authorization { rule := spec.AuthScheme.Authorization[ruleID] - rules[fmt.Sprintf("authorization#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("authorization#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } for ruleID := range spec.AuthScheme.Callbacks { rule := spec.AuthScheme.Callbacks[ruleID] - rules[fmt.Sprintf("callbacks#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("callbacks#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } if spec.AuthScheme.Response == nil { @@ -165,26 +164,26 @@ func (p *AuthPolicy) Rules() map[string]kuadrantv1.MergeableRule { } if rule := spec.AuthScheme.Response.Unauthenticated; rule != nil { - rules["response.unauthenticated#"] = kuadrantv1.NewMergeableRule(rule, policyLocator) + rules["response.unauthenticated#"] = NewMergeableRule(rule, policyLocator) } if rule := spec.AuthScheme.Response.Unauthorized; rule != nil { - rules["response.unauthorized#"] = kuadrantv1.NewMergeableRule(rule, policyLocator) + rules["response.unauthorized#"] = NewMergeableRule(rule, policyLocator) } for ruleID := range spec.AuthScheme.Response.Success.Headers { rule := spec.AuthScheme.Response.Success.Headers[ruleID] - rules[fmt.Sprintf("response.success.headers#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("response.success.headers#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } for ruleID := range spec.AuthScheme.Response.Success.DynamicMetadata { rule := spec.AuthScheme.Response.Success.DynamicMetadata[ruleID] - rules[fmt.Sprintf("response.success.metadata#%s", ruleID)] = kuadrantv1.NewMergeableRule(&rule, policyLocator) + rules[fmt.Sprintf("response.success.metadata#%s", ruleID)] = NewMergeableRule(&rule, policyLocator) } return rules } -func (p *AuthPolicy) SetRules(rules map[string]kuadrantv1.MergeableRule) { +func (p *AuthPolicy) SetRules(rules map[string]MergeableRule) { // clear all rules of the policy before setting new ones p.Spec.Proper().NamedPatterns = nil p.Spec.Proper().Predicates = nil @@ -435,7 +434,7 @@ type MergeablePatternExpressions struct { func (r *MergeablePatternExpressions) GetSpec() any { return r.PatternExpressions } func (r *MergeablePatternExpressions) GetSource() string { return r.Source } -func (r *MergeablePatternExpressions) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeablePatternExpressions) WithSource(source string) MergeableRule { r.Source = source return r } @@ -447,7 +446,7 @@ type MergeablePatternExpressionOrRef struct { func (r *MergeablePatternExpressionOrRef) GetSpec() any { return r.PatternExpressionOrRef } func (r *MergeablePatternExpressionOrRef) GetSource() string { return r.Source } -func (r *MergeablePatternExpressionOrRef) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeablePatternExpressionOrRef) WithSource(source string) MergeableRule { r.Source = source return r } @@ -459,7 +458,7 @@ type MergeableAuthenticationSpec struct { func (r *MergeableAuthenticationSpec) GetSpec() any { return r.AuthenticationSpec } func (r *MergeableAuthenticationSpec) GetSource() string { return r.Source } -func (r *MergeableAuthenticationSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableAuthenticationSpec) WithSource(source string) MergeableRule { r.Source = source return r } @@ -471,7 +470,7 @@ type MergeableMetadataSpec struct { func (r *MergeableMetadataSpec) GetSpec() any { return r.MetadataSpec } func (r *MergeableMetadataSpec) GetSource() string { return r.Source } -func (r *MergeableMetadataSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableMetadataSpec) WithSource(source string) MergeableRule { r.Source = source return r } @@ -483,7 +482,7 @@ type MergeableAuthorizationSpec struct { func (r *MergeableAuthorizationSpec) GetSpec() any { return r.AuthorizationSpec } func (r *MergeableAuthorizationSpec) GetSource() string { return r.Source } -func (r *MergeableAuthorizationSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableAuthorizationSpec) WithSource(source string) MergeableRule { r.Source = source return r } @@ -515,7 +514,7 @@ type MergeableDenyWithSpec struct { func (r *MergeableDenyWithSpec) GetSpec() any { return r.DenyWithSpec } func (r *MergeableDenyWithSpec) GetSource() string { return r.Source } -func (r *MergeableDenyWithSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableDenyWithSpec) WithSource(source string) MergeableRule { r.Source = source return r } @@ -535,7 +534,7 @@ type MergeableHeaderSuccessResponseSpec struct { func (r *MergeableHeaderSuccessResponseSpec) GetSpec() any { return r.HeaderSuccessResponseSpec } func (r *MergeableHeaderSuccessResponseSpec) GetSource() string { return r.Source } -func (r *MergeableHeaderSuccessResponseSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableHeaderSuccessResponseSpec) WithSource(source string) MergeableRule { r.Source = source return r } @@ -547,7 +546,7 @@ type MergeableSuccessResponseSpec struct { func (r *MergeableSuccessResponseSpec) GetSpec() any { return r.SuccessResponseSpec } func (r *MergeableSuccessResponseSpec) GetSource() string { return r.Source } -func (r *MergeableSuccessResponseSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableSuccessResponseSpec) WithSource(source string) MergeableRule { r.Source = source return r } @@ -559,7 +558,7 @@ type MergeableCallbackSpec struct { func (r *MergeableCallbackSpec) GetSpec() any { return r.CallbackSpec } func (r *MergeableCallbackSpec) GetSource() string { return r.Source } -func (r *MergeableCallbackSpec) WithSource(source string) kuadrantv1.MergeableRule { +func (r *MergeableCallbackSpec) WithSource(source string) MergeableRule { r.Source = source return r } diff --git a/api/v1beta3/authpolicy_types_test.go b/api/v1/authpolicy_types_test.go similarity index 96% rename from api/v1beta3/authpolicy_types_test.go rename to api/v1/authpolicy_types_test.go index 629fca717..16c1e6a03 100644 --- a/api/v1beta3/authpolicy_types_test.go +++ b/api/v1/authpolicy_types_test.go @@ -1,6 +1,6 @@ //go:build unit -package v1beta3 +package v1 import ( "testing" diff --git a/api/v1beta3/common_types.go b/api/v1/common_types.go similarity index 86% rename from api/v1beta3/common_types.go rename to api/v1/common_types.go index f3fa523bf..593c452ac 100644 --- a/api/v1beta3/common_types.go +++ b/api/v1/common_types.go @@ -1,9 +1,7 @@ -package v1beta3 +package v1 import ( "github.com/samber/lo" - - kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" ) func NewPredicate(predicate string) Predicate { @@ -50,7 +48,7 @@ type MergeableWhenPredicates struct { Source string `json:"-"` } -var _ kuadrantv1.MergeableRule = &MergeableWhenPredicates{} +var _ MergeableRule = &MergeableWhenPredicates{} func (p *MergeableWhenPredicates) GetSpec() any { return p.Predicates @@ -60,7 +58,7 @@ func (p *MergeableWhenPredicates) GetSource() string { return p.Source } -func (p *MergeableWhenPredicates) WithSource(source string) kuadrantv1.MergeableRule { +func (p *MergeableWhenPredicates) WithSource(source string) MergeableRule { p.Source = source return p } diff --git a/api/v1/groupversion_info.go b/api/v1/groupversion_info.go index d9a610d30..2cf219d03 100644 --- a/api/v1/groupversion_info.go +++ b/api/v1/groupversion_info.go @@ -24,9 +24,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/scheme" ) +// GroupName specifies the group name used to register the objects. +const GroupName = "kuadrant.io" + var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "kuadrant.io", Version: "v1"} + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/api/v1beta3/ratelimitpolicy_types.go b/api/v1/ratelimitpolicy_types.go similarity index 92% rename from api/v1beta3/ratelimitpolicy_types.go rename to api/v1/ratelimitpolicy_types.go index 89792b22c..e27449926 100644 --- a/api/v1beta3/ratelimitpolicy_types.go +++ b/api/v1/ratelimitpolicy_types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta3 +package v1 import ( "time" @@ -25,7 +25,6 @@ import ( gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi" "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" "github.com/kuadrant/kuadrant-operator/pkg/library/utils" @@ -38,8 +37,8 @@ const ( ) var ( - RateLimitPolicyGroupKind = schema.GroupKind{Group: SchemeGroupVersion.Group, Kind: "RateLimitPolicy"} - RateLimitPoliciesResource = SchemeGroupVersion.WithResource("ratelimitpolicies") + RateLimitPolicyGroupKind = schema.GroupKind{Group: GroupVersion.Group, Kind: "RateLimitPolicy"} + RateLimitPoliciesResource = GroupVersion.WithResource("ratelimitpolicies") // Top level predicate rules key starting with # to prevent conflict with limit names // TODO(eastizle): this coupling between limit names and rule IDs is a bad smell. Merging implementation should be enhanced. RulesKeyTopLevelPredicates = "###_TOP_LEVEL_PREDICATES_###" @@ -94,12 +93,12 @@ func (p *RateLimitPolicy) GetTargetRefs() []machinery.PolicyTargetReference { func (p *RateLimitPolicy) GetMergeStrategy() machinery.MergeStrategy { if spec := p.Spec.Defaults; spec != nil { - return kuadrantv1.DefaultsMergeStrategy(spec.Strategy) + return DefaultsMergeStrategy(spec.Strategy) } if spec := p.Spec.Overrides; spec != nil { - return kuadrantv1.OverridesMergeStrategy(spec.Strategy) + return OverridesMergeStrategy(spec.Strategy) } - return kuadrantv1.AtomicDefaultsMergeStrategy + return AtomicDefaultsMergeStrategy } func (p *RateLimitPolicy) Merge(other machinery.Policy) machinery.Policy { @@ -110,30 +109,30 @@ func (p *RateLimitPolicy) Merge(other machinery.Policy) machinery.Policy { return source.GetMergeStrategy()(source, p) } -var _ kuadrantv1.MergeablePolicy = &RateLimitPolicy{} +var _ MergeablePolicy = &RateLimitPolicy{} func (p *RateLimitPolicy) Empty() bool { return len(p.Spec.Proper().Limits) == 0 } -func (p *RateLimitPolicy) Rules() map[string]kuadrantv1.MergeableRule { - rules := make(map[string]kuadrantv1.MergeableRule) +func (p *RateLimitPolicy) Rules() map[string]MergeableRule { + rules := make(map[string]MergeableRule) policyLocator := p.GetLocator() spec := p.Spec.Proper() if whenPredicates := spec.MergeableWhenPredicates; len(whenPredicates.Predicates) > 0 { - rules[RulesKeyTopLevelPredicates] = kuadrantv1.NewMergeableRule(&whenPredicates, policyLocator) + rules[RulesKeyTopLevelPredicates] = NewMergeableRule(&whenPredicates, policyLocator) } for ruleID := range spec.Limits { limit := spec.Limits[ruleID] - rules[ruleID] = kuadrantv1.NewMergeableRule(&limit, policyLocator) + rules[ruleID] = NewMergeableRule(&limit, policyLocator) } return rules } -func (p *RateLimitPolicy) SetRules(rules map[string]kuadrantv1.MergeableRule) { +func (p *RateLimitPolicy) SetRules(rules map[string]MergeableRule) { // clear all rules of the policy before setting new ones p.Spec.Proper().Limits = nil p.Spec.Proper().Predicates = nil @@ -273,7 +272,7 @@ func (l Limit) CountersAsStringList() []string { return utils.Map(l.Counters, func(counter Counter) string { return string(counter.Expression) }) } -var _ kuadrantv1.MergeableRule = &Limit{} +var _ MergeableRule = &Limit{} func (l *Limit) GetSpec() any { return l @@ -283,7 +282,7 @@ func (l *Limit) GetSource() string { return l.Source } -func (l *Limit) WithSource(source string) kuadrantv1.MergeableRule { +func (l *Limit) WithSource(source string) MergeableRule { l.Source = source return l } diff --git a/api/v1beta3/ratelimitpolicy_types_test.go b/api/v1/ratelimitpolicy_types_test.go similarity index 99% rename from api/v1beta3/ratelimitpolicy_types_test.go rename to api/v1/ratelimitpolicy_types_test.go index 3acf5c4a3..fb67f937e 100644 --- a/api/v1beta3/ratelimitpolicy_types_test.go +++ b/api/v1/ratelimitpolicy_types_test.go @@ -1,6 +1,6 @@ //go:build unit -package v1beta3 +package v1 import ( "testing" diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index f3dcce4a9..2f38aa0f3 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -22,11 +22,196 @@ package v1 import ( certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1" + "github.com/kuadrant/authorino/api/v1beta3" "github.com/kuadrant/dns-operator/api/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthPolicy) DeepCopyInto(out *AuthPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicy. +func (in *AuthPolicy) DeepCopy() *AuthPolicy { + if in == nil { + return nil + } + out := new(AuthPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthPolicyList) DeepCopyInto(out *AuthPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AuthPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicyList. +func (in *AuthPolicyList) DeepCopy() *AuthPolicyList { + if in == nil { + return nil + } + out := new(AuthPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthPolicySpec) DeepCopyInto(out *AuthPolicySpec) { + *out = *in + in.TargetRef.DeepCopyInto(&out.TargetRef) + if in.Defaults != nil { + in, out := &in.Defaults, &out.Defaults + *out = new(MergeableAuthPolicySpec) + (*in).DeepCopyInto(*out) + } + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = new(MergeableAuthPolicySpec) + (*in).DeepCopyInto(*out) + } + in.AuthPolicySpecProper.DeepCopyInto(&out.AuthPolicySpecProper) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicySpec. +func (in *AuthPolicySpec) DeepCopy() *AuthPolicySpec { + if in == nil { + return nil + } + out := new(AuthPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthPolicySpecProper) DeepCopyInto(out *AuthPolicySpecProper) { + *out = *in + if in.NamedPatterns != nil { + in, out := &in.NamedPatterns, &out.NamedPatterns + *out = make(map[string]MergeablePatternExpressions, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + in.MergeableWhenPredicates.DeepCopyInto(&out.MergeableWhenPredicates) + if in.AuthScheme != nil { + in, out := &in.AuthScheme, &out.AuthScheme + *out = new(AuthSchemeSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicySpecProper. +func (in *AuthPolicySpecProper) DeepCopy() *AuthPolicySpecProper { + if in == nil { + return nil + } + out := new(AuthPolicySpecProper) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthPolicyStatus) DeepCopyInto(out *AuthPolicyStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicyStatus. +func (in *AuthPolicyStatus) DeepCopy() *AuthPolicyStatus { + if in == nil { + return nil + } + out := new(AuthPolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthSchemeSpec) DeepCopyInto(out *AuthSchemeSpec) { + *out = *in + if in.Authentication != nil { + in, out := &in.Authentication, &out.Authentication + *out = make(map[string]MergeableAuthenticationSpec, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]MergeableMetadataSpec, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Authorization != nil { + in, out := &in.Authorization, &out.Authorization + *out = make(map[string]MergeableAuthorizationSpec, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Response != nil { + in, out := &in.Response, &out.Response + *out = new(MergeableResponseSpec) + (*in).DeepCopyInto(*out) + } + if in.Callbacks != nil { + in, out := &in.Callbacks, &out.Callbacks + *out = make(map[string]MergeableCallbackSpec, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthSchemeSpec. +func (in *AuthSchemeSpec) DeepCopy() *AuthSchemeSpec { + if in == nil { + return nil + } + out := new(AuthSchemeSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertificateSpec) DeepCopyInto(out *CertificateSpec) { *out = *in @@ -68,6 +253,21 @@ func (in *CertificateSpec) DeepCopy() *CertificateSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Counter) DeepCopyInto(out *Counter) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Counter. +func (in *Counter) DeepCopy() *Counter { + if in == nil { + return nil + } + out := new(Counter) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DNSPolicy) DeepCopyInto(out *DNSPolicy) { *out = *in @@ -227,6 +427,36 @@ func (in ExcludeAddresses) DeepCopy() ExcludeAddresses { return *out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Limit) DeepCopyInto(out *Limit) { + *out = *in + if in.When != nil { + in, out := &in.When, &out.When + *out = make(WhenPredicates, len(*in)) + copy(*out, *in) + } + if in.Counters != nil { + in, out := &in.Counters, &out.Counters + *out = make([]Counter, len(*in)) + copy(*out, *in) + } + if in.Rates != nil { + in, out := &in.Rates, &out.Rates + *out = make([]Rate, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Limit. +func (in *Limit) DeepCopy() *Limit { + if in == nil { + return nil + } + out := new(Limit) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancingSpec) DeepCopyInto(out *LoadBalancingSpec) { *out = *in @@ -242,6 +472,422 @@ func (in *LoadBalancingSpec) DeepCopy() *LoadBalancingSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableAuthPolicySpec) DeepCopyInto(out *MergeableAuthPolicySpec) { + *out = *in + in.AuthPolicySpecProper.DeepCopyInto(&out.AuthPolicySpecProper) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableAuthPolicySpec. +func (in *MergeableAuthPolicySpec) DeepCopy() *MergeableAuthPolicySpec { + if in == nil { + return nil + } + out := new(MergeableAuthPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableAuthenticationSpec) DeepCopyInto(out *MergeableAuthenticationSpec) { + *out = *in + in.AuthenticationSpec.DeepCopyInto(&out.AuthenticationSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableAuthenticationSpec. +func (in *MergeableAuthenticationSpec) DeepCopy() *MergeableAuthenticationSpec { + if in == nil { + return nil + } + out := new(MergeableAuthenticationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableAuthorizationSpec) DeepCopyInto(out *MergeableAuthorizationSpec) { + *out = *in + in.AuthorizationSpec.DeepCopyInto(&out.AuthorizationSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableAuthorizationSpec. +func (in *MergeableAuthorizationSpec) DeepCopy() *MergeableAuthorizationSpec { + if in == nil { + return nil + } + out := new(MergeableAuthorizationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableCallbackSpec) DeepCopyInto(out *MergeableCallbackSpec) { + *out = *in + in.CallbackSpec.DeepCopyInto(&out.CallbackSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableCallbackSpec. +func (in *MergeableCallbackSpec) DeepCopy() *MergeableCallbackSpec { + if in == nil { + return nil + } + out := new(MergeableCallbackSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableDenyWithSpec) DeepCopyInto(out *MergeableDenyWithSpec) { + *out = *in + in.DenyWithSpec.DeepCopyInto(&out.DenyWithSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableDenyWithSpec. +func (in *MergeableDenyWithSpec) DeepCopy() *MergeableDenyWithSpec { + if in == nil { + return nil + } + out := new(MergeableDenyWithSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableHeaderSuccessResponseSpec) DeepCopyInto(out *MergeableHeaderSuccessResponseSpec) { + *out = *in + in.HeaderSuccessResponseSpec.DeepCopyInto(&out.HeaderSuccessResponseSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableHeaderSuccessResponseSpec. +func (in *MergeableHeaderSuccessResponseSpec) DeepCopy() *MergeableHeaderSuccessResponseSpec { + if in == nil { + return nil + } + out := new(MergeableHeaderSuccessResponseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableMetadataSpec) DeepCopyInto(out *MergeableMetadataSpec) { + *out = *in + in.MetadataSpec.DeepCopyInto(&out.MetadataSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableMetadataSpec. +func (in *MergeableMetadataSpec) DeepCopy() *MergeableMetadataSpec { + if in == nil { + return nil + } + out := new(MergeableMetadataSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeablePatternExpressionOrRef) DeepCopyInto(out *MergeablePatternExpressionOrRef) { + *out = *in + in.PatternExpressionOrRef.DeepCopyInto(&out.PatternExpressionOrRef) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeablePatternExpressionOrRef. +func (in *MergeablePatternExpressionOrRef) DeepCopy() *MergeablePatternExpressionOrRef { + if in == nil { + return nil + } + out := new(MergeablePatternExpressionOrRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeablePatternExpressions) DeepCopyInto(out *MergeablePatternExpressions) { + *out = *in + if in.PatternExpressions != nil { + in, out := &in.PatternExpressions, &out.PatternExpressions + *out = make(v1beta3.PatternExpressions, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeablePatternExpressions. +func (in *MergeablePatternExpressions) DeepCopy() *MergeablePatternExpressions { + if in == nil { + return nil + } + out := new(MergeablePatternExpressions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableRateLimitPolicySpec) DeepCopyInto(out *MergeableRateLimitPolicySpec) { + *out = *in + in.RateLimitPolicySpecProper.DeepCopyInto(&out.RateLimitPolicySpecProper) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableRateLimitPolicySpec. +func (in *MergeableRateLimitPolicySpec) DeepCopy() *MergeableRateLimitPolicySpec { + if in == nil { + return nil + } + out := new(MergeableRateLimitPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableResponseSpec) DeepCopyInto(out *MergeableResponseSpec) { + *out = *in + if in.Unauthenticated != nil { + in, out := &in.Unauthenticated, &out.Unauthenticated + *out = new(MergeableDenyWithSpec) + (*in).DeepCopyInto(*out) + } + if in.Unauthorized != nil { + in, out := &in.Unauthorized, &out.Unauthorized + *out = new(MergeableDenyWithSpec) + (*in).DeepCopyInto(*out) + } + in.Success.DeepCopyInto(&out.Success) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableResponseSpec. +func (in *MergeableResponseSpec) DeepCopy() *MergeableResponseSpec { + if in == nil { + return nil + } + out := new(MergeableResponseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableSuccessResponseSpec) DeepCopyInto(out *MergeableSuccessResponseSpec) { + *out = *in + in.SuccessResponseSpec.DeepCopyInto(&out.SuccessResponseSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableSuccessResponseSpec. +func (in *MergeableSuccessResponseSpec) DeepCopy() *MergeableSuccessResponseSpec { + if in == nil { + return nil + } + out := new(MergeableSuccessResponseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableWhenPredicates) DeepCopyInto(out *MergeableWhenPredicates) { + *out = *in + if in.Predicates != nil { + in, out := &in.Predicates, &out.Predicates + *out = make(WhenPredicates, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableWhenPredicates. +func (in *MergeableWhenPredicates) DeepCopy() *MergeableWhenPredicates { + if in == nil { + return nil + } + out := new(MergeableWhenPredicates) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MergeableWrappedSuccessResponseSpec) DeepCopyInto(out *MergeableWrappedSuccessResponseSpec) { + *out = *in + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]MergeableHeaderSuccessResponseSpec, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.DynamicMetadata != nil { + in, out := &in.DynamicMetadata, &out.DynamicMetadata + *out = make(map[string]MergeableSuccessResponseSpec, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableWrappedSuccessResponseSpec. +func (in *MergeableWrappedSuccessResponseSpec) DeepCopy() *MergeableWrappedSuccessResponseSpec { + if in == nil { + return nil + } + out := new(MergeableWrappedSuccessResponseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Predicate) DeepCopyInto(out *Predicate) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Predicate. +func (in *Predicate) DeepCopy() *Predicate { + if in == nil { + return nil + } + out := new(Predicate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Rate) DeepCopyInto(out *Rate) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rate. +func (in *Rate) DeepCopy() *Rate { + if in == nil { + return nil + } + out := new(Rate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitPolicy) DeepCopyInto(out *RateLimitPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicy. +func (in *RateLimitPolicy) DeepCopy() *RateLimitPolicy { + if in == nil { + return nil + } + out := new(RateLimitPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RateLimitPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitPolicyList) DeepCopyInto(out *RateLimitPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RateLimitPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicyList. +func (in *RateLimitPolicyList) DeepCopy() *RateLimitPolicyList { + if in == nil { + return nil + } + out := new(RateLimitPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RateLimitPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitPolicySpec) DeepCopyInto(out *RateLimitPolicySpec) { + *out = *in + in.TargetRef.DeepCopyInto(&out.TargetRef) + if in.Defaults != nil { + in, out := &in.Defaults, &out.Defaults + *out = new(MergeableRateLimitPolicySpec) + (*in).DeepCopyInto(*out) + } + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = new(MergeableRateLimitPolicySpec) + (*in).DeepCopyInto(*out) + } + in.RateLimitPolicySpecProper.DeepCopyInto(&out.RateLimitPolicySpecProper) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicySpec. +func (in *RateLimitPolicySpec) DeepCopy() *RateLimitPolicySpec { + if in == nil { + return nil + } + out := new(RateLimitPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitPolicySpecProper) DeepCopyInto(out *RateLimitPolicySpecProper) { + *out = *in + in.MergeableWhenPredicates.DeepCopyInto(&out.MergeableWhenPredicates) + if in.Limits != nil { + in, out := &in.Limits, &out.Limits + *out = make(map[string]Limit, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicySpecProper. +func (in *RateLimitPolicySpecProper) DeepCopy() *RateLimitPolicySpecProper { + if in == nil { + return nil + } + out := new(RateLimitPolicySpecProper) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitPolicyStatus) DeepCopyInto(out *RateLimitPolicyStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicyStatus. +func (in *RateLimitPolicyStatus) DeepCopy() *RateLimitPolicyStatus { + if in == nil { + return nil + } + out := new(RateLimitPolicyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSPolicy) DeepCopyInto(out *TLSPolicy) { *out = *in @@ -339,3 +985,22 @@ func (in *TLSPolicyStatus) DeepCopy() *TLSPolicyStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in WhenPredicates) DeepCopyInto(out *WhenPredicates) { + { + in := &in + *out = make(WhenPredicates, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WhenPredicates. +func (in WhenPredicates) DeepCopy() WhenPredicates { + if in == nil { + return nil + } + out := new(WhenPredicates) + in.DeepCopyInto(out) + return *out +} diff --git a/api/v1beta3/groupversion_info.go b/api/v1beta3/groupversion_info.go deleted file mode 100644 index bca312b26..000000000 --- a/api/v1beta3/groupversion_info.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2024. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// API schema definitions for the Kuadrant v1beta3 API group -// +kubebuilder:object:generate=true -// +groupName=kuadrant.io -package v1beta3 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - ctrl "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// GroupName specifies the group name used to register the objects. -const GroupName = "kuadrant.io" - -// GroupVersion specifies the group and the version used to register the objects. -var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta3"} - -// SchemeGroupVersion is group version used to register these objects -// Deprecated: use GroupVersion instead. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta3"} - -// SchemeBuilder is used to add go types to the GroupVersionKind scheme -var SchemeBuilder = &ctrl.Builder{GroupVersion: GroupVersion} - -// AddToScheme adds the types in this group-version to the given scheme. -var AddToScheme = SchemeBuilder.AddToScheme - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} diff --git a/api/v1beta3/zz_generated.deepcopy.go b/api/v1beta3/zz_generated.deepcopy.go deleted file mode 100644 index 1e1ded8b9..000000000 --- a/api/v1beta3/zz_generated.deepcopy.go +++ /dev/null @@ -1,691 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2021. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta3 - -import ( - apiv1beta3 "github.com/kuadrant/authorino/api/v1beta3" - "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthPolicy) DeepCopyInto(out *AuthPolicy) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicy. -func (in *AuthPolicy) DeepCopy() *AuthPolicy { - if in == nil { - return nil - } - out := new(AuthPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuthPolicy) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthPolicyList) DeepCopyInto(out *AuthPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AuthPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicyList. -func (in *AuthPolicyList) DeepCopy() *AuthPolicyList { - if in == nil { - return nil - } - out := new(AuthPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuthPolicyList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthPolicySpec) DeepCopyInto(out *AuthPolicySpec) { - *out = *in - in.TargetRef.DeepCopyInto(&out.TargetRef) - if in.Defaults != nil { - in, out := &in.Defaults, &out.Defaults - *out = new(MergeableAuthPolicySpec) - (*in).DeepCopyInto(*out) - } - if in.Overrides != nil { - in, out := &in.Overrides, &out.Overrides - *out = new(MergeableAuthPolicySpec) - (*in).DeepCopyInto(*out) - } - in.AuthPolicySpecProper.DeepCopyInto(&out.AuthPolicySpecProper) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicySpec. -func (in *AuthPolicySpec) DeepCopy() *AuthPolicySpec { - if in == nil { - return nil - } - out := new(AuthPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthPolicySpecProper) DeepCopyInto(out *AuthPolicySpecProper) { - *out = *in - if in.NamedPatterns != nil { - in, out := &in.NamedPatterns, &out.NamedPatterns - *out = make(map[string]MergeablePatternExpressions, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - in.MergeableWhenPredicates.DeepCopyInto(&out.MergeableWhenPredicates) - if in.AuthScheme != nil { - in, out := &in.AuthScheme, &out.AuthScheme - *out = new(AuthSchemeSpec) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicySpecProper. -func (in *AuthPolicySpecProper) DeepCopy() *AuthPolicySpecProper { - if in == nil { - return nil - } - out := new(AuthPolicySpecProper) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthPolicyStatus) DeepCopyInto(out *AuthPolicyStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthPolicyStatus. -func (in *AuthPolicyStatus) DeepCopy() *AuthPolicyStatus { - if in == nil { - return nil - } - out := new(AuthPolicyStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthSchemeSpec) DeepCopyInto(out *AuthSchemeSpec) { - *out = *in - if in.Authentication != nil { - in, out := &in.Authentication, &out.Authentication - *out = make(map[string]MergeableAuthenticationSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Metadata != nil { - in, out := &in.Metadata, &out.Metadata - *out = make(map[string]MergeableMetadataSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Authorization != nil { - in, out := &in.Authorization, &out.Authorization - *out = make(map[string]MergeableAuthorizationSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Response != nil { - in, out := &in.Response, &out.Response - *out = new(MergeableResponseSpec) - (*in).DeepCopyInto(*out) - } - if in.Callbacks != nil { - in, out := &in.Callbacks, &out.Callbacks - *out = make(map[string]MergeableCallbackSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthSchemeSpec. -func (in *AuthSchemeSpec) DeepCopy() *AuthSchemeSpec { - if in == nil { - return nil - } - out := new(AuthSchemeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Counter) DeepCopyInto(out *Counter) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Counter. -func (in *Counter) DeepCopy() *Counter { - if in == nil { - return nil - } - out := new(Counter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Limit) DeepCopyInto(out *Limit) { - *out = *in - if in.When != nil { - in, out := &in.When, &out.When - *out = make(WhenPredicates, len(*in)) - copy(*out, *in) - } - if in.Counters != nil { - in, out := &in.Counters, &out.Counters - *out = make([]Counter, len(*in)) - copy(*out, *in) - } - if in.Rates != nil { - in, out := &in.Rates, &out.Rates - *out = make([]Rate, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Limit. -func (in *Limit) DeepCopy() *Limit { - if in == nil { - return nil - } - out := new(Limit) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableAuthPolicySpec) DeepCopyInto(out *MergeableAuthPolicySpec) { - *out = *in - in.AuthPolicySpecProper.DeepCopyInto(&out.AuthPolicySpecProper) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableAuthPolicySpec. -func (in *MergeableAuthPolicySpec) DeepCopy() *MergeableAuthPolicySpec { - if in == nil { - return nil - } - out := new(MergeableAuthPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableAuthenticationSpec) DeepCopyInto(out *MergeableAuthenticationSpec) { - *out = *in - in.AuthenticationSpec.DeepCopyInto(&out.AuthenticationSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableAuthenticationSpec. -func (in *MergeableAuthenticationSpec) DeepCopy() *MergeableAuthenticationSpec { - if in == nil { - return nil - } - out := new(MergeableAuthenticationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableAuthorizationSpec) DeepCopyInto(out *MergeableAuthorizationSpec) { - *out = *in - in.AuthorizationSpec.DeepCopyInto(&out.AuthorizationSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableAuthorizationSpec. -func (in *MergeableAuthorizationSpec) DeepCopy() *MergeableAuthorizationSpec { - if in == nil { - return nil - } - out := new(MergeableAuthorizationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableCallbackSpec) DeepCopyInto(out *MergeableCallbackSpec) { - *out = *in - in.CallbackSpec.DeepCopyInto(&out.CallbackSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableCallbackSpec. -func (in *MergeableCallbackSpec) DeepCopy() *MergeableCallbackSpec { - if in == nil { - return nil - } - out := new(MergeableCallbackSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableDenyWithSpec) DeepCopyInto(out *MergeableDenyWithSpec) { - *out = *in - in.DenyWithSpec.DeepCopyInto(&out.DenyWithSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableDenyWithSpec. -func (in *MergeableDenyWithSpec) DeepCopy() *MergeableDenyWithSpec { - if in == nil { - return nil - } - out := new(MergeableDenyWithSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableHeaderSuccessResponseSpec) DeepCopyInto(out *MergeableHeaderSuccessResponseSpec) { - *out = *in - in.HeaderSuccessResponseSpec.DeepCopyInto(&out.HeaderSuccessResponseSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableHeaderSuccessResponseSpec. -func (in *MergeableHeaderSuccessResponseSpec) DeepCopy() *MergeableHeaderSuccessResponseSpec { - if in == nil { - return nil - } - out := new(MergeableHeaderSuccessResponseSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableMetadataSpec) DeepCopyInto(out *MergeableMetadataSpec) { - *out = *in - in.MetadataSpec.DeepCopyInto(&out.MetadataSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableMetadataSpec. -func (in *MergeableMetadataSpec) DeepCopy() *MergeableMetadataSpec { - if in == nil { - return nil - } - out := new(MergeableMetadataSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeablePatternExpressionOrRef) DeepCopyInto(out *MergeablePatternExpressionOrRef) { - *out = *in - in.PatternExpressionOrRef.DeepCopyInto(&out.PatternExpressionOrRef) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeablePatternExpressionOrRef. -func (in *MergeablePatternExpressionOrRef) DeepCopy() *MergeablePatternExpressionOrRef { - if in == nil { - return nil - } - out := new(MergeablePatternExpressionOrRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeablePatternExpressions) DeepCopyInto(out *MergeablePatternExpressions) { - *out = *in - if in.PatternExpressions != nil { - in, out := &in.PatternExpressions, &out.PatternExpressions - *out = make(apiv1beta3.PatternExpressions, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeablePatternExpressions. -func (in *MergeablePatternExpressions) DeepCopy() *MergeablePatternExpressions { - if in == nil { - return nil - } - out := new(MergeablePatternExpressions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableRateLimitPolicySpec) DeepCopyInto(out *MergeableRateLimitPolicySpec) { - *out = *in - in.RateLimitPolicySpecProper.DeepCopyInto(&out.RateLimitPolicySpecProper) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableRateLimitPolicySpec. -func (in *MergeableRateLimitPolicySpec) DeepCopy() *MergeableRateLimitPolicySpec { - if in == nil { - return nil - } - out := new(MergeableRateLimitPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableResponseSpec) DeepCopyInto(out *MergeableResponseSpec) { - *out = *in - if in.Unauthenticated != nil { - in, out := &in.Unauthenticated, &out.Unauthenticated - *out = new(MergeableDenyWithSpec) - (*in).DeepCopyInto(*out) - } - if in.Unauthorized != nil { - in, out := &in.Unauthorized, &out.Unauthorized - *out = new(MergeableDenyWithSpec) - (*in).DeepCopyInto(*out) - } - in.Success.DeepCopyInto(&out.Success) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableResponseSpec. -func (in *MergeableResponseSpec) DeepCopy() *MergeableResponseSpec { - if in == nil { - return nil - } - out := new(MergeableResponseSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableSuccessResponseSpec) DeepCopyInto(out *MergeableSuccessResponseSpec) { - *out = *in - in.SuccessResponseSpec.DeepCopyInto(&out.SuccessResponseSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableSuccessResponseSpec. -func (in *MergeableSuccessResponseSpec) DeepCopy() *MergeableSuccessResponseSpec { - if in == nil { - return nil - } - out := new(MergeableSuccessResponseSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableWhenPredicates) DeepCopyInto(out *MergeableWhenPredicates) { - *out = *in - if in.Predicates != nil { - in, out := &in.Predicates, &out.Predicates - *out = make(WhenPredicates, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableWhenPredicates. -func (in *MergeableWhenPredicates) DeepCopy() *MergeableWhenPredicates { - if in == nil { - return nil - } - out := new(MergeableWhenPredicates) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MergeableWrappedSuccessResponseSpec) DeepCopyInto(out *MergeableWrappedSuccessResponseSpec) { - *out = *in - if in.Headers != nil { - in, out := &in.Headers, &out.Headers - *out = make(map[string]MergeableHeaderSuccessResponseSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.DynamicMetadata != nil { - in, out := &in.DynamicMetadata, &out.DynamicMetadata - *out = make(map[string]MergeableSuccessResponseSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeableWrappedSuccessResponseSpec. -func (in *MergeableWrappedSuccessResponseSpec) DeepCopy() *MergeableWrappedSuccessResponseSpec { - if in == nil { - return nil - } - out := new(MergeableWrappedSuccessResponseSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Predicate) DeepCopyInto(out *Predicate) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Predicate. -func (in *Predicate) DeepCopy() *Predicate { - if in == nil { - return nil - } - out := new(Predicate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Rate) DeepCopyInto(out *Rate) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rate. -func (in *Rate) DeepCopy() *Rate { - if in == nil { - return nil - } - out := new(Rate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RateLimitPolicy) DeepCopyInto(out *RateLimitPolicy) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicy. -func (in *RateLimitPolicy) DeepCopy() *RateLimitPolicy { - if in == nil { - return nil - } - out := new(RateLimitPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RateLimitPolicy) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RateLimitPolicyList) DeepCopyInto(out *RateLimitPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RateLimitPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicyList. -func (in *RateLimitPolicyList) DeepCopy() *RateLimitPolicyList { - if in == nil { - return nil - } - out := new(RateLimitPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RateLimitPolicyList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RateLimitPolicySpec) DeepCopyInto(out *RateLimitPolicySpec) { - *out = *in - in.TargetRef.DeepCopyInto(&out.TargetRef) - if in.Defaults != nil { - in, out := &in.Defaults, &out.Defaults - *out = new(MergeableRateLimitPolicySpec) - (*in).DeepCopyInto(*out) - } - if in.Overrides != nil { - in, out := &in.Overrides, &out.Overrides - *out = new(MergeableRateLimitPolicySpec) - (*in).DeepCopyInto(*out) - } - in.RateLimitPolicySpecProper.DeepCopyInto(&out.RateLimitPolicySpecProper) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicySpec. -func (in *RateLimitPolicySpec) DeepCopy() *RateLimitPolicySpec { - if in == nil { - return nil - } - out := new(RateLimitPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RateLimitPolicySpecProper) DeepCopyInto(out *RateLimitPolicySpecProper) { - *out = *in - in.MergeableWhenPredicates.DeepCopyInto(&out.MergeableWhenPredicates) - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(map[string]Limit, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicySpecProper. -func (in *RateLimitPolicySpecProper) DeepCopy() *RateLimitPolicySpecProper { - if in == nil { - return nil - } - out := new(RateLimitPolicySpecProper) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RateLimitPolicyStatus) DeepCopyInto(out *RateLimitPolicyStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitPolicyStatus. -func (in *RateLimitPolicyStatus) DeepCopy() *RateLimitPolicyStatus { - if in == nil { - return nil - } - out := new(RateLimitPolicyStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in WhenPredicates) DeepCopyInto(out *WhenPredicates) { - { - in := &in - *out = make(WhenPredicates, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WhenPredicates. -func (in WhenPredicates) DeepCopy() WhenPredicates { - if in == nil { - return nil - } - out := new(WhenPredicates) - in.DeepCopyInto(out) - return *out -} diff --git a/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml b/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml index 25d8c67e8..d08667ef4 100644 --- a/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kuadrant-operator.clusterserviceversion.yaml @@ -6,51 +6,6 @@ metadata: [ { "apiVersion": "kuadrant.io/v1", - "kind": "DNSPolicy", - "metadata": { - "name": "dnspolicy-sample" - }, - "spec": { - "healthCheck": { - "endpoint": "/", - "protocol": "HTTP" - }, - "targetRef": { - "group": "gateway.networking.k8s.io", - "kind": "Gateway", - "name": "example-gateway" - } - } - }, - { - "apiVersion": "kuadrant.io/v1", - "kind": "TLSPolicy", - "metadata": { - "name": "tlspolicy-sample" - }, - "spec": { - "issuerRef": { - "group": "cert-manager.io", - "kind": "ClusterIssuer", - "name": "self-signed-ca" - }, - "targetRef": { - "group": "gateway.networking.k8s.io", - "kind": "Gateway", - "name": "example-gateway" - } - } - }, - { - "apiVersion": "kuadrant.io/v1beta1", - "kind": "Kuadrant", - "metadata": { - "name": "kuadrant-sample" - }, - "spec": {} - }, - { - "apiVersion": "kuadrant.io/v1beta3", "kind": "AuthPolicy", "metadata": { "name": "toystore" @@ -78,7 +33,25 @@ metadata: } }, { - "apiVersion": "kuadrant.io/v1beta3", + "apiVersion": "kuadrant.io/v1", + "kind": "DNSPolicy", + "metadata": { + "name": "dnspolicy-sample" + }, + "spec": { + "healthCheck": { + "endpoint": "/", + "protocol": "HTTP" + }, + "targetRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "example-gateway" + } + } + }, + { + "apiVersion": "kuadrant.io/v1", "kind": "RateLimitPolicy", "metadata": { "name": "toystore" @@ -100,12 +73,39 @@ metadata: "name": "toystore" } } + }, + { + "apiVersion": "kuadrant.io/v1", + "kind": "TLSPolicy", + "metadata": { + "name": "tlspolicy-sample" + }, + "spec": { + "issuerRef": { + "group": "cert-manager.io", + "kind": "ClusterIssuer", + "name": "self-signed-ca" + }, + "targetRef": { + "group": "gateway.networking.k8s.io", + "kind": "Gateway", + "name": "example-gateway" + } + } + }, + { + "apiVersion": "kuadrant.io/v1beta1", + "kind": "Kuadrant", + "metadata": { + "name": "kuadrant-sample" + }, + "spec": {} } ] capabilities: Basic Install categories: Integration & Delivery containerImage: quay.io/kuadrant/kuadrant-operator:latest - createdAt: "2024-11-07T16:48:25Z" + createdAt: "2024-11-08T14:46:34Z" description: A Kubernetes Operator to manage the lifecycle of the Kuadrant system operators.operatorframework.io/builder: operator-sdk-v1.32.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 @@ -117,9 +117,12 @@ spec: apiservicedefinitions: {} customresourcedefinitions: owned: - - kind: AuthPolicy + - description: AuthPolicy enables authentication and authorization for service + workloads in a Gateway API network + displayName: AuthPolicy + kind: AuthPolicy name: authpolicies.kuadrant.io - version: v1beta3 + version: v1 - description: DNSPolicy configures how North-South based traffic should be balanced and reach the gateways displayName: DNSPolicy @@ -137,7 +140,7 @@ spec: displayName: RateLimitPolicy kind: RateLimitPolicy name: ratelimitpolicies.kuadrant.io - version: v1beta3 + version: v1 - description: TLSPolicy provides tls for gateway listeners by managing the lifecycle of tls certificates displayName: TLSPolicy diff --git a/bundle/manifests/kuadrant.io_authpolicies.yaml b/bundle/manifests/kuadrant.io_authpolicies.yaml index 011fcbf92..67552606e 100644 --- a/bundle/manifests/kuadrant.io_authpolicies.yaml +++ b/bundle/manifests/kuadrant.io_authpolicies.yaml @@ -46,7 +46,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta3 + name: v1 schema: openAPIV3Schema: description: AuthPolicy enables authentication and authorization for service diff --git a/bundle/manifests/kuadrant.io_ratelimitpolicies.yaml b/bundle/manifests/kuadrant.io_ratelimitpolicies.yaml index ba305eaa8..a35db04e4 100644 --- a/bundle/manifests/kuadrant.io_ratelimitpolicies.yaml +++ b/bundle/manifests/kuadrant.io_ratelimitpolicies.yaml @@ -46,7 +46,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta3 + name: v1 schema: openAPIV3Schema: description: RateLimitPolicy enables rate limiting for service workloads in diff --git a/charts/kuadrant-operator/templates/manifests.yaml b/charts/kuadrant-operator/templates/manifests.yaml index a11342022..36f814c01 100644 --- a/charts/kuadrant-operator/templates/manifests.yaml +++ b/charts/kuadrant-operator/templates/manifests.yaml @@ -46,7 +46,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta3 + name: v1 schema: openAPIV3Schema: description: AuthPolicy enables authentication and authorization for service @@ -7654,7 +7654,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta3 + name: v1 schema: openAPIV3Schema: description: RateLimitPolicy enables rate limiting for service workloads in diff --git a/config/crd/bases/kuadrant.io_authpolicies.yaml b/config/crd/bases/kuadrant.io_authpolicies.yaml index 0d932203a..86f122372 100644 --- a/config/crd/bases/kuadrant.io_authpolicies.yaml +++ b/config/crd/bases/kuadrant.io_authpolicies.yaml @@ -45,7 +45,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta3 + name: v1 schema: openAPIV3Schema: description: AuthPolicy enables authentication and authorization for service diff --git a/config/crd/bases/kuadrant.io_ratelimitpolicies.yaml b/config/crd/bases/kuadrant.io_ratelimitpolicies.yaml index 202651535..9dbab91d8 100644 --- a/config/crd/bases/kuadrant.io_ratelimitpolicies.yaml +++ b/config/crd/bases/kuadrant.io_ratelimitpolicies.yaml @@ -45,7 +45,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date - name: v1beta3 + name: v1 schema: openAPIV3Schema: description: RateLimitPolicy enables rate limiting for service workloads in diff --git a/config/manifests/bases/kuadrant-operator.clusterserviceversion.yaml b/config/manifests/bases/kuadrant-operator.clusterserviceversion.yaml index 3ae5e6db0..014e10ac5 100644 --- a/config/manifests/bases/kuadrant-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/kuadrant-operator.clusterserviceversion.yaml @@ -26,12 +26,12 @@ spec: displayName: AuthPolicy kind: AuthPolicy name: authpolicies.kuadrant.io - version: v1beta2 + version: v1 - description: RateLimitPolicy enables rate limiting for service workloads in a Gateway API network displayName: RateLimitPolicy kind: RateLimitPolicy name: ratelimitpolicies.kuadrant.io - version: v1beta3 + version: v1 - description: DNSPolicy configures how North-South based traffic should be balanced and reach the gateways displayName: DNSPolicy kind: DNSPolicy diff --git a/config/samples/kuadrant_v1beta3_authpolicy.yaml b/config/samples/kuadrant_v1_authpolicy.yaml similarity index 90% rename from config/samples/kuadrant_v1beta3_authpolicy.yaml rename to config/samples/kuadrant_v1_authpolicy.yaml index ad9706f54..669ed20a0 100644 --- a/config/samples/kuadrant_v1beta3_authpolicy.yaml +++ b/config/samples/kuadrant_v1_authpolicy.yaml @@ -1,5 +1,5 @@ --- -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: AuthPolicy metadata: name: toystore diff --git a/config/samples/kuadrant_v1beta3_ratelimitpolicy.yaml b/config/samples/kuadrant_v1_ratelimitpolicy.yaml similarity index 87% rename from config/samples/kuadrant_v1beta3_ratelimitpolicy.yaml rename to config/samples/kuadrant_v1_ratelimitpolicy.yaml index 61e91f108..3df46583a 100644 --- a/config/samples/kuadrant_v1beta3_ratelimitpolicy.yaml +++ b/config/samples/kuadrant_v1_ratelimitpolicy.yaml @@ -1,5 +1,5 @@ --- -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: RateLimitPolicy metadata: name: toystore diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 55380e39a..2670b77de 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,8 +1,8 @@ ## Append samples you want in your CSV to this file as resources ## resources: - kuadrant_v1beta1_kuadrant.yaml -- kuadrant_v1beta3_authpolicy.yaml -- kuadrant_v1beta3_ratelimitpolicy.yaml +- kuadrant_v1_authpolicy.yaml +- kuadrant_v1_ratelimitpolicy.yaml - kuadrant_v1_dnspolicy.yaml - kuadrant_v1_tlspolicy.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/controllers/auth_policies_validator.go b/controllers/auth_policies_validator.go index 69c72be83..95500e3cd 100644 --- a/controllers/auth_policies_validator.go +++ b/controllers/auth_policies_validator.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/ptr" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrant "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" ) @@ -24,8 +24,8 @@ func (r *AuthPolicyValidator) Subscription() controller.Subscription { Events: []controller.ResourceEventMatcher{ {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind, EventType: ptr.To(controller.CreateEvent)}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind, EventType: ptr.To(controller.UpdateEvent)}, + {Kind: &kuadrantv1.AuthPolicyGroupKind, EventType: ptr.To(controller.CreateEvent)}, + {Kind: &kuadrantv1.AuthPolicyGroupKind, EventType: ptr.To(controller.UpdateEvent)}, }, } } @@ -34,7 +34,7 @@ func (r *AuthPolicyValidator) Validate(ctx context.Context, _ []controller.Resou logger := controller.LoggerFromContext(ctx).WithName("AuthPolicyValidator") policies := topology.Policies().Items(func(o machinery.Object) bool { - return o.GroupVersionKind().GroupKind() == kuadrantv1beta3.AuthPolicyGroupKind + return o.GroupVersionKind().GroupKind() == kuadrantv1.AuthPolicyGroupKind }) logger.V(1).Info("validating auth policies", "policies", len(policies)) @@ -51,7 +51,7 @@ func (r *AuthPolicyValidator) Validate(ctx context.Context, _ []controller.Resou case machinery.HTTPRouteGroupKind.Kind: res = controller.HTTPRoutesResource.GroupResource() } - err = kuadrant.NewErrPolicyTargetNotFound(kuadrantv1beta3.AuthPolicyGroupKind.Kind, ref, apierrors.NewNotFound(res, ref.GetName())) + err = kuadrant.NewErrPolicyTargetNotFound(kuadrantv1.AuthPolicyGroupKind.Kind, ref, apierrors.NewNotFound(res, ref.GetName())) } return policy.GetLocator(), err })) diff --git a/controllers/auth_policy_status_updater.go b/controllers/auth_policy_status_updater.go index 23fac78b4..687a10c98 100644 --- a/controllers/auth_policy_status_updater.go +++ b/controllers/auth_policy_status_updater.go @@ -23,7 +23,6 @@ import ( kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" kuadrantistio "github.com/kuadrant/kuadrant-operator/pkg/istio" @@ -44,7 +43,7 @@ func (r *AuthPolicyStatusUpdater) Subscription() controller.Subscription { {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, {Kind: &kuadrantv1beta1.AuthConfigGroupKind}, {Kind: &kuadrantistio.EnvoyFilterGroupKind}, {Kind: &kuadrantistio.WasmPluginGroupKind}, @@ -57,8 +56,8 @@ func (r *AuthPolicyStatusUpdater) Subscription() controller.Subscription { func (r *AuthPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error { logger := controller.LoggerFromContext(ctx).WithName("AuthPolicyStatusUpdater") - policies := lo.FilterMap(topology.Policies().Items(), func(item machinery.Policy, index int) (*kuadrantv1beta3.AuthPolicy, bool) { - p, ok := item.(*kuadrantv1beta3.AuthPolicy) + policies := lo.FilterMap(topology.Policies().Items(), func(item machinery.Policy, index int) (*kuadrantv1.AuthPolicy, bool) { + p, ok := item.(*kuadrantv1.AuthPolicy) return p, ok }) @@ -74,7 +73,7 @@ func (r *AuthPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controll } // copy initial conditions, otherwise status will always be updated - newStatus := &kuadrantv1beta3.AuthPolicyStatus{ + newStatus := &kuadrantv1.AuthPolicyStatus{ Conditions: slices.Clone(policy.Status.Conditions), ObservedGeneration: policy.Status.ObservedGeneration, } @@ -104,7 +103,7 @@ func (r *AuthPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controll continue } - _, err = r.client.Resource(kuadrantv1beta3.AuthPoliciesResource).Namespace(policy.GetNamespace()).UpdateStatus(ctx, obj, metav1.UpdateOptions{}) + _, err = r.client.Resource(kuadrantv1.AuthPoliciesResource).Namespace(policy.GetNamespace()).UpdateStatus(ctx, obj, metav1.UpdateOptions{}) if err != nil { logger.Error(err, "unable to update status for authpolicy", "name", policy.GetName(), "namespace", policy.GetNamespace()) // TODO: handle error @@ -114,8 +113,8 @@ func (r *AuthPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controll return nil } -func (r *AuthPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1beta3.AuthPolicy, topology *machinery.Topology, state *sync.Map) *metav1.Condition { - policyKind := kuadrantv1beta3.AuthPolicyGroupKind.Kind +func (r *AuthPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.AuthPolicy, topology *machinery.Topology, state *sync.Map) *metav1.Condition { + policyKind := kuadrantv1.AuthPolicyGroupKind.Kind effectivePolicies, ok := state.Load(StateEffectiveAuthPolicies) if !ok { diff --git a/controllers/auth_workflow_helpers.go b/controllers/auth_workflow_helpers.go index 0e65cb74f..e04dadc67 100644 --- a/controllers/auth_workflow_helpers.go +++ b/controllers/auth_workflow_helpers.go @@ -15,8 +15,8 @@ import ( "k8s.io/apimachinery/pkg/labels" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" "github.com/kuadrant/kuadrant-operator/pkg/wasm" ) @@ -164,7 +164,7 @@ func authPolicyAcceptedStatusFunc(state *sync.Map) func(policy machinery.Policy) } func authPolicyAcceptedStatus(policy machinery.Policy) (accepted bool, err error) { - p, ok := policy.(*kuadrantv1beta3.AuthPolicy) + p, ok := policy.(*kuadrantv1.AuthPolicy) if !ok { return } diff --git a/controllers/authconfigs_reconciler.go b/controllers/authconfigs_reconciler.go index de6725210..5c19cc873 100644 --- a/controllers/authconfigs_reconciler.go +++ b/controllers/authconfigs_reconciler.go @@ -16,8 +16,8 @@ import ( k8stypes "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/dynamic" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" "github.com/kuadrant/kuadrant-operator/pkg/library/utils" ) @@ -35,7 +35,7 @@ func (r *AuthConfigsReconciler) Subscription() controller.Subscription { {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, {Kind: &kuadrantv1beta1.AuthConfigGroupKind}, }, } @@ -174,7 +174,7 @@ func (r *AuthConfigsReconciler) buildDesiredAuthConfig(effectivePolicy Effective // named patterns if namedPatterns := spec.NamedPatterns; namedPatterns != nil { - authConfig.Spec.NamedPatterns = lo.MapValues(spec.NamedPatterns, func(v kuadrantv1beta3.MergeablePatternExpressions, _ string) authorinov1beta3.PatternExpressions { + authConfig.Spec.NamedPatterns = lo.MapValues(spec.NamedPatterns, func(v kuadrantv1.MergeablePatternExpressions, _ string) authorinov1beta3.PatternExpressions { return v.PatternExpressions }) } @@ -187,21 +187,21 @@ func (r *AuthConfigsReconciler) buildDesiredAuthConfig(effectivePolicy Effective // authentication if authentication := authScheme.Authentication; authentication != nil { - authConfig.Spec.Authentication = lo.MapValues(authentication, func(v kuadrantv1beta3.MergeableAuthenticationSpec, _ string) authorinov1beta3.AuthenticationSpec { + authConfig.Spec.Authentication = lo.MapValues(authentication, func(v kuadrantv1.MergeableAuthenticationSpec, _ string) authorinov1beta3.AuthenticationSpec { return v.AuthenticationSpec }) } // metadata if metadata := authScheme.Metadata; metadata != nil { - authConfig.Spec.Metadata = lo.MapValues(metadata, func(v kuadrantv1beta3.MergeableMetadataSpec, _ string) authorinov1beta3.MetadataSpec { + authConfig.Spec.Metadata = lo.MapValues(metadata, func(v kuadrantv1.MergeableMetadataSpec, _ string) authorinov1beta3.MetadataSpec { return v.MetadataSpec }) } // authorization if authorization := authScheme.Authorization; authorization != nil { - authConfig.Spec.Authorization = lo.MapValues(authorization, func(v kuadrantv1beta3.MergeableAuthorizationSpec, _ string) authorinov1beta3.AuthorizationSpec { + authConfig.Spec.Authorization = lo.MapValues(authorization, func(v kuadrantv1.MergeableAuthorizationSpec, _ string) authorinov1beta3.AuthorizationSpec { return v.AuthorizationSpec }) } @@ -222,10 +222,10 @@ func (r *AuthConfigsReconciler) buildDesiredAuthConfig(effectivePolicy Effective Unauthenticated: unauthenticated, Unauthorized: unauthorized, Success: authorinov1beta3.WrappedSuccessResponseSpec{ - Headers: authorinoSpecsFromConfigs(response.Success.Headers, func(config kuadrantv1beta3.MergeableHeaderSuccessResponseSpec) authorinov1beta3.HeaderSuccessResponseSpec { + Headers: authorinoSpecsFromConfigs(response.Success.Headers, func(config kuadrantv1.MergeableHeaderSuccessResponseSpec) authorinov1beta3.HeaderSuccessResponseSpec { return authorinov1beta3.HeaderSuccessResponseSpec{SuccessResponseSpec: config.SuccessResponseSpec} }), - DynamicMetadata: authorinoSpecsFromConfigs(response.Success.DynamicMetadata, func(config kuadrantv1beta3.MergeableSuccessResponseSpec) authorinov1beta3.SuccessResponseSpec { + DynamicMetadata: authorinoSpecsFromConfigs(response.Success.DynamicMetadata, func(config kuadrantv1.MergeableSuccessResponseSpec) authorinov1beta3.SuccessResponseSpec { return config.SuccessResponseSpec }), }, @@ -234,7 +234,7 @@ func (r *AuthConfigsReconciler) buildDesiredAuthConfig(effectivePolicy Effective // callbacks if callbacks := authScheme.Callbacks; callbacks != nil { - authConfig.Spec.Callbacks = lo.MapValues(callbacks, func(v kuadrantv1beta3.MergeableCallbackSpec, _ string) authorinov1beta3.CallbackSpec { + authConfig.Spec.Callbacks = lo.MapValues(callbacks, func(v kuadrantv1.MergeableCallbackSpec, _ string) authorinov1beta3.CallbackSpec { return v.CallbackSpec }) } diff --git a/controllers/common.go b/controllers/common.go index 834e32f8f..eccf23714 100644 --- a/controllers/common.go +++ b/controllers/common.go @@ -13,7 +13,6 @@ import ( gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" ) const ( @@ -56,9 +55,9 @@ func PolicyAffectedConditionType(policyKind string) string { func IsPolicyAccepted(ctx context.Context, p machinery.Policy, s *sync.Map) bool { switch t := p.(type) { - case *kuadrantv1beta3.AuthPolicy: + case *kuadrantv1.AuthPolicy: return isAuthPolicyAcceptedFunc(s)(p) - case *kuadrantv1beta3.RateLimitPolicy: + case *kuadrantv1.RateLimitPolicy: return isRateLimitPolicyAcceptedFunc(s)(p) case *kuadrantv1.TLSPolicy: isValid, _ := IsTLSPolicyValid(ctx, s, t) @@ -73,8 +72,8 @@ func IsPolicyAccepted(ctx context.Context, p machinery.Policy, s *sync.Map) bool func policyGroupKinds() []*schema.GroupKind { return []*schema.GroupKind{ - &kuadrantv1beta3.AuthPolicyGroupKind, - &kuadrantv1beta3.RateLimitPolicyGroupKind, + &kuadrantv1.AuthPolicyGroupKind, + &kuadrantv1.RateLimitPolicyGroupKind, &kuadrantv1.TLSPolicyGroupKind, &kuadrantv1.DNSPolicyGroupKind, } diff --git a/controllers/data_plane_policies_workflow.go b/controllers/data_plane_policies_workflow.go index 8ad460dee..cd7352d12 100644 --- a/controllers/data_plane_policies_workflow.go +++ b/controllers/data_plane_policies_workflow.go @@ -10,8 +10,8 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/utils/env" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" kuadrantistio "github.com/kuadrant/kuadrant-operator/pkg/istio" ) @@ -34,9 +34,9 @@ var ( {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantv1beta1.LimitadorGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, {Kind: &kuadrantv1beta1.AuthConfigGroupKind}, {Kind: &kuadrantistio.EnvoyFilterGroupKind}, {Kind: &kuadrantistio.WasmPluginGroupKind}, diff --git a/controllers/effective_auth_policies_reconciler.go b/controllers/effective_auth_policies_reconciler.go index d444373d2..865c2e315 100644 --- a/controllers/effective_auth_policies_reconciler.go +++ b/controllers/effective_auth_policies_reconciler.go @@ -12,12 +12,11 @@ import ( "k8s.io/client-go/dynamic" kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" ) type EffectiveAuthPolicy struct { Path []machinery.Targetable - Spec kuadrantv1beta3.AuthPolicy + Spec kuadrantv1.AuthPolicy } type EffectiveAuthPolicies map[string]EffectiveAuthPolicy @@ -71,7 +70,7 @@ func (r *EffectiveAuthPolicyReconciler) calculateEffectivePolicies(ctx context.C for _, httpRouteRule := range httpRouteRules { paths := targetables.Paths(gatewayClass, httpRouteRule) // this may be expensive in clusters with many gateway classes - an alternative is to deep search the topology for httprouterules from each gatewayclass, keeping record of the paths for i := range paths { - if effectivePolicy := kuadrantv1.EffectivePolicyForPath[*kuadrantv1beta3.AuthPolicy](paths[i], isAuthPolicyAcceptedAndNotDeletedFunc(state)); effectivePolicy != nil { + if effectivePolicy := kuadrantv1.EffectivePolicyForPath[*kuadrantv1.AuthPolicy](paths[i], isAuthPolicyAcceptedAndNotDeletedFunc(state)); effectivePolicy != nil { pathID := kuadrantv1.PathID(paths[i]) effectivePolicies[pathID] = EffectiveAuthPolicy{ Path: paths[i], @@ -80,7 +79,7 @@ func (r *EffectiveAuthPolicyReconciler) calculateEffectivePolicies(ctx context.C if logger.V(1).Enabled() { jsonEffectivePolicy, _ := json.Marshal(effectivePolicy) pathLocators := lo.Map(paths[i], machinery.MapTargetableToLocatorFunc) - logger.V(1).Info("effective policy", "kind", kuadrantv1beta3.AuthPolicyGroupKind.Kind, "pathID", pathID, "path", pathLocators, "effectivePolicy", string(jsonEffectivePolicy)) + logger.V(1).Info("effective policy", "kind", kuadrantv1.AuthPolicyGroupKind.Kind, "pathID", pathID, "path", pathLocators, "effectivePolicy", string(jsonEffectivePolicy)) } } } diff --git a/controllers/effective_ratelimit_policies_reconciler.go b/controllers/effective_ratelimit_policies_reconciler.go index 0976d57bf..d7982c7af 100644 --- a/controllers/effective_ratelimit_policies_reconciler.go +++ b/controllers/effective_ratelimit_policies_reconciler.go @@ -12,12 +12,11 @@ import ( "k8s.io/client-go/dynamic" kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" ) type EffectiveRateLimitPolicy struct { Path []machinery.Targetable - Spec kuadrantv1beta3.RateLimitPolicy + Spec kuadrantv1.RateLimitPolicy } type EffectiveRateLimitPolicies map[string]EffectiveRateLimitPolicy @@ -71,7 +70,7 @@ func (r *EffectiveRateLimitPolicyReconciler) calculateEffectivePolicies(ctx cont for _, httpRouteRule := range httpRouteRules { paths := targetables.Paths(gatewayClass, httpRouteRule) // this may be expensive in clusters with many gateway classes - an alternative is to deep search the topology for httprouterules from each gatewayclass, keeping record of the paths for i := range paths { - if effectivePolicy := kuadrantv1.EffectivePolicyForPath[*kuadrantv1beta3.RateLimitPolicy](paths[i], isRateLimitPolicyAcceptedAndNotDeletedFunc(state)); effectivePolicy != nil { + if effectivePolicy := kuadrantv1.EffectivePolicyForPath[*kuadrantv1.RateLimitPolicy](paths[i], isRateLimitPolicyAcceptedAndNotDeletedFunc(state)); effectivePolicy != nil { pathID := kuadrantv1.PathID(paths[i]) effectivePolicies[pathID] = EffectiveRateLimitPolicy{ Path: paths[i], @@ -80,7 +79,7 @@ func (r *EffectiveRateLimitPolicyReconciler) calculateEffectivePolicies(ctx cont if logger.V(1).Enabled() { jsonEffectivePolicy, _ := json.Marshal(effectivePolicy) pathLocators := lo.Map(paths[i], machinery.MapTargetableToLocatorFunc) - logger.V(1).Info("effective policy", "kind", kuadrantv1beta3.RateLimitPolicyGroupKind.Kind, "pathID", pathID, "path", pathLocators, "effectivePolicy", string(jsonEffectivePolicy)) + logger.V(1).Info("effective policy", "kind", kuadrantv1.RateLimitPolicyGroupKind.Kind, "pathID", pathID, "path", pathLocators, "effectivePolicy", string(jsonEffectivePolicy)) } } } diff --git a/controllers/envoy_gateway_auth_cluster_reconciler.go b/controllers/envoy_gateway_auth_cluster_reconciler.go index 363917a87..d70f7d23c 100644 --- a/controllers/envoy_gateway_auth_cluster_reconciler.go +++ b/controllers/envoy_gateway_auth_cluster_reconciler.go @@ -18,8 +18,8 @@ import ( "k8s.io/utils/ptr" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" ) @@ -38,7 +38,7 @@ func (r *EnvoyGatewayAuthClusterReconciler) Subscription() controller.Subscripti {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, {Kind: &kuadrantenvoygateway.EnvoyPatchPolicyGroupKind}, }, } diff --git a/controllers/envoy_gateway_extension_reconciler.go b/controllers/envoy_gateway_extension_reconciler.go index 0b422ff35..c2dc539e1 100644 --- a/controllers/envoy_gateway_extension_reconciler.go +++ b/controllers/envoy_gateway_extension_reconciler.go @@ -17,8 +17,8 @@ import ( "k8s.io/utils/ptr" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi" @@ -40,8 +40,8 @@ func (r *EnvoyGatewayExtensionReconciler) Subscription() controller.Subscription {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantenvoygateway.EnvoyExtensionPolicyGroupKind}, }, } diff --git a/controllers/envoy_gateway_ratelimit_cluster_reconciler.go b/controllers/envoy_gateway_ratelimit_cluster_reconciler.go index df8f36c87..c480567f2 100644 --- a/controllers/envoy_gateway_ratelimit_cluster_reconciler.go +++ b/controllers/envoy_gateway_ratelimit_cluster_reconciler.go @@ -18,8 +18,8 @@ import ( "k8s.io/utils/ptr" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" ) @@ -38,7 +38,7 @@ func (r *EnvoyGatewayRateLimitClusterReconciler) Subscription() controller.Subsc {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantenvoygateway.EnvoyPatchPolicyGroupKind}, }, } diff --git a/controllers/gateway_policy_discoverability_reconciler.go b/controllers/gateway_policy_discoverability_reconciler.go index 98ccd7610..4c739ceeb 100644 --- a/controllers/gateway_policy_discoverability_reconciler.go +++ b/controllers/gateway_policy_discoverability_reconciler.go @@ -16,7 +16,6 @@ import ( gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1" kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" ) type GatewayPolicyDiscoverabilityReconciler struct { @@ -31,8 +30,8 @@ func (r *GatewayPolicyDiscoverabilityReconciler) Subscription() *controller.Subs return &controller.Subscription{ Events: []controller.ResourceEventMatcher{ {Kind: &machinery.GatewayGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantv1.TLSPolicyGroupKind}, {Kind: &kuadrantv1.DNSPolicyGroupKind}, }, diff --git a/controllers/httproute_policy_discoverability_reconciler.go b/controllers/httproute_policy_discoverability_reconciler.go index 6df4d4385..525cbade2 100644 --- a/controllers/httproute_policy_discoverability_reconciler.go +++ b/controllers/httproute_policy_discoverability_reconciler.go @@ -18,7 +18,6 @@ import ( gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1" kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" "github.com/kuadrant/kuadrant-operator/pkg/library/utils" ) @@ -36,8 +35,8 @@ func (r *HTTPRoutePolicyDiscoverabilityReconciler) Subscription() *controller.Su Events: []controller.ResourceEventMatcher{ {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantv1.TLSPolicyGroupKind}, {Kind: &kuadrantv1.DNSPolicyGroupKind}, }, diff --git a/controllers/httprouteparentrefs_eventmapper.go b/controllers/httprouteparentrefs_eventmapper.go index ae3a7e7d8..98389a6a9 100644 --- a/controllers/httprouteparentrefs_eventmapper.go +++ b/controllers/httprouteparentrefs_eventmapper.go @@ -10,7 +10,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi" "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" ) @@ -24,11 +24,11 @@ type HTTPRouteParentRefsEventMapper struct { } func (m *HTTPRouteParentRefsEventMapper) MapToRateLimitPolicy(obj client.Object) []reconcile.Request { - return m.mapToPolicyRequest(obj, "ratelimitpolicy", &kuadrantv1beta3.RateLimitPolicyList{}) + return m.mapToPolicyRequest(obj, "ratelimitpolicy", &kuadrantv1.RateLimitPolicyList{}) } func (m *HTTPRouteParentRefsEventMapper) MapToAuthPolicy(obj client.Object) []reconcile.Request { - return m.mapToPolicyRequest(obj, "authpolicy", &kuadrantv1beta3.AuthPolicyList{}) + return m.mapToPolicyRequest(obj, "authpolicy", &kuadrantv1.AuthPolicyList{}) } func (m *HTTPRouteParentRefsEventMapper) mapToPolicyRequest(obj client.Object, policyKind string, policyList client.ObjectList) []reconcile.Request { diff --git a/controllers/istio_auth_cluster_reconciler.go b/controllers/istio_auth_cluster_reconciler.go index 53847a9dd..9f76f6f64 100644 --- a/controllers/istio_auth_cluster_reconciler.go +++ b/controllers/istio_auth_cluster_reconciler.go @@ -19,8 +19,8 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/utils/ptr" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantistio "github.com/kuadrant/kuadrant-operator/pkg/istio" ) @@ -39,7 +39,7 @@ func (r *IstioAuthClusterReconciler) Subscription() controller.Subscription { {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, {Kind: &kuadrantistio.EnvoyFilterGroupKind}, }, } diff --git a/controllers/istio_extension_reconciler.go b/controllers/istio_extension_reconciler.go index 3ee02fbc7..9ba474771 100644 --- a/controllers/istio_extension_reconciler.go +++ b/controllers/istio_extension_reconciler.go @@ -18,8 +18,8 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/utils/ptr" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantistio "github.com/kuadrant/kuadrant-operator/pkg/istio" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi" @@ -41,8 +41,8 @@ func (r *IstioExtensionReconciler) Subscription() controller.Subscription { {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, - {Kind: &kuadrantv1beta3.AuthPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.AuthPolicyGroupKind}, {Kind: &kuadrantistio.WasmPluginGroupKind}, }, } diff --git a/controllers/istio_ratelimit_cluster_reconciler.go b/controllers/istio_ratelimit_cluster_reconciler.go index 37462748f..8dd1d8c62 100644 --- a/controllers/istio_ratelimit_cluster_reconciler.go +++ b/controllers/istio_ratelimit_cluster_reconciler.go @@ -19,8 +19,8 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/utils/ptr" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantistio "github.com/kuadrant/kuadrant-operator/pkg/istio" ) @@ -39,7 +39,7 @@ func (r *IstioRateLimitClusterReconciler) Subscription() controller.Subscription {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantistio.EnvoyFilterGroupKind}, }, } diff --git a/controllers/limitador_limits_reconciler.go b/controllers/limitador_limits_reconciler.go index b857e1926..59cd3a2e6 100644 --- a/controllers/limitador_limits_reconciler.go +++ b/controllers/limitador_limits_reconciler.go @@ -16,7 +16,6 @@ import ( kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" "github.com/kuadrant/kuadrant-operator/pkg/library/utils" "github.com/kuadrant/kuadrant-operator/pkg/ratelimit" @@ -35,7 +34,7 @@ func (r *LimitadorLimitsReconciler) Subscription() controller.Subscription { {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantv1beta1.LimitadorGroupKind}, }, } @@ -104,7 +103,7 @@ func (r *LimitadorLimitsReconciler) buildLimitadorLimits(ctx context.Context, st limitRules := lo.Filter(lo.Entries(effectivePolicy.Spec.Rules()), func(r lo.Entry[string, kuadrantv1.MergeableRule], _ int) bool { - return r.Key != kuadrantv1beta3.RulesKeyTopLevelPredicates + return r.Key != kuadrantv1.RulesKeyTopLevelPredicates }, ) @@ -119,8 +118,8 @@ func (r *LimitadorLimitsReconciler) buildLimitadorLimits(ctx context.Context, st continue } limitIdentifier := LimitNameToLimitadorIdentifier(k8stypes.NamespacedName{Name: policy.GetName(), Namespace: policy.GetNamespace()}, limitKey) - limit := mergeableLimit.GetSpec().(*kuadrantv1beta3.Limit) - rateLimits := lo.Map(limit.Rates, func(rate kuadrantv1beta3.Rate, _ int) limitadorv1alpha1.RateLimit { + limit := mergeableLimit.GetSpec().(*kuadrantv1.Limit) + rateLimits := lo.Map(limit.Rates, func(rate kuadrantv1.Rate, _ int) limitadorv1alpha1.RateLimit { maxValue, seconds := rate.ToSeconds() return limitadorv1alpha1.RateLimit{ Namespace: limitsNamespace, diff --git a/controllers/ratelimit_policies_validator.go b/controllers/ratelimit_policies_validator.go index ccd9fdb27..f3d5312b1 100644 --- a/controllers/ratelimit_policies_validator.go +++ b/controllers/ratelimit_policies_validator.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/ptr" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrant "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" ) @@ -24,8 +24,8 @@ func (r *RateLimitPolicyValidator) Subscription() controller.Subscription { Events: []controller.ResourceEventMatcher{ {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind, EventType: ptr.To(controller.CreateEvent)}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind, EventType: ptr.To(controller.UpdateEvent)}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind, EventType: ptr.To(controller.CreateEvent)}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind, EventType: ptr.To(controller.UpdateEvent)}, }, } } @@ -34,7 +34,7 @@ func (r *RateLimitPolicyValidator) Validate(ctx context.Context, _ []controller. logger := controller.LoggerFromContext(ctx).WithName("RateLimitPolicyValidator") policies := topology.Policies().Items(func(o machinery.Object) bool { - return o.GroupVersionKind().GroupKind() == kuadrantv1beta3.RateLimitPolicyGroupKind + return o.GroupVersionKind().GroupKind() == kuadrantv1.RateLimitPolicyGroupKind }) logger.V(1).Info("validating rate limit policies", "policies", len(policies)) @@ -51,7 +51,7 @@ func (r *RateLimitPolicyValidator) Validate(ctx context.Context, _ []controller. case machinery.HTTPRouteGroupKind.Kind: res = controller.HTTPRoutesResource.GroupResource() } - err = kuadrant.NewErrPolicyTargetNotFound(kuadrantv1beta3.RateLimitPolicyGroupKind.Kind, ref, apierrors.NewNotFound(res, ref.GetName())) + err = kuadrant.NewErrPolicyTargetNotFound(kuadrantv1.RateLimitPolicyGroupKind.Kind, ref, apierrors.NewNotFound(res, ref.GetName())) } return policy.GetLocator(), err })) diff --git a/controllers/ratelimit_policy_status_updater.go b/controllers/ratelimit_policy_status_updater.go index ecc7a0a22..82a3eeb2e 100644 --- a/controllers/ratelimit_policy_status_updater.go +++ b/controllers/ratelimit_policy_status_updater.go @@ -22,7 +22,6 @@ import ( kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" kuadrantistio "github.com/kuadrant/kuadrant-operator/pkg/istio" @@ -43,7 +42,7 @@ func (r *RateLimitPolicyStatusUpdater) Subscription() controller.Subscription { {Kind: &machinery.GatewayClassGroupKind}, {Kind: &machinery.GatewayGroupKind}, {Kind: &machinery.HTTPRouteGroupKind}, - {Kind: &kuadrantv1beta3.RateLimitPolicyGroupKind}, + {Kind: &kuadrantv1.RateLimitPolicyGroupKind}, {Kind: &kuadrantv1beta1.LimitadorGroupKind}, {Kind: &kuadrantistio.EnvoyFilterGroupKind}, {Kind: &kuadrantistio.WasmPluginGroupKind}, @@ -56,8 +55,8 @@ func (r *RateLimitPolicyStatusUpdater) Subscription() controller.Subscription { func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error { logger := controller.LoggerFromContext(ctx).WithName("RateLimitPolicyStatusUpdater") - policies := lo.FilterMap(topology.Policies().Items(), func(item machinery.Policy, index int) (*kuadrantv1beta3.RateLimitPolicy, bool) { - p, ok := item.(*kuadrantv1beta3.RateLimitPolicy) + policies := lo.FilterMap(topology.Policies().Items(), func(item machinery.Policy, index int) (*kuadrantv1.RateLimitPolicy, bool) { + p, ok := item.(*kuadrantv1.RateLimitPolicy) return p, ok }) @@ -73,7 +72,7 @@ func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []con } // copy initial conditions, otherwise status will always be updated - newStatus := &kuadrantv1beta3.RateLimitPolicyStatus{ + newStatus := &kuadrantv1.RateLimitPolicyStatus{ Conditions: slices.Clone(policy.Status.Conditions), ObservedGeneration: policy.Status.ObservedGeneration, } @@ -103,7 +102,7 @@ func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []con continue } - _, err = r.client.Resource(kuadrantv1beta3.RateLimitPoliciesResource).Namespace(policy.GetNamespace()).UpdateStatus(ctx, obj, metav1.UpdateOptions{}) + _, err = r.client.Resource(kuadrantv1.RateLimitPoliciesResource).Namespace(policy.GetNamespace()).UpdateStatus(ctx, obj, metav1.UpdateOptions{}) if err != nil { logger.Error(err, "unable to update status for ratelimitpolicy", "name", policy.GetName(), "namespace", policy.GetNamespace()) // TODO: handle error @@ -113,8 +112,8 @@ func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []con return nil } -func (r *RateLimitPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1beta3.RateLimitPolicy, topology *machinery.Topology, state *sync.Map) *metav1.Condition { - policyKind := kuadrantv1beta3.RateLimitPolicyGroupKind.Kind +func (r *RateLimitPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.RateLimitPolicy, topology *machinery.Topology, state *sync.Map) *metav1.Condition { + policyKind := kuadrantv1.RateLimitPolicyGroupKind.Kind effectivePolicies, ok := state.Load(StateEffectiveRateLimitPolicies) if !ok { diff --git a/controllers/ratelimit_workflow_helpers.go b/controllers/ratelimit_workflow_helpers.go index 9382a4c96..b73dc3689 100644 --- a/controllers/ratelimit_workflow_helpers.go +++ b/controllers/ratelimit_workflow_helpers.go @@ -20,7 +20,6 @@ import ( kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/common" "github.com/kuadrant/kuadrant-operator/pkg/wasm" ) @@ -131,16 +130,16 @@ func buildWasmActionsForRateLimit(effectivePolicy EffectiveRateLimitPolicy, stat topLevelRules, limitRules := lo.FilterReject(lo.Entries(effectivePolicy.Spec.Rules()), func(r lo.Entry[string, kuadrantv1.MergeableRule], _ int) bool { - return r.Key == kuadrantv1beta3.RulesKeyTopLevelPredicates + return r.Key == kuadrantv1.RulesKeyTopLevelPredicates }, ) - var topLevelWhenPredicates kuadrantv1beta3.WhenPredicates + var topLevelWhenPredicates kuadrantv1.WhenPredicates if len(topLevelRules) > 0 { if len(topLevelRules) > 1 { panic("rate limit policy with multiple top level 'when' predicate lists") } - topLevelWhenPredicates = topLevelRules[0].Value.GetSpec().(kuadrantv1beta3.WhenPredicates) + topLevelWhenPredicates = topLevelRules[0].Value.GetSpec().(kuadrantv1.WhenPredicates) } return lo.FilterMap(limitRules, func(r lo.Entry[string, kuadrantv1.MergeableRule], _ int) (wasm.Action, bool) { @@ -153,7 +152,7 @@ func buildWasmActionsForRateLimit(effectivePolicy EffectiveRateLimitPolicy, stat return wasm.Action{}, false } limitIdentifier := LimitNameToLimitadorIdentifier(k8stypes.NamespacedName{Name: source.GetName(), Namespace: source.GetNamespace()}, uniquePolicyRuleKey) - limit := policyRule.GetSpec().(*kuadrantv1beta3.Limit) + limit := policyRule.GetSpec().(*kuadrantv1.Limit) return wasmActionFromLimit(limit, limitIdentifier, limitsNamespace, topLevelWhenPredicates), true }) } @@ -163,7 +162,7 @@ func buildWasmActionsForRateLimit(effectivePolicy EffectiveRateLimitPolicy, stat // // The only action of the rule is the ratelimit service, whose data includes the activation of the limit // and any counter qualifier of the limit. -func wasmActionFromLimit(limit *kuadrantv1beta3.Limit, limitIdentifier, scope string, topLevelPredicates kuadrantv1beta3.WhenPredicates) wasm.Action { +func wasmActionFromLimit(limit *kuadrantv1.Limit, limitIdentifier, scope string, topLevelPredicates kuadrantv1.WhenPredicates) wasm.Action { return wasm.Action{ ServiceName: wasm.RateLimitServiceName, Scope: scope, @@ -172,7 +171,7 @@ func wasmActionFromLimit(limit *kuadrantv1beta3.Limit, limitIdentifier, scope st } } -func wasmDataFromLimit(limitIdentifier string, limit *kuadrantv1beta3.Limit) []wasm.DataType { +func wasmDataFromLimit(limitIdentifier string, limit *kuadrantv1.Limit) []wasm.DataType { data := make([]wasm.DataType, 0) // static key representing the limit @@ -232,7 +231,7 @@ func rateLimitPolicyAcceptedStatusFunc(state *sync.Map) func(policy machinery.Po } func rateLimitPolicyAcceptedStatus(policy machinery.Policy) (accepted bool, err error) { - p, ok := policy.(*kuadrantv1beta3.RateLimitPolicy) + p, ok := policy.(*kuadrantv1.RateLimitPolicy) if !ok { return } diff --git a/controllers/ratelimit_workflow_test.go b/controllers/ratelimit_workflow_test.go index 5fce6df23..042bd92b2 100644 --- a/controllers/ratelimit_workflow_test.go +++ b/controllers/ratelimit_workflow_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/go-cmp/cmp" k8stypes "k8s.io/apimachinery/pkg/types" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" "github.com/kuadrant/kuadrant-operator/pkg/wasm" ) @@ -70,15 +70,15 @@ func TestLimitNameToLimitadorIdentifier(t *testing.T) { func TestWasmActionFromLimit(t *testing.T) { testCases := []struct { name string - limit *kuadrantv1beta3.Limit + limit *kuadrantv1.Limit limitIdentifier string scope string - topLevelPredicates kuadrantv1beta3.WhenPredicates + topLevelPredicates kuadrantv1.WhenPredicates expectedAction wasm.Action }{ { name: "limit without conditions nor counters", - limit: &kuadrantv1beta3.Limit{}, + limit: &kuadrantv1.Limit{}, limitIdentifier: "limit.myLimit__d681f6c3", scope: "my-ns/my-route", expectedAction: wasm.Action{ @@ -98,8 +98,8 @@ func TestWasmActionFromLimit(t *testing.T) { }, { name: "limit with counter qualifiers", - limit: &kuadrantv1beta3.Limit{ - Counters: []kuadrantv1beta3.Counter{{Expression: "auth.identity.username"}}, + limit: &kuadrantv1.Limit{ + Counters: []kuadrantv1.Counter{{Expression: "auth.identity.username"}}, }, limitIdentifier: "limit.myLimit__d681f6c3", scope: "my-ns/my-route", @@ -128,9 +128,9 @@ func TestWasmActionFromLimit(t *testing.T) { }, { name: "limit with counter qualifiers and when predicates", - limit: &kuadrantv1beta3.Limit{ - Counters: []kuadrantv1beta3.Counter{{Expression: "auth.identity.username"}}, - When: kuadrantv1beta3.NewWhenPredicates("auth.identity.group != admin"), + limit: &kuadrantv1.Limit{ + Counters: []kuadrantv1.Counter{{Expression: "auth.identity.username"}}, + When: kuadrantv1.NewWhenPredicates("auth.identity.group != admin"), }, limitIdentifier: "limit.myLimit__d681f6c3", scope: "my-ns/my-route", @@ -160,8 +160,8 @@ func TestWasmActionFromLimit(t *testing.T) { }, { name: "limit with top level predicates and no when predicates", - limit: &kuadrantv1beta3.Limit{}, - topLevelPredicates: kuadrantv1beta3.NewWhenPredicates("auth.identity.group != admin"), + limit: &kuadrantv1.Limit{}, + topLevelPredicates: kuadrantv1.NewWhenPredicates("auth.identity.group != admin"), limitIdentifier: "limit.myLimit__d681f6c3", scope: "my-ns/my-route", expectedAction: wasm.Action{ @@ -182,10 +182,10 @@ func TestWasmActionFromLimit(t *testing.T) { }, { name: "limit with top level predicates and when predicates", - limit: &kuadrantv1beta3.Limit{ - When: kuadrantv1beta3.NewWhenPredicates("auth.identity.from-limit"), + limit: &kuadrantv1.Limit{ + When: kuadrantv1.NewWhenPredicates("auth.identity.from-limit"), }, - topLevelPredicates: kuadrantv1beta3.NewWhenPredicates("auth.identity.from-top-level"), + topLevelPredicates: kuadrantv1.NewWhenPredicates("auth.identity.from-top-level"), limitIdentifier: "limit.myLimit__d681f6c3", scope: "my-ns/my-route", expectedAction: wasm.Action{ diff --git a/controllers/state_of_the_world.go b/controllers/state_of_the_world.go index 9e2b4b884..cd0863e7c 100644 --- a/controllers/state_of_the_world.go +++ b/controllers/state_of_the_world.go @@ -32,7 +32,6 @@ import ( kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/envoygateway" "github.com/kuadrant/kuadrant-operator/pkg/istio" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi" @@ -109,16 +108,16 @@ func NewPolicyMachineryController(manager ctrlruntime.Manager, client *dynamic.D controller.WithPredicates(&ctrlruntimepredicate.TypedGenerationChangedPredicate[*kuadrantv1.TLSPolicy]{}), )), controller.WithRunnable("authpolicy watcher", controller.Watch( - &kuadrantv1beta3.AuthPolicy{}, - kuadrantv1beta3.AuthPoliciesResource, + &kuadrantv1.AuthPolicy{}, + kuadrantv1.AuthPoliciesResource, metav1.NamespaceAll, - controller.WithPredicates(&ctrlruntimepredicate.TypedGenerationChangedPredicate[*kuadrantv1beta3.AuthPolicy]{}), + controller.WithPredicates(&ctrlruntimepredicate.TypedGenerationChangedPredicate[*kuadrantv1.AuthPolicy]{}), )), controller.WithRunnable("ratelimitpolicy watcher", controller.Watch( - &kuadrantv1beta3.RateLimitPolicy{}, - kuadrantv1beta3.RateLimitPoliciesResource, + &kuadrantv1.RateLimitPolicy{}, + kuadrantv1.RateLimitPoliciesResource, metav1.NamespaceAll, - controller.WithPredicates(&ctrlruntimepredicate.TypedGenerationChangedPredicate[*kuadrantv1beta3.RateLimitPolicy]{}), + controller.WithPredicates(&ctrlruntimepredicate.TypedGenerationChangedPredicate[*kuadrantv1.RateLimitPolicy]{}), )), controller.WithRunnable("topology configmap watcher", controller.Watch( &corev1.ConfigMap{}, @@ -147,8 +146,8 @@ func NewPolicyMachineryController(manager ctrlruntime.Manager, client *dynamic.D controller.WithPolicyKinds( kuadrantv1.DNSPolicyGroupKind, kuadrantv1.TLSPolicyGroupKind, - kuadrantv1beta3.AuthPolicyGroupKind, - kuadrantv1beta3.RateLimitPolicyGroupKind, + kuadrantv1.AuthPolicyGroupKind, + kuadrantv1.RateLimitPolicyGroupKind, ), controller.WithObjectKinds( kuadrantv1beta1.KuadrantGroupKind, diff --git a/controllers/test_common.go b/controllers/test_common.go index 48e26a01a..eafd55a3d 100644 --- a/controllers/test_common.go +++ b/controllers/test_common.go @@ -53,7 +53,6 @@ import ( maistraapis "github.com/kuadrant/kuadrant-operator/api/external/maistra" kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" "github.com/kuadrant/kuadrant-operator/pkg/library/fieldindexers" "github.com/kuadrant/kuadrant-operator/pkg/library/reconcilers" ) @@ -122,7 +121,6 @@ func BootstrapScheme() *runtime.Scheme { kuadrantdnsv1alpha1.AddToScheme, kuadrantv1.AddToScheme, kuadrantv1beta1.AddToScheme, - kuadrantv1beta3.AddToScheme, gatewayapiv1.Install, gatewayapiv1beta1.Install, authorinoopapi.AddToScheme, diff --git a/doc/auth.md b/doc/auth.md index a140dedcf..899fd4e2f 100644 --- a/doc/auth.md +++ b/doc/auth.md @@ -44,7 +44,7 @@ The auth scheme (`rules`), as well as conditions and named patterns can be decla #### High-level example and field definition ```yaml -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: AuthPolicy metadata: name: my-auth-policy @@ -178,7 +178,7 @@ The targeted HTTPRoute's rules and/or hostnames to which the policy must be enfo Target a HTTPRoute by setting the `spec.targetRef` field of the AuthPolicy as follows: ```yaml -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: AuthPolicy metadata: name: my-route-auth @@ -238,7 +238,7 @@ Inversely, a gateway policy that specify _overrides_ declares a set of rules to Target a Gateway HTTPRoute by setting the `spec.targetRef` field of the AuthPolicy as follows: ```yaml -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: AuthPolicy metadata: name: my-gw-auth diff --git a/doc/proposals/rlp-target-gateway-resource.md b/doc/proposals/rlp-target-gateway-resource.md index 55a16f063..162dc6160 100644 --- a/doc/proposals/rlp-target-gateway-resource.md +++ b/doc/proposals/rlp-target-gateway-resource.md @@ -38,7 +38,7 @@ return an OVER_LIMIT response if any of them are over limit. ```yaml --- -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: RateLimitPolicy metadata: name: my-rate-limit-policy diff --git a/doc/rate-limiting.md b/doc/rate-limiting.md index 9fc0f864a..8ef7a6aec 100644 --- a/doc/rate-limiting.md +++ b/doc/rate-limiting.md @@ -45,7 +45,7 @@ The limit definitions (`limits`) can be declared at the top-level level of the s #### High-level example and field definition ```yaml -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: RateLimitPolicy metadata: name: my-rate-limit-policy @@ -99,7 +99,7 @@ When a RateLimitPolicy targets a HTTPRoute, the policy is enforced to all traffi Target a HTTPRoute by setting the `spec.targetRef` field of the RateLimitPolicy as follows: ```yaml -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: RateLimitPolicy metadata: name: @@ -134,7 +134,7 @@ Inversely, a gateway policy that specify _overrides_ declares a set of rules to Target a Gateway HTTPRoute by setting the `spec.targetRef` field of the RateLimitPolicy as follows: ```yaml -apiVersion: kuadrant.io/v1beta3 +apiVersion: kuadrant.io/v1 kind: RateLimitPolicy metadata: name: diff --git a/doc/user-guides/auth-for-app-devs-and-platform-engineers.md b/doc/user-guides/auth-for-app-devs-and-platform-engineers.md index 807b0be62..c1062b059 100644 --- a/doc/user-guides/auth-for-app-devs-and-platform-engineers.md +++ b/doc/user-guides/auth-for-app-devs-and-platform-engineers.md @@ -141,7 +141,7 @@ Create AuthPolicies to enforce the following auth rules: ```sh kubectl apply -f - < Gw A - rlpA := &kuadrantv1beta3.RateLimitPolicy{ + rlpA := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlpName, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -869,12 +868,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(TestGatewayName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "l1": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -1090,12 +1089,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }) // create RLP A -> Route A - rlpA := &kuadrantv1beta3.RateLimitPolicy{ + rlpA := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlpName, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -1103,12 +1102,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(routeName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "l1": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -1408,12 +1407,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { // // create RLP R -> Route A // - rlpR := &kuadrantv1beta3.RateLimitPolicy{ + rlpR := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlpName, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -1421,12 +1420,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(routeAName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "l1": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -1525,7 +1524,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { // From RLP R -> Route A // To RLP R -> Route B Eventually(func(g Gomega) { - rlpUpdated := &kuadrantv1beta3.RateLimitPolicy{} + rlpUpdated := &kuadrantv1.RateLimitPolicy{} err = testClient().Get(ctx, client.ObjectKeyFromObject(rlpR), rlpUpdated) g.Expect(err).ToNot(HaveOccurred()) rlpUpdated.Spec.TargetRef.Name = gatewayapiv1.ObjectName(routeBName) @@ -1674,12 +1673,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Eventually(tests.RouteIsAccepted(ctx, testClient(), client.ObjectKeyFromObject(httpRouteA))).WithContext(ctx).Should(BeTrue()) // create RLP 1 -> Gw A - rlp1 := &kuadrantv1beta3.RateLimitPolicy{ + rlp1 := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlp1Name, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -1687,12 +1686,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(TestGatewayName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "gatewaylimit": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -1793,12 +1792,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { // // create RLP 2 -> Route A // - rlp2 := &kuadrantv1beta3.RateLimitPolicy{ + rlp2 := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlp2Name, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -1806,12 +1805,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(routeAName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "routelimit": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 4, Window: kuadrantv1beta3.Duration("3m"), + Limit: 4, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -1961,12 +1960,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Eventually(tests.RouteIsAccepted(ctx, testClient(), client.ObjectKeyFromObject(httpRouteA))).WithContext(ctx).Should(BeTrue()) // create RLP 1 -> Gw A - rlp1 := &kuadrantv1beta3.RateLimitPolicy{ + rlp1 := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlp1Name, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -1974,12 +1973,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(TestGatewayName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "gatewaylimit": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -1994,12 +1993,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Eventually(assertPolicyIsAcceptedAndEnforced(ctx, rlp1Key)).WithContext(ctx).Should(BeTrue()) // create RLP 2 -> Route A - rlp2 := &kuadrantv1beta3.RateLimitPolicy{ + rlp2 := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlp2Name, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -2007,12 +2006,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(routeAName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "routelimit": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 4, Window: kuadrantv1beta3.Duration("3m"), + Limit: 4, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -2274,12 +2273,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Eventually(tests.RouteIsAccepted(ctx, testClient(), client.ObjectKeyFromObject(httpRoute))).WithContext(ctx).Should(BeTrue()) // create ratelimitpolicy - rlp := &kuadrantv1beta3.RateLimitPolicy{ + rlp := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: rlpName, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -2287,12 +2286,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(routeName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "l1": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -2455,12 +2454,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Eventually(tests.RouteIsAccepted(ctx, testClient(), client.ObjectKeyFromObject(httpRoute))).WithContext(ctx).Should(BeTrue()) // create GW ratelimitpolicy with defaults - gwRLP := &kuadrantv1beta3.RateLimitPolicy{ + gwRLP := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: gwRLPName, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -2468,13 +2467,13 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(TestGatewayName), }, }, - Defaults: &kuadrantv1beta3.MergeableRateLimitPolicySpec{ - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + Defaults: &kuadrantv1.MergeableRateLimitPolicySpec{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "gateway": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, }, @@ -2500,12 +2499,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Expect(existingWASMConfig).To(Equal(expectedWasmPluginConfig(httpRoute, controllers.LimitNameToLimitadorIdentifier(gwRLPKey, "gateway"), "*.example.com"))) // Create Route RLP - routeRLP := &kuadrantv1beta3.RateLimitPolicy{ + routeRLP := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ - Kind: "RateLimitPolicy", APIVersion: kuadrantv1beta3.GroupVersion.String(), + Kind: "RateLimitPolicy", APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{Name: routeRLPName, Namespace: testNamespace}, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -2513,12 +2512,12 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { Name: gatewayapiv1.ObjectName(routeName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "route": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 10, Window: kuadrantv1beta3.Duration("3m"), + Limit: 10, Window: kuadrantv1.Duration("3m"), }, }, }, diff --git a/tests/istio/rate_limit_cluster_reconciler_test.go b/tests/istio/rate_limit_cluster_reconciler_test.go index 0fdc6e659..528a1354b 100644 --- a/tests/istio/rate_limit_cluster_reconciler_test.go +++ b/tests/istio/rate_limit_cluster_reconciler_test.go @@ -17,7 +17,7 @@ import ( gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1" gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - kuadrantv1beta3 "github.com/kuadrant/kuadrant-operator/api/v1beta3" + kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" "github.com/kuadrant/kuadrant-operator/controllers" "github.com/kuadrant/kuadrant-operator/pkg/common" "github.com/kuadrant/kuadrant-operator/pkg/library/kuadrant" @@ -78,16 +78,16 @@ var _ = Describe("Limitador Cluster EnvoyFilter controller", func() { Context("RLP targeting Gateway", func() { It("EnvoyFilter only created if RLP is in the path to a route", func(ctx SpecContext) { // create ratelimitpolicy - rlp := &kuadrantv1beta3.RateLimitPolicy{ + rlp := &kuadrantv1.RateLimitPolicy{ TypeMeta: metav1.TypeMeta{ Kind: "RateLimitPolicy", - APIVersion: kuadrantv1beta3.GroupVersion.String(), + APIVersion: kuadrantv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Name: rlpName, Namespace: testNamespace, }, - Spec: kuadrantv1beta3.RateLimitPolicySpec{ + Spec: kuadrantv1.RateLimitPolicySpec{ TargetRef: gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName{ LocalPolicyTargetReference: gatewayapiv1alpha2.LocalPolicyTargetReference{ Group: gatewayapiv1.GroupName, @@ -95,12 +95,12 @@ var _ = Describe("Limitador Cluster EnvoyFilter controller", func() { Name: gatewayapiv1.ObjectName(TestGatewayName), }, }, - RateLimitPolicySpecProper: kuadrantv1beta3.RateLimitPolicySpecProper{ - Limits: map[string]kuadrantv1beta3.Limit{ + RateLimitPolicySpecProper: kuadrantv1.RateLimitPolicySpecProper{ + Limits: map[string]kuadrantv1.Limit{ "l1": { - Rates: []kuadrantv1beta3.Rate{ + Rates: []kuadrantv1.Rate{ { - Limit: 1, Window: kuadrantv1beta3.Duration("3m"), + Limit: 1, Window: kuadrantv1.Duration("3m"), }, }, },