Skip to content

Commit

Permalink
dep: Add dep to new gateway-api reference.
Browse files Browse the repository at this point in the history
Service APIs have been renamed to Gateway API. This adds the new release version to Gatway API to allow refactoring to the new name.

Updates projectcontour#3349

Signed-off-by: Steve Sloka <[email protected]>
  • Loading branch information
stevesloka committed Feb 18, 2021
1 parent 27d4a4e commit 1ca2caf
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ site-check: ## Test the site's links

integration: ## Run integration tests against a real k8s cluster
./_integration/testsuite/make-kind-cluster.sh
./_integration/testsuite/install-service-apis.sh
./_integration/testsuite/install-gateway-api.sh
./_integration/testsuite/install-contour-working.sh
./_integration/testsuite/install-fallback-certificate.sh
./_integration/testsuite/run-test-case.sh ./_integration/testsuite/httpproxy/*.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.

# install-service-apiss.sh: Install the service-apis CRDs.
# install-gateway-apis.sh: Install the gateway-apis CRDs.

set -o pipefail
set -o errexit
Expand All @@ -23,4 +23,4 @@ set -o nounset
readonly KUBECTL=${KUBECTL:-kubectl}
readonly VERSION=v0.1.0

${KUBECTL} kustomize "github.com/kubernetes-sigs/service-apis/config/crd?ref=${VERSION}" | ${KUBECTL} apply -f -
${KUBECTL} kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=${VERSION}" | ${KUBECTL} apply -f -
11 changes: 5 additions & 6 deletions cmd/contour/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
registry.MustRegister(prometheus.NewGoCollector())

// Before we can build the event handler, we need to initialize the converter we'll
// use to convert from Unstructured. Thanks to kubebuilder types from service-apis, this now can
// return an error.
// use to convert from Unstructured.
converter, err := k8s.NewUnstructuredConverter()
if err != nil {
return err
Expand Down Expand Up @@ -346,8 +345,8 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
DNSLookupFamily: ctx.Config.Cluster.DNSLookupFamily,
ClientCertificate: clientCert,
},
&dag.ServiceAPIsProcessor{
FieldLogger: log.WithField("context", "ServiceAPISProcessor"),
&dag.GatewayAPIProcessor{
FieldLogger: log.WithField("context", "GatewayAPIProcessor"),
},
&dag.ListenerProcessor{},
},
Expand Down Expand Up @@ -399,11 +398,11 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
}
}

// Inform on service-apis types if they are present.
// Inform on gateway-api types if they are present.
if ctx.UseExperimentalServiceAPITypes {
log.Warn("DEPRECATED: The flag '--experimental-service-apis' is deprecated and should not be used. Please configure the gateway.name & gateway.namespace in the configuration file to specify which Gateway Contour will be watching.")
}
for _, r := range k8s.ServiceAPIResources() {
for _, r := range k8s.GatewayAPIResources() {
if !clients.ResourcesExist(r) {
log.WithField("resource", r).Warn("resource type not present on API server")
continue
Expand Down
4 changes: 2 additions & 2 deletions cmd/contour/servecontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ type serveContext struct {
// DisableLeaderElection can only be set by command line flag.
DisableLeaderElection bool

// Should Contour register to watch the new service-apis types?
// Should Contour register to watch the new gateway-api types?
// By default this value is false, meaning Contour will not do anything with any of the new
// types.
// If the value is true, Contour will register for all the service-apis types
// If the value is true, Contour will register for all the gateway-api types
// (GatewayClass, Gateway, HTTPRoute, TCPRoute, and any more as they are added)
//
// DEPRECATED: Configure the Gateway.Name & Gateway.Namespace in the configuration file.
Expand Down
2 changes: 1 addition & 1 deletion examples/contour/01-contour-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data:
# determine which XDS Server implementation to utilize in Contour.
# xds-server-type: contour
#
# Specify the service-apis Gateway Contour should watch.
# Specify the gateway-api Gateway Contour should watch.
# gateway:
# name: contour
# namespace: projectcontour
Expand Down
7 changes: 4 additions & 3 deletions examples/contour/01-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: extensionservices.projectcontour.io
spec:
Expand Down Expand Up @@ -258,7 +258,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: httpproxies.projectcontour.io
spec:
Expand Down Expand Up @@ -1242,6 +1242,7 @@ spec:
format: int32
type: integer
protocol:
default: TCP
description: 'Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"'
type: string
required:
Expand Down Expand Up @@ -1273,7 +1274,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: tlscertificatedelegations.projectcontour.io
spec:
Expand Down
9 changes: 5 additions & 4 deletions examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ data:
# determine which XDS Server implementation to utilize in Contour.
# xds-server-type: contour
#
# Specify the service-apis Gateway Contour should watch.
# Specify the gateway-api Gateway Contour should watch.
# gateway:
# name: contour
# namespace: projectcontour
Expand Down Expand Up @@ -146,7 +146,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: extensionservices.projectcontour.io
spec:
Expand Down Expand Up @@ -401,7 +401,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: httpproxies.projectcontour.io
spec:
Expand Down Expand Up @@ -1385,6 +1385,7 @@ spec:
format: int32
type: integer
protocol:
default: TCP
description: 'Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"'
type: string
required:
Expand Down Expand Up @@ -1416,7 +1417,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: tlscertificatedelegations.projectcontour.io
spec:
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ require (
k8s.io/klog/v2 v2.4.0
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
sigs.k8s.io/controller-runtime v0.8.2
sigs.k8s.io/controller-tools v0.4.0
sigs.k8s.io/controller-tools v0.4.1
sigs.k8s.io/gateway-api v0.2.0
sigs.k8s.io/kustomize/kyaml v0.1.1
sigs.k8s.io/service-apis v0.1.0
)
11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/ahmetb/gen-crd-api-reference-docs v0.2.0 h1:YI/cAcRdNAHArfhGKcmCY5qMa32k/UyCZagLgabC5JY=
github.com/ahmetb/gen-crd-api-reference-docs v0.2.0/go.mod h1:P/XzJ+c2+khJKNKABcm2biRwk2QAuwbLf8DlXuaL7WM=
github.com/ahmetb/gen-crd-api-reference-docs v0.2.1-0.20201224172655-df869c1245d4/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8=
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 h1:+XfOU14S4bGuwyvCijJwhhBIjYN+YXS18jrCY2EzJaY=
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down Expand Up @@ -534,6 +535,8 @@ github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNue
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
Expand Down Expand Up @@ -1008,6 +1011,7 @@ k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRV
k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk=
k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM=
k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14=
k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk=
Expand All @@ -1022,6 +1026,8 @@ k8s.io/gengo v0.0.0-20200728071708-7794989d0000/go.mod h1:aG2eeomYfcUw8sE3fa7Ydk
k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9 h1:1bLA4Agvs1DILmc+q2Bbcqjx6jOHO7YEFA+G+0aTZoc=
k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 h1:Uusb3oh8XcdzDF/ndlI4ToKTYVlkCSJP39SRY2mfRAw=
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
Expand Down Expand Up @@ -1053,10 +1059,15 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E=
sigs.k8s.io/controller-runtime v0.8.0/go.mod h1:v9Lbj5oX443uR7GXYY46E0EE2o7k2YxQ58GxVNeXSW4=
sigs.k8s.io/controller-runtime v0.8.2 h1:SBWmI0b3uzMIUD/BIXWNegrCeZmPJ503pOtwxY0LPHM=
sigs.k8s.io/controller-runtime v0.8.2/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU=
sigs.k8s.io/controller-tools v0.4.0 h1:9zIdrc6q9RKke8+DnVPVBVZ+cfF9L0TwM01cxNnklYo=
sigs.k8s.io/controller-tools v0.4.0/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU=
sigs.k8s.io/controller-tools v0.4.1 h1:VkuV0MxlRPmRu5iTgBZU4UxUX2LiR99n3sdQGRxZF4w=
sigs.k8s.io/controller-tools v0.4.1/go.mod h1:G9rHdZMVlBDocIxGkK3jHLWqcTMNvveypYJwrvYKjWU=
sigs.k8s.io/gateway-api v0.2.0 h1:7cHyUed8LLFXPyzUl/mGylimx3E1CWHJYUK0/AHfEyg=
sigs.k8s.io/gateway-api v0.2.0/go.mod h1:IUbl4vAjUFoa2nt2gER8NsUrAu84x2edpWXbXBvcNis=
sigs.k8s.io/kustomize/kyaml v0.1.1 h1:nGUNYINljZNmlAS8uoobUv/wx/s3Pg8dNxYo+W7uYh0=
sigs.k8s.io/kustomize/kyaml v0.1.1/go.mod h1:/NdPPfrperSCGjm55cwEro1loBVtbtVIXSb7FguK6uk=
sigs.k8s.io/service-apis v0.1.0 h1:yImgpgLrxSD5tMdLqpIDEzroFaUzqwZbrg6/H3VpkYM=
Expand Down
Loading

0 comments on commit 1ca2caf

Please sign in to comment.