Skip to content

Commit

Permalink
gatewayapi v1.0.1 and kuadrant api v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed May 15, 2024
1 parent 12ed734 commit b4397f5
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 187 deletions.
12 changes: 6 additions & 6 deletions cmd/generate_gatewayapi_httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/kuadrant/kuadrantctl/pkg/utils"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gatewayapiv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1"
)

var (
Expand Down Expand Up @@ -76,15 +76,15 @@ func runGenerateGatewayApiHttpRoute(cmd *cobra.Command, args []string) error {
return nil
}

func buildHTTPRoute(doc *openapi3.T) *gatewayapiv1beta1.HTTPRoute {
return &gatewayapiv1beta1.HTTPRoute{
func buildHTTPRoute(doc *openapi3.T) *gatewayapiv1.HTTPRoute {
return &gatewayapiv1.HTTPRoute{
TypeMeta: v1.TypeMeta{
APIVersion: "gateway.networking.k8s.io/v1beta1",
APIVersion: gatewayapiv1.GroupVersion.String(),
Kind: "HTTPRoute",
},
ObjectMeta: gatewayapi.HTTPRouteObjectMetaFromOAS(doc),
Spec: gatewayapiv1beta1.HTTPRouteSpec{
CommonRouteSpec: gatewayapiv1beta1.CommonRouteSpec{
Spec: gatewayapiv1.HTTPRouteSpec{
CommonRouteSpec: gatewayapiv1.CommonRouteSpec{
ParentRefs: gatewayapi.HTTPRouteGatewayParentRefsFromOAS(doc),
},
Hostnames: gatewayapi.HTTPRouteHostnamesFromOAS(doc),
Expand Down
20 changes: 11 additions & 9 deletions cmd/generate_kuadrant_authpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
kuadrantapiv1beta2 "github.com/kuadrant/kuadrant-operator/api/v1beta2"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1"
gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gatewayapiv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/kuadrant/kuadrantctl/pkg/gatewayapi"
"github.com/kuadrant/kuadrantctl/pkg/kuadrantapi"
Expand Down Expand Up @@ -91,21 +91,23 @@ func buildAuthPolicy(doc *openapi3.T) *kuadrantapiv1beta2.AuthPolicy {
ObjectMeta: kuadrantapi.AuthPolicyObjectMetaFromOAS(doc),
Spec: kuadrantapiv1beta2.AuthPolicySpec{
TargetRef: gatewayapiv1alpha2.PolicyTargetReference{
Group: gatewayapiv1beta1.Group("gateway.networking.k8s.io"),
Kind: gatewayapiv1beta1.Kind("HTTPRoute"),
Name: gatewayapiv1beta1.ObjectName(routeMeta.Name),
Group: gatewayapiv1.GroupName,
Kind: gatewayapiv1.Kind("HTTPRoute"),
Name: gatewayapiv1.ObjectName(routeMeta.Name),
},
// Currently only authentication rules enforced
AuthScheme: kuadrantapiv1beta2.AuthSchemeSpec{
Authentication: kuadrantapi.AuthPolicyAuthenticationSchemeFromOAS(doc),
AuthPolicyCommonSpec: kuadrantapiv1beta2.AuthPolicyCommonSpec{
AuthScheme: &kuadrantapiv1beta2.AuthSchemeSpec{
Authentication: kuadrantapi.AuthPolicyAuthenticationSchemeFromOAS(doc),
},
RouteSelectors: kuadrantapi.AuthPolicyTopRouteSelectorsFromOAS(doc),
},
RouteSelectors: kuadrantapi.AuthPolicyTopRouteSelectorsFromOAS(doc),
},
}

if routeMeta.Namespace != "" {
ap.Spec.TargetRef.Namespace = &[]gatewayapiv1beta1.Namespace{
gatewayapiv1beta1.Namespace(routeMeta.Namespace),
ap.Spec.TargetRef.Namespace = &[]gatewayapiv1.Namespace{
gatewayapiv1.Namespace(routeMeta.Namespace),
}[0]
}

Expand Down
16 changes: 9 additions & 7 deletions cmd/generate_kuadrant_ratelimitpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
kuadrantapiv1beta2 "github.com/kuadrant/kuadrant-operator/api/v1beta2"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
gatewayapiv1 "sigs.k8s.io/gateway-api/apis/v1"
gatewayapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gatewayapiv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"

"github.com/kuadrant/kuadrantctl/pkg/gatewayapi"
"github.com/kuadrant/kuadrantctl/pkg/kuadrantapi"
Expand Down Expand Up @@ -94,17 +94,19 @@ func buildRateLimitPolicy(doc *openapi3.T) *kuadrantapiv1beta2.RateLimitPolicy {
ObjectMeta: kuadrantapi.RateLimitPolicyObjectMetaFromOAS(doc),
Spec: kuadrantapiv1beta2.RateLimitPolicySpec{
TargetRef: gatewayapiv1alpha2.PolicyTargetReference{
Group: gatewayapiv1beta1.Group("gateway.networking.k8s.io"),
Kind: gatewayapiv1beta1.Kind("HTTPRoute"),
Name: gatewayapiv1beta1.ObjectName(routeMeta.Name),
Group: gatewayapiv1.GroupName,
Kind: gatewayapiv1.Kind("HTTPRoute"),
Name: gatewayapiv1.ObjectName(routeMeta.Name),
},
RateLimitPolicyCommonSpec: kuadrantapiv1beta2.RateLimitPolicyCommonSpec{
Limits: kuadrantapi.RateLimitPolicyLimitsFromOAS(doc),
},
Limits: kuadrantapi.RateLimitPolicyLimitsFromOAS(doc),
},
}

if routeMeta.Namespace != "" {
rlp.Spec.TargetRef.Namespace = &[]gatewayapiv1beta1.Namespace{
gatewayapiv1beta1.Namespace(routeMeta.Namespace),
rlp.Spec.TargetRef.Namespace = &[]gatewayapiv1.Namespace{
gatewayapiv1.Namespace(routeMeta.Namespace),
}[0]
}

Expand Down
2 changes: 1 addition & 1 deletion config/gateway-api/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
resources:
- github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.6.2
- github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.0.0
75 changes: 39 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ require (
github.com/getkin/kin-openapi v0.120.0
github.com/ghodss/yaml v1.0.0
github.com/kuadrant/authorino v0.15.0
github.com/kuadrant/kuadrant-operator v0.4.1
github.com/kuadrant/kuadrant-operator v0.7.1
github.com/onsi/ginkgo/v2 v2.13.2
github.com/onsi/gomega v1.29.0
github.com/onsi/gomega v1.30.0
github.com/operator-framework/api v0.19.0
github.com/spf13/cobra v1.7.0
k8s.io/api v0.28.3
k8s.io/apiextensions-apiserver v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
github.com/spf13/cobra v1.8.0
k8s.io/apiextensions-apiserver v0.28.4
k8s.io/apimachinery v0.28.4
k8s.io/client-go v0.28.4
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/gateway-api v0.6.2
sigs.k8s.io/gateway-api v1.0.1-0.20231204134048-c7da42e6eafc
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/elliotchance/orderedmap/v2 v2.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
Expand All @@ -41,54 +40,58 @@ require (
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20221212185716-aee1124e3a93 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/imdario/mergo v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kuadrant/authorino-operator v0.9.0 // indirect
github.com/kuadrant/limitador-operator v0.7.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/sirupsen/logrus v1.9.2 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tidwall/gjson v1.14.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
istio.io/api v0.0.0-20230712174848-a2b2de508c88 // indirect
k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/api v0.28.4 // indirect
k8s.io/component-base v0.28.4 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/imdario/mergo => dario.cat/mergo v0.3.5

replace maistra.io/istio-operator => github.com/maistra/istio-operator v0.0.0-20231214211859-76e404c8df41
Loading

0 comments on commit b4397f5

Please sign in to comment.