mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 17:46:57 +02:00
Removed traefik as dependency
This commit is contained in:
parent
7ee3f28876
commit
2dcbb2cfd2
10
go.mod
10
go.mod
@ -43,7 +43,7 @@ require (
|
|||||||
github.com/openshift/api v0.0.0-20210315202829-4b79815405ec
|
github.com/openshift/api v0.0.0-20210315202829-4b79815405ec
|
||||||
github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47
|
github.com/openshift/client-go v0.0.0-20210112165513-ebc401615f47
|
||||||
github.com/oracle/oci-go-sdk v24.3.0+incompatible
|
github.com/oracle/oci-go-sdk v24.3.0+incompatible
|
||||||
github.com/ovh/go-ovh v1.1.0
|
github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/pluralsh/gqlclient v1.1.6
|
github.com/pluralsh/gqlclient v1.1.6
|
||||||
github.com/projectcontour/contour v1.23.2
|
github.com/projectcontour/contour v1.23.2
|
||||||
@ -56,7 +56,7 @@ require (
|
|||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.599
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.599
|
||||||
github.com/transip/gotransip/v6 v6.19.0
|
github.com/transip/gotransip/v6 v6.19.0
|
||||||
github.com/ultradns/ultradns-sdk-go v0.0.0-20200616202852-e62052662f60
|
github.com/ultradns/ultradns-sdk-go v0.0.0-20200616202852-e62052662f60
|
||||||
github.com/vinyldns/go-vinyldns v0.9.16
|
github.com/vinyldns/go-vinyldns v0.0.0-20200211145900-fe8a3d82e556
|
||||||
github.com/vultr/govultr/v2 v2.17.2
|
github.com/vultr/govultr/v2 v2.17.2
|
||||||
go.etcd.io/etcd/api/v3 v3.5.5
|
go.etcd.io/etcd/api/v3 v3.5.5
|
||||||
go.etcd.io/etcd/client/v3 v3.5.5
|
go.etcd.io/etcd/client/v3 v3.5.5
|
||||||
@ -113,7 +113,7 @@ require (
|
|||||||
github.com/go-playground/universal-translator v0.18.0 // indirect
|
github.com/go-playground/universal-translator v0.18.0 // indirect
|
||||||
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect
|
github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect
|
||||||
github.com/go-stack/stack v1.8.0 // indirect
|
github.com/go-stack/stack v1.8.0 // indirect
|
||||||
github.com/gofrs/uuid v4.0.0+incompatible // indirect
|
github.com/gofrs/uuid v3.2.0+incompatible // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
|
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
@ -167,7 +167,6 @@ require (
|
|||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/stretchr/objx v0.5.0 // indirect
|
github.com/stretchr/objx v0.5.0 // indirect
|
||||||
github.com/terra-farm/udnssdk v1.3.5 // indirect
|
github.com/terra-farm/udnssdk v1.3.5 // indirect
|
||||||
github.com/traefik/paerser v0.1.9 // indirect
|
|
||||||
github.com/vektah/gqlparser/v2 v2.5.0 // indirect
|
github.com/vektah/gqlparser/v2 v2.5.0 // indirect
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
|
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
|
||||||
go.mongodb.org/mongo-driver v1.5.1 // indirect
|
go.mongodb.org/mongo-driver v1.5.1 // indirect
|
||||||
@ -190,7 +189,6 @@ require (
|
|||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/ini.v1 v1.66.6 // indirect
|
gopkg.in/ini.v1 v1.66.6 // indirect
|
||||||
gopkg.in/resty.v1 v1.12.0 // indirect
|
gopkg.in/resty.v1 v1.12.0 // indirect
|
||||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a // indirect
|
istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a // indirect
|
||||||
@ -204,4 +202,4 @@ require (
|
|||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.3.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace k8s.io/klog/v2 => github.com/Raffo/knolog v0.0.0-20211016155154-e4d5e0cc970a
|
replace k8s.io/klog/v2 => github.com/Raffo/knolog v0.0.0-20211016155154-e4d5e0cc970a
|
9
go.sum
9
go.sum
@ -189,7 +189,6 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm
|
|||||||
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||||
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||||
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||||
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
|
||||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
|
||||||
github.com/bodgit/tsig v1.2.0 h1:wNfc7yTk2OuWh/s7nEFa9h+SkIfTn7e4xlFtf1Sgvr4=
|
github.com/bodgit/tsig v1.2.0 h1:wNfc7yTk2OuWh/s7nEFa9h+SkIfTn7e4xlFtf1Sgvr4=
|
||||||
github.com/bodgit/tsig v1.2.0/go.mod h1:bsN2ntwGE/s3EeoawjAoKUcAfO4Fr0nGKC72vNF/cqM=
|
github.com/bodgit/tsig v1.2.0/go.mod h1:bsN2ntwGE/s3EeoawjAoKUcAfO4Fr0nGKC72vNF/cqM=
|
||||||
@ -198,7 +197,6 @@ github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8n
|
|||||||
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
|
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
|
||||||
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
|
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
|
||||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
|
|
||||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||||
@ -369,7 +367,6 @@ github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBj
|
|||||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||||
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
|
||||||
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
||||||
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
|
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
|
||||||
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
|
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
|
||||||
@ -799,8 +796,6 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN
|
|||||||
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
|
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
|
||||||
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
|
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
|
||||||
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
|
||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
|
||||||
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
|
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
|
||||||
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
|
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
|
||||||
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
||||||
@ -1175,8 +1170,6 @@ github.com/vektah/gqlparser/v2 v2.5.0 h1:GwEwy7AJsqPWrey0bHnn+3JLaHLZVT66wY/+O+T
|
|||||||
github.com/vektah/gqlparser/v2 v2.5.0/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs=
|
github.com/vektah/gqlparser/v2 v2.5.0/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs=
|
||||||
github.com/vinyldns/go-vinyldns v0.0.0-20200211145900-fe8a3d82e556 h1:UbVjBjgJUYGD8MlobEdOR+yTeNqaNa2Gf1/nskVNCSE=
|
github.com/vinyldns/go-vinyldns v0.0.0-20200211145900-fe8a3d82e556 h1:UbVjBjgJUYGD8MlobEdOR+yTeNqaNa2Gf1/nskVNCSE=
|
||||||
github.com/vinyldns/go-vinyldns v0.0.0-20200211145900-fe8a3d82e556/go.mod h1:RWc47jtnVuQv6+lY3c768WtXCas/Xi+U5UFc5xULmYg=
|
github.com/vinyldns/go-vinyldns v0.0.0-20200211145900-fe8a3d82e556/go.mod h1:RWc47jtnVuQv6+lY3c768WtXCas/Xi+U5UFc5xULmYg=
|
||||||
github.com/vinyldns/go-vinyldns v0.9.16 h1:GZJStDkcCk1F1AcRc64LuuMh+ENL8pHA0CVd4ulRMcQ=
|
|
||||||
github.com/vinyldns/go-vinyldns v0.9.16/go.mod h1:5qIJOdmzAnatKjurI+Tl4uTus7GJKJxb+zitufjHs3Q=
|
|
||||||
github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs=
|
github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs=
|
||||||
github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI=
|
github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI=
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||||
@ -1906,4 +1899,4 @@ sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
|||||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
||||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
||||||
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
|
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
|
||||||
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI=
|
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI=
|
@ -37,24 +37,22 @@ import (
|
|||||||
"k8s.io/client-go/kubernetes/scheme"
|
"k8s.io/client-go/kubernetes/scheme"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
"sigs.k8s.io/external-dns/endpoint"
|
"sigs.k8s.io/external-dns/endpoint"
|
||||||
|
|
||||||
traefikV1alpha1 "github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ingressrouteGVR = schema.GroupVersionResource{
|
ingressrouteGVR = schema.GroupVersionResource{
|
||||||
Group: traefikV1alpha1.SchemeGroupVersion.Group,
|
Group: "traefik.containo.us",
|
||||||
Version: traefikV1alpha1.SchemeGroupVersion.Version,
|
Version: "v1alpha1",
|
||||||
Resource: "ingressroutes",
|
Resource: "ingressroutes",
|
||||||
}
|
}
|
||||||
ingressrouteTCPGVR = schema.GroupVersionResource{
|
ingressrouteTCPGVR = schema.GroupVersionResource{
|
||||||
Group: traefikV1alpha1.SchemeGroupVersion.Group,
|
Group: "traefik.containo.us",
|
||||||
Version: traefikV1alpha1.SchemeGroupVersion.Version,
|
Version: "v1alpha1",
|
||||||
Resource: "ingressroutetcps",
|
Resource: "ingressroutetcps",
|
||||||
}
|
}
|
||||||
ingressrouteUDPGVR = schema.GroupVersionResource{
|
ingressrouteUDPGVR = schema.GroupVersionResource{
|
||||||
Group: traefikV1alpha1.SchemeGroupVersion.Group,
|
Group: "traefik.containo.us",
|
||||||
Version: traefikV1alpha1.SchemeGroupVersion.Version,
|
Version: "v1alpha1",
|
||||||
Resource: "ingressrouteudps",
|
Resource: "ingressrouteudps",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -160,14 +158,14 @@ func (ts *traefikSource) ingressRouteEndpoints() ([]*endpoint.Endpoint, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var ingressRoutes []*traefikV1alpha1.IngressRoute
|
var ingressRoutes []*IngressRoute
|
||||||
for _, ingressRouteObj := range irs {
|
for _, ingressRouteObj := range irs {
|
||||||
unstructuredHost, ok := ingressRouteObj.(*unstructured.Unstructured)
|
unstructuredHost, ok := ingressRouteObj.(*unstructured.Unstructured)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("could not convert")
|
return nil, errors.New("could not convert")
|
||||||
}
|
}
|
||||||
|
|
||||||
ingressRoute := &traefikV1alpha1.IngressRoute{}
|
ingressRoute := &IngressRoute{}
|
||||||
err := ts.unstructuredConverter.scheme.Convert(unstructuredHost, ingressRoute, nil)
|
err := ts.unstructuredConverter.scheme.Convert(unstructuredHost, ingressRoute, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -214,14 +212,14 @@ func (ts *traefikSource) ingressRouteTCPEndpoints() ([]*endpoint.Endpoint, error
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var ingressRoutes []*traefikV1alpha1.IngressRouteTCP
|
var ingressRoutes []*IngressRouteTCP
|
||||||
for _, ingressRouteObj := range irs {
|
for _, ingressRouteObj := range irs {
|
||||||
unstructuredHost, ok := ingressRouteObj.(*unstructured.Unstructured)
|
unstructuredHost, ok := ingressRouteObj.(*unstructured.Unstructured)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("could not convert")
|
return nil, errors.New("could not convert")
|
||||||
}
|
}
|
||||||
|
|
||||||
ingressRoute := &traefikV1alpha1.IngressRouteTCP{}
|
ingressRoute := &IngressRouteTCP{}
|
||||||
err := ts.unstructuredConverter.scheme.Convert(unstructuredHost, ingressRoute, nil)
|
err := ts.unstructuredConverter.scheme.Convert(unstructuredHost, ingressRoute, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -268,14 +266,14 @@ func (ts *traefikSource) ingressRouteUDPEndpoints() ([]*endpoint.Endpoint, error
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var ingressRoutes []*traefikV1alpha1.IngressRouteUDP
|
var ingressRoutes []*IngressRouteUDP
|
||||||
for _, ingressRouteObj := range irs {
|
for _, ingressRouteObj := range irs {
|
||||||
unstructuredHost, ok := ingressRouteObj.(*unstructured.Unstructured)
|
unstructuredHost, ok := ingressRouteObj.(*unstructured.Unstructured)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("could not convert")
|
return nil, errors.New("could not convert")
|
||||||
}
|
}
|
||||||
|
|
||||||
ingressRoute := &traefikV1alpha1.IngressRouteUDP{}
|
ingressRoute := &IngressRouteUDP{}
|
||||||
err := ts.unstructuredConverter.scheme.Convert(unstructuredHost, ingressRoute, nil)
|
err := ts.unstructuredConverter.scheme.Convert(unstructuredHost, ingressRoute, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -314,7 +312,7 @@ func (ts *traefikSource) ingressRouteUDPEndpoints() ([]*endpoint.Endpoint, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filterByAnnotations filters a list of IngressRoute by a given annotation selector.
|
// filterByAnnotations filters a list of IngressRoute by a given annotation selector.
|
||||||
func (ts *traefikSource) filterByAnnotationsIngressRoute(ingressRoutes []*traefikV1alpha1.IngressRoute) ([]*traefikV1alpha1.IngressRoute, error) {
|
func (ts *traefikSource) filterByAnnotationsIngressRoute(ingressRoutes []*IngressRoute) ([]*IngressRoute, error) {
|
||||||
labelSelector, err := metav1.ParseToLabelSelector(ts.annotationFilter)
|
labelSelector, err := metav1.ParseToLabelSelector(ts.annotationFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -329,7 +327,7 @@ func (ts *traefikSource) filterByAnnotationsIngressRoute(ingressRoutes []*traefi
|
|||||||
return ingressRoutes, nil
|
return ingressRoutes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredList := []*traefikV1alpha1.IngressRoute{}
|
filteredList := []*IngressRoute{}
|
||||||
|
|
||||||
for _, ingressRoute := range ingressRoutes {
|
for _, ingressRoute := range ingressRoutes {
|
||||||
// convert the IngressRoute's annotations to an equivalent label selector
|
// convert the IngressRoute's annotations to an equivalent label selector
|
||||||
@ -345,7 +343,7 @@ func (ts *traefikSource) filterByAnnotationsIngressRoute(ingressRoutes []*traefi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filterByAnnotations filters a list of IngressRouteTCP by a given annotation selector.
|
// filterByAnnotations filters a list of IngressRouteTCP by a given annotation selector.
|
||||||
func (ts *traefikSource) filterByAnnotationsIngressRouteTCP(ingressRoutes []*traefikV1alpha1.IngressRouteTCP) ([]*traefikV1alpha1.IngressRouteTCP, error) {
|
func (ts *traefikSource) filterByAnnotationsIngressRouteTCP(ingressRoutes []*IngressRouteTCP) ([]*IngressRouteTCP, error) {
|
||||||
labelSelector, err := metav1.ParseToLabelSelector(ts.annotationFilter)
|
labelSelector, err := metav1.ParseToLabelSelector(ts.annotationFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -360,7 +358,7 @@ func (ts *traefikSource) filterByAnnotationsIngressRouteTCP(ingressRoutes []*tra
|
|||||||
return ingressRoutes, nil
|
return ingressRoutes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredList := []*traefikV1alpha1.IngressRouteTCP{}
|
filteredList := []*IngressRouteTCP{}
|
||||||
|
|
||||||
for _, ingressRoute := range ingressRoutes {
|
for _, ingressRoute := range ingressRoutes {
|
||||||
// convert the IngressRoute's annotations to an equivalent label selector
|
// convert the IngressRoute's annotations to an equivalent label selector
|
||||||
@ -376,7 +374,7 @@ func (ts *traefikSource) filterByAnnotationsIngressRouteTCP(ingressRoutes []*tra
|
|||||||
}
|
}
|
||||||
|
|
||||||
// filterByAnnotations filters a list of IngressRoute by a given annotation selector.
|
// filterByAnnotations filters a list of IngressRoute by a given annotation selector.
|
||||||
func (ts *traefikSource) filterByAnnotationsIngressRouteUDP(ingressRoutes []*traefikV1alpha1.IngressRouteUDP) ([]*traefikV1alpha1.IngressRouteUDP, error) {
|
func (ts *traefikSource) filterByAnnotationsIngressRouteUDP(ingressRoutes []*IngressRouteUDP) ([]*IngressRouteUDP, error) {
|
||||||
labelSelector, err := metav1.ParseToLabelSelector(ts.annotationFilter)
|
labelSelector, err := metav1.ParseToLabelSelector(ts.annotationFilter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -391,7 +389,7 @@ func (ts *traefikSource) filterByAnnotationsIngressRouteUDP(ingressRoutes []*tra
|
|||||||
return ingressRoutes, nil
|
return ingressRoutes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredList := []*traefikV1alpha1.IngressRouteUDP{}
|
filteredList := []*IngressRouteUDP{}
|
||||||
|
|
||||||
for _, ingressRoute := range ingressRoutes {
|
for _, ingressRoute := range ingressRoutes {
|
||||||
// convert the IngressRoute's annotations to an equivalent label selector
|
// convert the IngressRoute's annotations to an equivalent label selector
|
||||||
@ -406,23 +404,23 @@ func (ts *traefikSource) filterByAnnotationsIngressRouteUDP(ingressRoutes []*tra
|
|||||||
return filteredList, nil
|
return filteredList, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ts *traefikSource) setResourceLabelIngressRoute(ingressroute *traefikV1alpha1.IngressRoute, endpoints []*endpoint.Endpoint) {
|
func (ts *traefikSource) setResourceLabelIngressRoute(ingressroute *IngressRoute, endpoints []*endpoint.Endpoint) {
|
||||||
for _, ep := range endpoints {
|
for _, ep := range endpoints {
|
||||||
ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressroute/%s/%s", ingressroute.Namespace, ingressroute.Name)
|
ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressroute/%s/%s", ingressroute.Namespace, ingressroute.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (ts *traefikSource) setResourceLabelIngressRouteTCP(ingressroute *traefikV1alpha1.IngressRouteTCP, endpoints []*endpoint.Endpoint) {
|
func (ts *traefikSource) setResourceLabelIngressRouteTCP(ingressroute *IngressRouteTCP, endpoints []*endpoint.Endpoint) {
|
||||||
for _, ep := range endpoints {
|
for _, ep := range endpoints {
|
||||||
ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressroutetcp/%s/%s", ingressroute.Namespace, ingressroute.Name)
|
ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressroutetcp/%s/%s", ingressroute.Namespace, ingressroute.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (ts *traefikSource) setResourceLabelIngressRouteUDP(ingressroute *traefikV1alpha1.IngressRouteUDP, endpoints []*endpoint.Endpoint) {
|
func (ts *traefikSource) setResourceLabelIngressRouteUDP(ingressroute *IngressRouteUDP, endpoints []*endpoint.Endpoint) {
|
||||||
for _, ep := range endpoints {
|
for _, ep := range endpoints {
|
||||||
ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressrouteudp/%s/%s", ingressroute.Namespace, ingressroute.Name)
|
ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressrouteudp/%s/%s", ingressroute.Namespace, ingressroute.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ts *traefikSource) setDualstackLabelIngressRoute(ingressRoute *traefikV1alpha1.IngressRoute, endpoints []*endpoint.Endpoint) {
|
func (ts *traefikSource) setDualstackLabelIngressRoute(ingressRoute *IngressRoute, endpoints []*endpoint.Endpoint) {
|
||||||
val, ok := ingressRoute.Annotations[ALBDualstackAnnotationKey]
|
val, ok := ingressRoute.Annotations[ALBDualstackAnnotationKey]
|
||||||
if ok && val == ALBDualstackAnnotationValue {
|
if ok && val == ALBDualstackAnnotationValue {
|
||||||
log.Debugf("Adding dualstack label to IngressRoute %s/%s.", ingressRoute.Namespace, ingressRoute.Name)
|
log.Debugf("Adding dualstack label to IngressRoute %s/%s.", ingressRoute.Namespace, ingressRoute.Name)
|
||||||
@ -431,7 +429,7 @@ func (ts *traefikSource) setDualstackLabelIngressRoute(ingressRoute *traefikV1al
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (ts *traefikSource) setDualstackLabelIngressRouteTCP(ingressRoute *traefikV1alpha1.IngressRouteTCP, endpoints []*endpoint.Endpoint) {
|
func (ts *traefikSource) setDualstackLabelIngressRouteTCP(ingressRoute *IngressRouteTCP, endpoints []*endpoint.Endpoint) {
|
||||||
val, ok := ingressRoute.Annotations[ALBDualstackAnnotationKey]
|
val, ok := ingressRoute.Annotations[ALBDualstackAnnotationKey]
|
||||||
if ok && val == ALBDualstackAnnotationValue {
|
if ok && val == ALBDualstackAnnotationValue {
|
||||||
log.Debugf("Adding dualstack label to IngressRouteTCP %s/%s.", ingressRoute.Namespace, ingressRoute.Name)
|
log.Debugf("Adding dualstack label to IngressRouteTCP %s/%s.", ingressRoute.Namespace, ingressRoute.Name)
|
||||||
@ -440,7 +438,7 @@ func (ts *traefikSource) setDualstackLabelIngressRouteTCP(ingressRoute *traefikV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (ts *traefikSource) setDualstackLabelIngressRouteUDP(ingressRoute *traefikV1alpha1.IngressRouteUDP, endpoints []*endpoint.Endpoint) {
|
func (ts *traefikSource) setDualstackLabelIngressRouteUDP(ingressRoute *IngressRouteUDP, endpoints []*endpoint.Endpoint) {
|
||||||
val, ok := ingressRoute.Annotations[ALBDualstackAnnotationKey]
|
val, ok := ingressRoute.Annotations[ALBDualstackAnnotationKey]
|
||||||
if ok && val == ALBDualstackAnnotationValue {
|
if ok && val == ALBDualstackAnnotationValue {
|
||||||
log.Debugf("Adding dualstack label to IngressRouteUDP %s/%s.", ingressRoute.Namespace, ingressRoute.Name)
|
log.Debugf("Adding dualstack label to IngressRouteUDP %s/%s.", ingressRoute.Namespace, ingressRoute.Name)
|
||||||
@ -451,7 +449,7 @@ func (ts *traefikSource) setDualstackLabelIngressRouteUDP(ingressRoute *traefikV
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endpointsFromIngressRoute extracts the endpoints from a IngressRoute object
|
// endpointsFromIngressRoute extracts the endpoints from a IngressRoute object
|
||||||
func (ts *traefikSource) endpointsFromIngressRoute(ingressRoute *traefikV1alpha1.IngressRoute, targets endpoint.Targets) ([]*endpoint.Endpoint, error) {
|
func (ts *traefikSource) endpointsFromIngressRoute(ingressRoute *IngressRoute, targets endpoint.Targets) ([]*endpoint.Endpoint, error) {
|
||||||
var endpoints []*endpoint.Endpoint
|
var endpoints []*endpoint.Endpoint
|
||||||
|
|
||||||
providerSpecific, setIdentifier := getProviderSpecificAnnotations(ingressRoute.Annotations)
|
providerSpecific, setIdentifier := getProviderSpecificAnnotations(ingressRoute.Annotations)
|
||||||
@ -486,7 +484,7 @@ func (ts *traefikSource) endpointsFromIngressRoute(ingressRoute *traefikV1alpha1
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endpointsFromIngressRouteTCP extracts the endpoints from a IngressRouteTCP object
|
// endpointsFromIngressRouteTCP extracts the endpoints from a IngressRouteTCP object
|
||||||
func (ts *traefikSource) endpointsFromIngressRouteTCP(ingressRoute *traefikV1alpha1.IngressRouteTCP, targets endpoint.Targets) ([]*endpoint.Endpoint, error) {
|
func (ts *traefikSource) endpointsFromIngressRouteTCP(ingressRoute *IngressRouteTCP, targets endpoint.Targets) ([]*endpoint.Endpoint, error) {
|
||||||
var endpoints []*endpoint.Endpoint
|
var endpoints []*endpoint.Endpoint
|
||||||
|
|
||||||
providerSpecific, setIdentifier := getProviderSpecificAnnotations(ingressRoute.Annotations)
|
providerSpecific, setIdentifier := getProviderSpecificAnnotations(ingressRoute.Annotations)
|
||||||
@ -522,7 +520,7 @@ func (ts *traefikSource) endpointsFromIngressRouteTCP(ingressRoute *traefikV1alp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// endpointsFromIngressRouteUDP extracts the endpoints from a IngressRouteUDP object
|
// endpointsFromIngressRouteUDP extracts the endpoints from a IngressRouteUDP object
|
||||||
func (ts *traefikSource) endpointsFromIngressRouteUDP(ingressRoute *traefikV1alpha1.IngressRouteUDP, targets endpoint.Targets) ([]*endpoint.Endpoint, error) {
|
func (ts *traefikSource) endpointsFromIngressRouteUDP(ingressRoute *IngressRouteUDP, targets endpoint.Targets) ([]*endpoint.Endpoint, error) {
|
||||||
var endpoints []*endpoint.Endpoint
|
var endpoints []*endpoint.Endpoint
|
||||||
|
|
||||||
providerSpecific, setIdentifier := getProviderSpecificAnnotations(ingressRoute.Annotations)
|
providerSpecific, setIdentifier := getProviderSpecificAnnotations(ingressRoute.Annotations)
|
||||||
@ -558,12 +556,347 @@ func newTraefikUnstructuredConverter() (*unstructuredConverter, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the core types we need
|
// Add the core types we need
|
||||||
uc.scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &traefikV1alpha1.IngressRoute{}, &traefikV1alpha1.IngressRouteList{})
|
uc.scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &IngressRoute{}, &IngressRouteList{})
|
||||||
uc.scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteTCP{}, &traefikV1alpha1.IngressRouteTCPList{})
|
uc.scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &IngressRouteTCP{}, &IngressRouteTCPList{})
|
||||||
uc.scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteUDP{}, &traefikV1alpha1.IngressRouteUDPList{})
|
uc.scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &IngressRouteUDP{}, &IngressRouteUDPList{})
|
||||||
if err := scheme.AddToScheme(uc.scheme); err != nil {
|
if err := scheme.AddToScheme(uc.scheme); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return uc, nil
|
return uc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basic redefinition of Traefik 2's CRD: https://github.com/traefik/traefik/tree/v2.8.7/pkg/provider/kubernetes/crd/traefik/v1alpha1
|
||||||
|
|
||||||
|
// traefikIngressRouteSpec defines the desired state of IngressRoute.
|
||||||
|
type traefikIngressRouteSpec struct {
|
||||||
|
// Routes defines the list of routes.
|
||||||
|
Routes []traefikRoute `json:"routes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// traefikRoute holds the HTTP route configuration.
|
||||||
|
type traefikRoute struct {
|
||||||
|
// Match defines the router's rule.
|
||||||
|
// More info: https://doc.traefik.io/traefik/v2.9/routing/routers/#rule
|
||||||
|
Match string `json:"match"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// IngressRoute is the CRD implementation of a Traefik HTTP Router.
|
||||||
|
type IngressRoute struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object's metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||||
|
metav1.ObjectMeta `json:"metadata"`
|
||||||
|
|
||||||
|
Spec traefikIngressRouteSpec `json:"spec"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// IngressRouteList is a collection of IngressRoute.
|
||||||
|
type IngressRouteList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object's metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||||
|
metav1.ListMeta `json:"metadata"`
|
||||||
|
|
||||||
|
// Items is the list of IngressRoute.
|
||||||
|
Items []IngressRoute `json:"items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// traefikIngressRouteTCPSpec defines the desired state of IngressRouteTCP.
|
||||||
|
type traefikIngressRouteTCPSpec struct {
|
||||||
|
Routes []traefikRouteTCP `json:"routes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// traefikRouteTCP holds the TCP route configuration.
|
||||||
|
type traefikRouteTCP struct {
|
||||||
|
// Match defines the router's rule.
|
||||||
|
// More info: https://doc.traefik.io/traefik/v2.9/routing/routers/#rule_1
|
||||||
|
Match string `json:"match"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// IngressRouteTCP is the CRD implementation of a Traefik TCP Router.
|
||||||
|
type IngressRouteTCP struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object's metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||||
|
metav1.ObjectMeta `json:"metadata"`
|
||||||
|
|
||||||
|
Spec traefikIngressRouteTCPSpec `json:"spec"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// IngressRouteTCPList is a collection of IngressRouteTCP.
|
||||||
|
type IngressRouteTCPList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object's metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||||
|
metav1.ListMeta `json:"metadata"`
|
||||||
|
|
||||||
|
// Items is the list of IngressRouteTCP.
|
||||||
|
Items []IngressRouteTCP `json:"items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// IngressRouteUDP is a CRD implementation of a Traefik UDP Router.
|
||||||
|
type IngressRouteUDP struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object's metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||||
|
metav1.ObjectMeta `json:"metadata"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// IngressRouteUDPList is a collection of IngressRouteUDP.
|
||||||
|
type IngressRouteUDPList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object's metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
||||||
|
metav1.ListMeta `json:"metadata"`
|
||||||
|
|
||||||
|
// Items is the list of IngressRouteUDP.
|
||||||
|
Items []IngressRouteUDP `json:"items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *IngressRoute) DeepCopyInto(out *IngressRoute) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
in.Spec.DeepCopyInto(&out.Spec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRoute.
|
||||||
|
func (in *IngressRoute) DeepCopy() *IngressRoute {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(IngressRoute)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *IngressRoute) 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 *IngressRouteList) DeepCopyInto(out *IngressRouteList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]IngressRoute, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteList.
|
||||||
|
func (in *IngressRouteList) DeepCopy() *IngressRouteList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(IngressRouteList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *IngressRouteList) 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 *traefikIngressRouteSpec) DeepCopyInto(out *traefikIngressRouteSpec) {
|
||||||
|
*out = *in
|
||||||
|
if in.Routes != nil {
|
||||||
|
in, out := &in.Routes, &out.Routes
|
||||||
|
*out = make([]traefikRoute, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteSpec.
|
||||||
|
func (in *traefikIngressRouteSpec) DeepCopy() *traefikIngressRouteSpec {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(traefikIngressRouteSpec)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *traefikRoute) DeepCopyInto(out *traefikRoute) {
|
||||||
|
*out = *in
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
|
||||||
|
func (in *traefikRoute) DeepCopy() *traefikRoute {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(traefikRoute)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *IngressRouteTCP) DeepCopyInto(out *IngressRouteTCP) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
in.Spec.DeepCopyInto(&out.Spec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteTCP.
|
||||||
|
func (in *IngressRouteTCP) DeepCopy() *IngressRouteTCP {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(IngressRouteTCP)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *IngressRouteTCP) 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 *IngressRouteTCPList) DeepCopyInto(out *IngressRouteTCPList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]IngressRouteTCP, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteTCPList.
|
||||||
|
func (in *IngressRouteTCPList) DeepCopy() *IngressRouteTCPList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(IngressRouteTCPList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *IngressRouteTCPList) 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 *traefikIngressRouteTCPSpec) DeepCopyInto(out *traefikIngressRouteTCPSpec) {
|
||||||
|
*out = *in
|
||||||
|
if in.Routes != nil {
|
||||||
|
in, out := &in.Routes, &out.Routes
|
||||||
|
*out = make([]traefikRouteTCP, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteTCPSpec.
|
||||||
|
func (in *traefikIngressRouteTCPSpec) DeepCopy() *traefikIngressRouteTCPSpec {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(traefikIngressRouteTCPSpec)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *traefikRouteTCP) DeepCopyInto(out *traefikRouteTCP) {
|
||||||
|
*out = *in
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTCP.
|
||||||
|
func (in *traefikRouteTCP) DeepCopy() *traefikRouteTCP {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(traefikRouteTCP)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *IngressRouteUDP) DeepCopyInto(out *IngressRouteUDP) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteUDP.
|
||||||
|
func (in *IngressRouteUDP) DeepCopy() *IngressRouteUDP {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(IngressRouteUDP)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *IngressRouteUDP) 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 *IngressRouteUDPList) DeepCopyInto(out *IngressRouteUDPList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]IngressRouteUDP, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRouteUDPList.
|
||||||
|
func (in *IngressRouteUDPList) DeepCopy() *IngressRouteUDPList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(IngressRouteUDPList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *IngressRouteUDPList) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -22,7 +22,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
traefikV1alpha1 "github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@ -41,14 +40,14 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
|
|
||||||
for _, ti := range []struct {
|
for _, ti := range []struct {
|
||||||
title string
|
title string
|
||||||
ingressRoute traefikV1alpha1.IngressRoute
|
ingressRoute IngressRoute
|
||||||
expected []*endpoint.Endpoint
|
expected []*endpoint.Endpoint
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
title: "IngressRoute with hostname annotation",
|
title: "IngressRoute with hostname annotation",
|
||||||
ingressRoute: traefikV1alpha1.IngressRoute{
|
ingressRoute: IngressRoute{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRoute",
|
Kind: "IngressRoute",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -76,9 +75,9 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRoute with host rule",
|
title: "IngressRoute with host rule",
|
||||||
ingressRoute: traefikV1alpha1.IngressRoute{
|
ingressRoute: IngressRoute{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRoute",
|
Kind: "IngressRoute",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -89,8 +88,8 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteSpec{
|
Spec: traefikIngressRouteSpec{
|
||||||
Routes: []traefikV1alpha1.Route{
|
Routes: []traefikRoute{
|
||||||
{
|
{
|
||||||
Match: "Host(`b.example.com`)",
|
Match: "Host(`b.example.com`)",
|
||||||
},
|
},
|
||||||
@ -112,9 +111,9 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRoute with hostheader rule",
|
title: "IngressRoute with hostheader rule",
|
||||||
ingressRoute: traefikV1alpha1.IngressRoute{
|
ingressRoute: IngressRoute{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRoute",
|
Kind: "IngressRoute",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -125,8 +124,8 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteSpec{
|
Spec: traefikIngressRouteSpec{
|
||||||
Routes: []traefikV1alpha1.Route{
|
Routes: []traefikRoute{
|
||||||
{
|
{
|
||||||
Match: "HostHeader(`c.example.com`)",
|
Match: "HostHeader(`c.example.com`)",
|
||||||
},
|
},
|
||||||
@ -148,9 +147,9 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRoute with multiple host rules",
|
title: "IngressRoute with multiple host rules",
|
||||||
ingressRoute: traefikV1alpha1.IngressRoute{
|
ingressRoute: IngressRoute{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRoute",
|
Kind: "IngressRoute",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -161,8 +160,8 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteSpec{
|
Spec: traefikIngressRouteSpec{
|
||||||
Routes: []traefikV1alpha1.Route{
|
Routes: []traefikRoute{
|
||||||
{
|
{
|
||||||
Match: "Host(`d.example.com`) || Host(`e.example.com`)",
|
Match: "Host(`d.example.com`) || Host(`e.example.com`)",
|
||||||
},
|
},
|
||||||
@ -194,9 +193,9 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRoute with multiple host rules and annotation",
|
title: "IngressRoute with multiple host rules and annotation",
|
||||||
ingressRoute: traefikV1alpha1.IngressRoute{
|
ingressRoute: IngressRoute{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRoute",
|
Kind: "IngressRoute",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -208,8 +207,8 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteSpec{
|
Spec: traefikIngressRouteSpec{
|
||||||
Routes: []traefikV1alpha1.Route{
|
Routes: []traefikRoute{
|
||||||
{
|
{
|
||||||
Match: "Host(`g.example.com`, `h.example.com`)",
|
Match: "Host(`g.example.com`, `h.example.com`)",
|
||||||
},
|
},
|
||||||
@ -251,9 +250,9 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRoute omit wildcard",
|
title: "IngressRoute omit wildcard",
|
||||||
ingressRoute: traefikV1alpha1.IngressRoute{
|
ingressRoute: IngressRoute{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRoute",
|
Kind: "IngressRoute",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -264,8 +263,8 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteSpec{
|
Spec: traefikIngressRouteSpec{
|
||||||
Routes: []traefikV1alpha1.Route{
|
Routes: []traefikRoute{
|
||||||
{
|
{
|
||||||
Match: "Host(`*`)",
|
Match: "Host(`*`)",
|
||||||
},
|
},
|
||||||
@ -281,9 +280,9 @@ func TestTraefikProxyIngressRouteEndpoints(t *testing.T) {
|
|||||||
|
|
||||||
fakeKubernetesClient := fakeKube.NewSimpleClientset()
|
fakeKubernetesClient := fakeKube.NewSimpleClientset()
|
||||||
scheme := runtime.NewScheme()
|
scheme := runtime.NewScheme()
|
||||||
scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &traefikV1alpha1.IngressRoute{}, &traefikV1alpha1.IngressRouteList{})
|
scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &IngressRoute{}, &IngressRouteList{})
|
||||||
scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteTCP{}, &traefikV1alpha1.IngressRouteTCPList{})
|
scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &IngressRouteTCP{}, &IngressRouteTCPList{})
|
||||||
scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteUDP{}, &traefikV1alpha1.IngressRouteUDPList{})
|
scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &IngressRouteUDP{}, &IngressRouteUDPList{})
|
||||||
fakeDynamicClient := fakeDynamic.NewSimpleDynamicClient(scheme)
|
fakeDynamicClient := fakeDynamic.NewSimpleDynamicClient(scheme)
|
||||||
|
|
||||||
ir := unstructured.Unstructured{}
|
ir := unstructured.Unstructured{}
|
||||||
@ -319,14 +318,14 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
|
|
||||||
for _, ti := range []struct {
|
for _, ti := range []struct {
|
||||||
title string
|
title string
|
||||||
ingressRouteTCP traefikV1alpha1.IngressRouteTCP
|
ingressRouteTCP IngressRouteTCP
|
||||||
expected []*endpoint.Endpoint
|
expected []*endpoint.Endpoint
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP with hostname annotation",
|
title: "IngressRouteTCP with hostname annotation",
|
||||||
ingressRouteTCP: traefikV1alpha1.IngressRouteTCP{
|
ingressRouteTCP: IngressRouteTCP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteTCPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteTCP",
|
Kind: "IngressRouteTCP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -354,9 +353,9 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP with host sni rule",
|
title: "IngressRouteTCP with host sni rule",
|
||||||
ingressRouteTCP: traefikV1alpha1.IngressRouteTCP{
|
ingressRouteTCP: IngressRouteTCP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteTCPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteTCP",
|
Kind: "IngressRouteTCP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -367,8 +366,8 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteTCPSpec{
|
Spec: traefikIngressRouteTCPSpec{
|
||||||
Routes: []traefikV1alpha1.RouteTCP{
|
Routes: []traefikRouteTCP{
|
||||||
{
|
{
|
||||||
Match: "HostSNI(`b.example.com`)",
|
Match: "HostSNI(`b.example.com`)",
|
||||||
},
|
},
|
||||||
@ -390,9 +389,9 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP with multiple host sni rules",
|
title: "IngressRouteTCP with multiple host sni rules",
|
||||||
ingressRouteTCP: traefikV1alpha1.IngressRouteTCP{
|
ingressRouteTCP: IngressRouteTCP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteTCPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteTCP",
|
Kind: "IngressRouteTCP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -403,8 +402,8 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteTCPSpec{
|
Spec: traefikIngressRouteTCPSpec{
|
||||||
Routes: []traefikV1alpha1.RouteTCP{
|
Routes: []traefikRouteTCP{
|
||||||
{
|
{
|
||||||
Match: "HostSNI(`d.example.com`) || HostSNI(`e.example.com`)",
|
Match: "HostSNI(`d.example.com`) || HostSNI(`e.example.com`)",
|
||||||
},
|
},
|
||||||
@ -436,9 +435,9 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP with multiple host sni rules and annotation",
|
title: "IngressRouteTCP with multiple host sni rules and annotation",
|
||||||
ingressRouteTCP: traefikV1alpha1.IngressRouteTCP{
|
ingressRouteTCP: IngressRouteTCP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteTCPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteTCP",
|
Kind: "IngressRouteTCP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -450,8 +449,8 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteTCPSpec{
|
Spec: traefikIngressRouteTCPSpec{
|
||||||
Routes: []traefikV1alpha1.RouteTCP{
|
Routes: []traefikRouteTCP{
|
||||||
{
|
{
|
||||||
Match: "HostSNI(`g.example.com`, `h.example.com`)",
|
Match: "HostSNI(`g.example.com`, `h.example.com`)",
|
||||||
},
|
},
|
||||||
@ -493,9 +492,9 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP omit wildcard host sni",
|
title: "IngressRouteTCP omit wildcard host sni",
|
||||||
ingressRouteTCP: traefikV1alpha1.IngressRouteTCP{
|
ingressRouteTCP: IngressRouteTCP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteTCPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteTCP",
|
Kind: "IngressRouteTCP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -506,8 +505,8 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
"kubernetes.io/ingress.class": "traefik",
|
"kubernetes.io/ingress.class": "traefik",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Spec: traefikV1alpha1.IngressRouteTCPSpec{
|
Spec: traefikIngressRouteTCPSpec{
|
||||||
Routes: []traefikV1alpha1.RouteTCP{
|
Routes: []traefikRouteTCP{
|
||||||
{
|
{
|
||||||
Match: "HostSNI(`*`)",
|
Match: "HostSNI(`*`)",
|
||||||
},
|
},
|
||||||
@ -523,9 +522,9 @@ func TestTraefikProxyIngressRouteTCPEndpoints(t *testing.T) {
|
|||||||
|
|
||||||
fakeKubernetesClient := fakeKube.NewSimpleClientset()
|
fakeKubernetesClient := fakeKube.NewSimpleClientset()
|
||||||
scheme := runtime.NewScheme()
|
scheme := runtime.NewScheme()
|
||||||
scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &traefikV1alpha1.IngressRoute{}, &traefikV1alpha1.IngressRouteList{})
|
scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &IngressRoute{}, &IngressRouteList{})
|
||||||
scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteTCP{}, &traefikV1alpha1.IngressRouteTCPList{})
|
scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &IngressRouteTCP{}, &IngressRouteTCPList{})
|
||||||
scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteUDP{}, &traefikV1alpha1.IngressRouteUDPList{})
|
scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &IngressRouteUDP{}, &IngressRouteUDPList{})
|
||||||
fakeDynamicClient := fakeDynamic.NewSimpleDynamicClient(scheme)
|
fakeDynamicClient := fakeDynamic.NewSimpleDynamicClient(scheme)
|
||||||
|
|
||||||
ir := unstructured.Unstructured{}
|
ir := unstructured.Unstructured{}
|
||||||
@ -561,14 +560,14 @@ func TestTraefikProxyIngressRouteUDPEndpoints(t *testing.T) {
|
|||||||
|
|
||||||
for _, ti := range []struct {
|
for _, ti := range []struct {
|
||||||
title string
|
title string
|
||||||
ingressRouteUDP traefikV1alpha1.IngressRouteUDP
|
ingressRouteUDP IngressRouteUDP
|
||||||
expected []*endpoint.Endpoint
|
expected []*endpoint.Endpoint
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP with hostname annotation",
|
title: "IngressRouteTCP with hostname annotation",
|
||||||
ingressRouteUDP: traefikV1alpha1.IngressRouteUDP{
|
ingressRouteUDP: IngressRouteUDP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteUDPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteUDP",
|
Kind: "IngressRouteUDP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -596,9 +595,9 @@ func TestTraefikProxyIngressRouteUDPEndpoints(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "IngressRouteTCP with multiple hostname annotation",
|
title: "IngressRouteTCP with multiple hostname annotation",
|
||||||
ingressRouteUDP: traefikV1alpha1.IngressRouteUDP{
|
ingressRouteUDP: IngressRouteUDP{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: traefikV1alpha1.SchemeGroupVersion.String(),
|
APIVersion: ingressrouteUDPGVR.GroupVersion().String(),
|
||||||
Kind: "IngressRouteUDP",
|
Kind: "IngressRouteUDP",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -641,9 +640,9 @@ func TestTraefikProxyIngressRouteUDPEndpoints(t *testing.T) {
|
|||||||
|
|
||||||
fakeKubernetesClient := fakeKube.NewSimpleClientset()
|
fakeKubernetesClient := fakeKube.NewSimpleClientset()
|
||||||
scheme := runtime.NewScheme()
|
scheme := runtime.NewScheme()
|
||||||
scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &traefikV1alpha1.IngressRoute{}, &traefikV1alpha1.IngressRouteList{})
|
scheme.AddKnownTypes(ingressrouteGVR.GroupVersion(), &IngressRoute{}, &IngressRouteList{})
|
||||||
scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteTCP{}, &traefikV1alpha1.IngressRouteTCPList{})
|
scheme.AddKnownTypes(ingressrouteTCPGVR.GroupVersion(), &IngressRouteTCP{}, &IngressRouteTCPList{})
|
||||||
scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &traefikV1alpha1.IngressRouteUDP{}, &traefikV1alpha1.IngressRouteUDPList{})
|
scheme.AddKnownTypes(ingressrouteUDPGVR.GroupVersion(), &IngressRouteUDP{}, &IngressRouteUDPList{})
|
||||||
fakeDynamicClient := fakeDynamic.NewSimpleDynamicClient(scheme)
|
fakeDynamicClient := fakeDynamic.NewSimpleDynamicClient(scheme)
|
||||||
|
|
||||||
ir := unstructured.Unstructured{}
|
ir := unstructured.Unstructured{}
|
||||||
|
Loading…
Reference in New Issue
Block a user