diff --git a/controller/controller.go b/controller/controller.go index 2f2c7181b9..f9355875eb 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -131,7 +131,7 @@ func (c *Controller) RunOnce(ctx context.Context) error { ctx = context.WithValue(ctx, provider.RecordsContextKey, records) - endpoints, err := c.Source.Endpoints() + endpoints, err := c.Source.Endpoints(ctx) if err != nil { sourceErrorsTotal.Inc() deprecatedSourceErrors.Inc() diff --git a/go.mod b/go.mod index cfcc51ef0b..b154dc0aa4 100644 --- a/go.mod +++ b/go.mod @@ -25,24 +25,28 @@ require ( github.com/exoscale/egoscale v0.18.1 github.com/ffledgling/pdns-go v0.0.0-20180219074714-524e7daccd99 github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b // indirect + github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect github.com/golang/sync v0.0.0-20180314180146-1d60e4601c6f github.com/google/go-cmp v0.4.1 github.com/gophercloud/gophercloud v0.1.0 github.com/gorilla/mux v1.7.4 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/infobloxopen/infoblox-go-client v0.0.0-20180606155407-61dc5f9b0a65 + github.com/json-iterator/go v1.1.9 // indirect github.com/linki/instrumented_http v0.2.0 - github.com/linode/linodego v0.15.0 + github.com/linode/linodego v0.19.0 github.com/maxatome/go-testdeep v1.4.0 github.com/miekg/dns v1.1.25 github.com/nesv/go-dynect v0.6.0 github.com/nic-at/rc0go v1.1.0 - github.com/openshift/api v0.0.0-20200302134843-001335d6cc34 - github.com/openshift/client-go v0.0.0-20200116145930-eb24d03d8420 + github.com/openshift/api v0.0.0-20200605231317-fb2a6ca106ae + github.com/openshift/client-go v0.0.0-20200608144219-584632b8fc73 github.com/oracle/oci-go-sdk v1.8.0 github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014 github.com/pkg/errors v0.9.1 - github.com/projectcontour/contour v1.4.0 + github.com/projectcontour/contour v1.5.0 github.com/prometheus/client_golang v1.1.0 + github.com/prometheus/client_model v0.2.0 // indirect github.com/sanyu/dynectsoap v0.0.0-20181203081243-b83de5edc4e0 github.com/satori/go.uuid v1.2.0 // indirect github.com/sirupsen/logrus v1.4.2 @@ -59,11 +63,11 @@ require ( google.golang.org/api v0.15.0 gopkg.in/ns1/ns1-go.v2 v2.0.0-20190322154155-0dafb5275fd1 gopkg.in/yaml.v2 v2.2.8 - istio.io/api v0.0.0-20200324230725-4b064f75ad8f - istio.io/client-go v0.0.0-20200324231043-96a582576da1 - k8s.io/api v0.17.5 - k8s.io/apimachinery v0.17.5 - k8s.io/client-go v0.17.5 + istio.io/api v0.0.0-20200529165953-72dad51d4ffc + istio.io/client-go v0.0.0-20200529172309-31c16ea3f751 + k8s.io/api v0.18.3 + k8s.io/apimachinery v0.18.3 + k8s.io/client-go v0.18.3 ) replace ( @@ -72,5 +76,6 @@ replace ( github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.6.0 github.com/Azure/go-autorest/autorest/azure/auth => github.com/Azure/go-autorest/autorest/azure/auth v0.3.0 github.com/golang/glog => github.com/kubermatic/glog-logrus v0.0.0-20180829085450-3fa5b9870d1d + google.golang.org/grpc => google.golang.org/grpc v1.26.0 k8s.io/klog => github.com/mikkeloscar/knolog v0.0.0-20190326191552-80742771eb6b ) diff --git a/go.sum b/go.sum index 9b94e26451..13a55d266f 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -49,6 +48,7 @@ github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ahmetb/gen-crd-api-reference-docs v0.1.5 h1:OU+AFpBEhyclrQGx4I6zpCx5WvXiKqvFeeOASOmhKCY= github.com/ahmetb/gen-crd-api-reference-docs v0.1.5/go.mod h1:P/XzJ+c2+khJKNKABcm2biRwk2QAuwbLf8DlXuaL7WM= github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.11 h1:QGjNHMwoPYxE5NpOAc8kpd2KTY293/oFk5BWdjkza+k= @@ -71,6 +71,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1C github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180828111155-cad214d7d71f h1:hinXH9rcBjRoIih5tl4f1BCbNjOmPJ2UnZwcYDhEHR0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20180828111155-cad214d7d71f/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -83,6 +84,7 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -90,6 +92,7 @@ github.com/cloudflare/cloudflare-go v0.10.1 h1:d2CL6F9k2O0Ux0w27LgogJ5UOzZRj6a/h github.com/cloudflare/cloudflare-go v0.10.1/go.mod h1:C0Y6eWnTJPMK2ceuOxx2pjh78UUHihcXeTTHb8r7QjU= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381 h1:rdRS5BT13Iae9ssvcslol66gfOOXjaLYwqerEn/cl9s= github.com/cloudfoundry-community/go-cfclient v0.0.0-20190201205600-f136f9222381/go.mod h1:e5+USP2j8Le2M0Jo3qKPFnNhuo1wueU4nWHCXBOfQ14= +github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533 h1:8wZizuKuZVu5COB7EsBYxBQz8nRcXXn5d4Gt91eJLvU= github.com/cncf/udpa/go v0.0.0-20200313221541-5f7e5dd04533/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -106,6 +109,8 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5tgDm3YN7+9dYrpK96E5wFilTFWIDZOM= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw= @@ -130,14 +135,19 @@ github.com/dnsimple/dnsimple-go v0.60.0 h1:N+q+ML1CZGf+5r4udu9Opy7WJNtOaFT9aM86A github.com/dnsimple/dnsimple-go v0.60.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 h1:qk/FSDDxo05wdJH28W+p5yivv7LuLYLRXPPD8KQCtZs= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.5 h1:lRJIqDD8yjV1YyPRqecMdytjDLs2fTXq363aCib5xPU= github.com/envoyproxy/go-control-plane v0.9.5/go.mod h1:OXl5to++W0ctG+EHWTFUjiypVxC/Y4VLc/KFU+al13s= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -170,6 +180,7 @@ github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70t github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= @@ -187,8 +198,10 @@ github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= @@ -198,6 +211,7 @@ github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHK github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= @@ -205,6 +219,7 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -213,6 +228,7 @@ github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b h1:/vQ+oYKu+JoyaMPDsv5 github.com/gobs/pretty v0.0.0-20180724170744-09732c25a95b/go.mod h1:Xo4aNUOrJnVruqWQJBtW6+bTBDTniY8yZum5rF3b5jw= github.com/gobuffalo/flect v0.1.5 h1:xpKq9ap8MbYfhuPCF0dBH854Gp9CxZjr/IocxELFflo= github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= +github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -246,7 +262,6 @@ github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= @@ -256,6 +271,8 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -267,6 +284,7 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= @@ -347,8 +365,8 @@ github.com/kubermatic/glog-logrus v0.0.0-20180829085450-3fa5b9870d1d h1:JV46Otdh github.com/kubermatic/glog-logrus v0.0.0-20180829085450-3fa5b9870d1d/go.mod h1:CHQ3o5KBH1PIS2Fb1mRLTIWO5YzP9kSUB3KoCICwlvA= github.com/linki/instrumented_http v0.2.0 h1:zLhcB3Q/McQQqml3qd5kzdZ0cGnL3vquPFIW2338f5Y= github.com/linki/instrumented_http v0.2.0/go.mod h1:pjYbItoegfuVi2GUOMhEqzvm/SJKuEL3H0tc8QRLRFk= -github.com/linode/linodego v0.15.0 h1:hIPphfUvQlheBEV2YbTQQ1KUPE5LPe0EDHvoySwuiu4= -github.com/linode/linodego v0.15.0/go.mod h1:vlzb2glsL9XrRYTRJ5JrgUoKZ5yfZBe11GYfEB68McY= +github.com/linode/linodego v0.19.0 h1:JxYBTxUcXcOlCwLMuugc7Il0RMtJ7riaddqz6gG/ACA= +github.com/linode/linodego v0.19.0/go.mod h1:XOWXRHjqeU2uPS84tKLgfWIfTlv3TYzCS0io4GOQzEI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -386,6 +404,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= @@ -402,6 +421,8 @@ github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -409,12 +430,13 @@ github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/openshift/api v0.0.0-20200116145750-0e2ff1e215dd/go.mod h1:fT6U/JfG8uZzemTRwZA2kBDJP5nWz7v05UHnty/D+pk= -github.com/openshift/api v0.0.0-20200302134843-001335d6cc34 h1:dqL8/YLrv/n4E5JBBkYPU/jzLQLLP5YZpsKAfh8CtNI= -github.com/openshift/api v0.0.0-20200302134843-001335d6cc34/go.mod h1:frTMT4l3rOMlXj3ClYgKxgkq24D7IKXb3Bl4vJEewJw= -github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= -github.com/openshift/client-go v0.0.0-20200116145930-eb24d03d8420 h1:+0HMnbsn4odRTirQB5ImG2w13yH6vj1MI2WD0+wPDaI= -github.com/openshift/client-go v0.0.0-20200116145930-eb24d03d8420/go.mod h1:4riOwdj99Hd/q+iAcJZfNCsQQQMwURnZV6RL4WHYS5w= +github.com/onsi/gomega v1.8.1 h1:C5Dqfs/LeauYDX0jJXIe2SWmwCbGzx9yF8C8xy3Lh34= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/openshift/api v0.0.0-20200605231317-fb2a6ca106ae h1:cRqNH6AtRQwEqCpymMkaR2ePp08FBIYLkU7YusJeZJ8= +github.com/openshift/api v0.0.0-20200605231317-fb2a6ca106ae/go.mod h1:l6TGeqJ92DrZBuWMNKcot1iZUHfbYSJyBWHGgg6Dn6s= +github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc= +github.com/openshift/client-go v0.0.0-20200608144219-584632b8fc73 h1:JePLt9EpNLF/30KsSsArrzxGWPaUIvYUt8Fwnw9wlgM= +github.com/openshift/client-go v0.0.0-20200608144219-584632b8fc73/go.mod h1:+66gk3dEqw9e+WoiXjJFzWlS1KGhj9ZRHi/RI/YG/ZM= github.com/oracle/oci-go-sdk v1.8.0 h1:4SO45bKV0I3/Mn1os3ANDZmV0eSE5z5CLdSUIkxtyzs= github.com/oracle/oci-go-sdk v1.8.0/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014 h1:37VE5TYj2m/FLA9SNr4z0+A0JefvTmR60Zwf8XSEV7c= @@ -428,6 +450,7 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -435,8 +458,8 @@ github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/projectcontour/contour v1.4.0 h1:VJPABZM92FN2rT8hvYaYr0Js5xgnuSTzrfcC9+RAHdc= -github.com/projectcontour/contour v1.4.0/go.mod h1:XBfsFUhiGCVFWNUF4g0O0eBWY+EI97iEEj6FB7584EE= +github.com/projectcontour/contour v1.5.0 h1:4zz4XWKKb1Nk2zXVQ27ZpoTivjG2DQvYLwrStcK8Fqc= +github.com/projectcontour/contour v1.5.0/go.mod h1:y1MEsorL/Q8lBG5BZz8Gzryi9L5ryVALOuHicmAdfW8= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= @@ -448,6 +471,8 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -470,6 +495,7 @@ github.com/sanyu/dynectsoap v0.0.0-20181203081243-b83de5edc4e0 h1:vOcHdR1nu7DO4B github.com/sanyu/dynectsoap v0.0.0-20181203081243-b83de5edc4e0/go.mod h1:FeplEtXXejBYC4NPAFTrs5L7KuK+5RL9bf5nB2vZe9o= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -517,6 +543,7 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/transip/gotransip v5.8.2+incompatible h1:aNJhw/w/3QBqFcHAIPz1ytoK5FexeMzbUCGrrhWr3H0= @@ -524,6 +551,7 @@ github.com/transip/gotransip v5.8.2+incompatible/go.mod h1:uacMoJVmrfOcscM4Bi5NV github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vinyldns/go-vinyldns v0.0.0-20190611170422-7119fe55ed92 h1:Q76MzqJu++vAfhj0mVf7t0F4xHUbg+V/d/Uk5PBQjRU= github.com/vinyldns/go-vinyldns v0.0.0-20190611170422-7119fe55ed92/go.mod h1:AZuEfReFWdvtU0LatbLpo70t3lqdLvph2D5mqFP0bkA= github.com/vultr/govultr v0.4.2 h1:9i8xKZ+xp6vwZ9raqHoBLzhB4wCnMj7nOQTj5YIRLWY= @@ -538,8 +566,12 @@ github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6Ut github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20200401174654-e694b7bb0875 h1:C7kWARE8r64ppRadl40yfNo6pag+G6ocvGU2xZ6yNes= go.etcd.io/etcd v0.5.0-alpha.5.0.20200401174654-e694b7bb0875/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -564,6 +596,7 @@ golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= @@ -580,10 +613,8 @@ golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm0 golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= @@ -595,7 +626,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -645,7 +675,6 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -669,6 +698,7 @@ golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd h1:3x5uuvBgE6oaXJjCOvpCC1IpgJogqQ+PqGGU3ZxAgII= golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= @@ -683,13 +713,11 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190213192042-740235f6c0d8/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -699,9 +727,9 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -730,7 +758,6 @@ google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0 h1:yzlyyDW/J0w8yNFJIhiAJy4kq74S+1DOLdawELNxFMA= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= @@ -746,20 +773,13 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190916214212-f660b8655731 h1:Phvl0+G5t5k/EUFUi0wPdUUeTL2HydMQUXHnunWgSb0= -google.golang.org/genproto v0.0.0-20190916214212-f660b8655731/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 h1:aQktFqmDE2yjveXJlVIfslDFmFnUXSqG0i6KRcJAeMc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -784,7 +804,9 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.0.0/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -799,55 +821,58 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -istio.io/api v0.0.0-20200324230230-11f0c7211ae4/go.mod h1:bcY3prusO/6vA6zGHz4PNG2v79clPyTw06Xx3fprJSQ= -istio.io/api v0.0.0-20200324230725-4b064f75ad8f h1:KIE2M1/XiG8YWNrk1Wkcp8cfWbZ0lDihUqtBCmlrMH0= -istio.io/api v0.0.0-20200324230725-4b064f75ad8f/go.mod h1:bcY3prusO/6vA6zGHz4PNG2v79clPyTw06Xx3fprJSQ= -istio.io/client-go v0.0.0-20200324231043-96a582576da1 h1:DTiU1Xcb38riKGTI6bL14lcCZgW2/HdqX8NXG2HByRQ= -istio.io/client-go v0.0.0-20200324231043-96a582576da1/go.mod h1:nSSQnALPGh+QfuiQ09DpSCcgXolWEhRpmIqwqqptckw= +istio.io/api v0.0.0-20200529165953-72dad51d4ffc h1:cR9GmbIBAz3FnY3tgs1SRn/uiznhtvG+mZBfD1p2vIA= +istio.io/api v0.0.0-20200529165953-72dad51d4ffc/go.mod h1:kyq3g5w42zl/AKlbzDGppYpGMQYMYMyZKeq0/eexML8= +istio.io/client-go v0.0.0-20200529172309-31c16ea3f751 h1:yH62fTmV+5l1XVTWcomsc1jjH/oH9u/tTgn5NVmdIac= +istio.io/client-go v0.0.0-20200529172309-31c16ea3f751/go.mod h1:4SGvmmus5HNFdqQsIL+uQO1PbAhjQKtSjMTqwsvYHlg= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a h1:w7zILua2dnYo9CxImhpNW4NE/8ZxEoc/wfBfHrhUhrE= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= -k8s.io/api v0.17.1/go.mod h1:zxiAc5y8Ngn4fmhWUtSxuUlkfz1ixT7j9wESokELzOg= -k8s.io/api v0.17.2 h1:NF1UFXcKN7/OOv1uxdRz3qfra8AHsPav5M93hlV9+Dc= -k8s.io/api v0.17.2/go.mod h1:BS9fjjLc4CMuqfSO8vgbHPKMt5+SF0ET6u/RVDihTo4= -k8s.io/api v0.17.5 h1:EkVieIbn1sC8YCDwckLKLpf+LoVofXYW72+LTZWo4aQ= -k8s.io/api v0.17.5/go.mod h1:0zV5/ungglgy2Rlm3QK8fbxkXVs+BSJWpJP/+8gUVLY= +k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= +k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= +k8s.io/api v0.18.3 h1:2AJaUQdgUZLoDZHrun21PW2Nx9+ll6cUzvn3IKhSIn0= +k8s.io/api v0.18.3/go.mod h1:UOaMwERbqJMfeeeHc8XJKawj4P9TgDRnViIqqBeH2QA= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= +k8s.io/apiextensions-apiserver v0.17.0/go.mod h1:XiIFUakZywkUl54fVXa7QTEHcqQz9HG55nHd1DCoHj8= k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.17.1/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.17.2 h1:hwDQQFbdRlpnnsR64Asdi55GyCaIP/3WQpMmbNBeWr4= -k8s.io/apimachinery v0.17.2/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.17.5 h1:QAjfgeTtSGksdkgyaPrIb4lhU16FWMIzxKejYD5S0gc= -k8s.io/apimachinery v0.17.5/go.mod h1:ioIo1G/a+uONV7Tv+ZmCbMG1/a3kVw5YcDdncd8ugQ0= +k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.3 h1:pOGcbVAhxADgUYnjS08EFXs9QMl8qaH5U4fr5LGUrSk= +k8s.io/apimachinery v0.18.3/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= +k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk= k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= -k8s.io/client-go v0.17.1/go.mod h1:HZtHJSC/VuSHcETN9QA5QDZky1tXiYrkF/7t7vRpO1A= -k8s.io/client-go v0.17.2 h1:ndIfkfXEGrNhLIgkr0+qhRguSD3u6DCmonepn1O6NYc= -k8s.io/client-go v0.17.2/go.mod h1:QAzRgsa0C2xl4/eVpeVAZMvikCn8Nm81yqVx3Kk9XYI= -k8s.io/client-go v0.17.5 h1:Sm/9AQ415xPAX42JLKbJZnreXFgD2rVfDUDwOTm0gzA= -k8s.io/client-go v0.17.5/go.mod h1:S8uZpBpjJJdEH/fEyxcqg7Rn0P5jH+ilkgBHjriSmNo= +k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= +k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= +k8s.io/client-go v0.18.3 h1:QaJzz92tsN67oorwzmoB0a9r9ZVHuD5ryjbCKP0U22k= +k8s.io/client-go v0.18.3/go.mod h1:4a/dpQEvzAhT1BbuWW09qvIaGw6Gbu1gZYiQZIi1DMw= k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269 h1:d8Fm55A+7HOczX58+x9x+nJnJ1Devt1aCrWVIPaw/Vg= k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= -k8s.io/code-generator v0.17.1/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= +k8s.io/code-generator v0.17.0/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= +k8s.io/code-generator v0.18.3/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= +k8s.io/component-base v0.17.0/go.mod h1:rKuRAokNMY2nn2A6LP/MiwpoaMRHpfRnrPaUJJj1Yoc= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20191120174120-e74f70b9b27e h1:HqlU9dKk5YVs7R84jmq6U3Wo/XslpkxHpBv2iWHLtLc= k8s.io/gengo v0.0.0-20191120174120-e74f70b9b27e/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJDVK9qPLhM+sRHYanNKw0EQ= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200316234421-82d701f24f9d h1:jocF7XFucw2pEiv2wS7wk2FRFCjDFGV1oa4TMs0SAT0= -k8s.io/kube-openapi v0.0.0-20200316234421-82d701f24f9d/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= +k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -857,13 +882,20 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= sigs.k8s.io/controller-tools v0.2.4 h1:la1h46EzElvWefWLqfsXrnsO3lZjpkI0asTpX6h8PLA= sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= +sigs.k8s.io/controller-tools v0.2.9/go.mod h1:ArP7w60JQKkZf7UU2oWTVnEhoNGA+sOMyuSuS+JFNDQ= 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.0.0-20200213014236-51691dd89266/go.mod h1:s6Cwc0sg5w4xxZ/HEr88qPkQ4CITr80lnMpYZUzL9VY= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca h1:6dsH6AYQWbyZmtttJNe8Gq1cXOeS1BdV3eW37zHilAQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= -sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/testing_frameworks v0.1.2/go.mod h1:ToQrwSC3s8Xf/lADdZp3Mktcql9CG0UAmdJG9th5i0w= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/internal/testutils/mock_source.go b/internal/testutils/mock_source.go index d6acb9349d..a09f00e33d 100644 --- a/internal/testutils/mock_source.go +++ b/internal/testutils/mock_source.go @@ -30,7 +30,7 @@ type MockSource struct { } // Endpoints returns the desired mock endpoints. -func (m *MockSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (m *MockSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { args := m.Called() endpoints := args.Get(0) diff --git a/pkg/apis/externaldns/types.go b/pkg/apis/externaldns/types.go index 80b734c2e7..262abd8c9b 100644 --- a/pkg/apis/externaldns/types.go +++ b/pkg/apis/externaldns/types.go @@ -301,7 +301,7 @@ func (cfg *Config) ParseFlags(args []string) error { app.Flag("skipper-routegroup-groupversion", "The resource version for skipper routegroup").Default(source.DefaultRoutegroupVersion).StringVar(&cfg.SkipperRouteGroupVersion) // Flags related to processing sources - app.Flag("source", "The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, node, fake, connector, istio-gateway, cloudfoundry, contour-ingressroute, crd, empty, skipper-routegroup,openshift-route)").Required().PlaceHolder("source").EnumsVar(&cfg.Sources, "service", "ingress", "node", "istio-gateway", "cloudfoundry", "contour-ingressroute", "fake", "connector", "crd", "empty", "skipper-routegroup", "openshift-route") + app.Flag("source", "The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, node, fake, connector, istio-gateway, cloudfoundry, contour-ingressroute, contour-httpproxy, crd, empty, skipper-routegroup,openshift-route)").Required().PlaceHolder("source").EnumsVar(&cfg.Sources, "service", "ingress", "node", "istio-gateway", "cloudfoundry", "contour-ingressroute", "contour-httpproxy", "fake", "connector", "crd", "empty", "skipper-routegroup", "openshift-route") app.Flag("namespace", "Limit sources of endpoints to a specific namespace (default: all namespaces)").Default(defaultConfig.Namespace).StringVar(&cfg.Namespace) app.Flag("annotation-filter", "Filter sources managed by external-dns via annotation using label selector semantics (default: all sources)").Default(defaultConfig.AnnotationFilter).StringVar(&cfg.AnnotationFilter) diff --git a/source/cloudfoundry.go b/source/cloudfoundry.go index ffa79df9a3..e15a380d80 100644 --- a/source/cloudfoundry.go +++ b/source/cloudfoundry.go @@ -40,7 +40,7 @@ func (rs *cloudfoundrySource) AddEventHandler(ctx context.Context, handler func( } // Endpoints returns endpoint objects -func (rs *cloudfoundrySource) Endpoints() ([]*endpoint.Endpoint, error) { +func (rs *cloudfoundrySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { endpoints := []*endpoint.Endpoint{} u, err := url.Parse(rs.client.Config.ApiAddress) diff --git a/source/connector.go b/source/connector.go index 0bd9479ee4..0a1845b51f 100644 --- a/source/connector.go +++ b/source/connector.go @@ -45,7 +45,7 @@ func NewConnectorSource(remoteServer string) (Source, error) { } // Endpoints returns endpoint objects. -func (cs *connectorSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (cs *connectorSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { endpoints := []*endpoint.Endpoint{} conn, err := net.DialTimeout("tcp", cs.remoteServer, dialTimeout) diff --git a/source/connector_test.go b/source/connector_test.go index 7e00aef6a6..7081102156 100644 --- a/source/connector_test.go +++ b/source/connector_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "encoding/gob" "net" "testing" @@ -124,7 +125,7 @@ func testConnectorSourceEndpoints(t *testing.T) { } cs, _ := NewConnectorSource(ti.serverAddress) - endpoints, err := cs.Endpoints() + endpoints, err := cs.Endpoints(context.Background()) if ti.expectError { assert.Error(t, err) } else { diff --git a/source/crd.go b/source/crd.go index cbd8828e42..cc74e1657a 100644 --- a/source/crd.go +++ b/source/crd.go @@ -116,10 +116,10 @@ func (cs *crdSource) AddEventHandler(ctx context.Context, handler func()) { } // Endpoints returns endpoint objects. -func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (cs *crdSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { endpoints := []*endpoint.Endpoint{} - result, err := cs.List(&metav1.ListOptions{}) + result, err := cs.List(ctx, &metav1.ListOptions{}) if err != nil { return nil, err } @@ -166,7 +166,7 @@ func (cs *crdSource) Endpoints() ([]*endpoint.Endpoint, error) { dnsEndpoint.Status.ObservedGeneration = dnsEndpoint.Generation // Update the ObservedGeneration - _, err = cs.UpdateStatus(&dnsEndpoint) + _, err = cs.UpdateStatus(ctx, &dnsEndpoint) if err != nil { log.Warnf("Could not update ObservedGeneration of the CRD: %v", err) } @@ -181,18 +181,18 @@ func (cs *crdSource) setResourceLabel(crd *endpoint.DNSEndpoint, endpoints []*en } } -func (cs *crdSource) List(opts *metav1.ListOptions) (result *endpoint.DNSEndpointList, err error) { +func (cs *crdSource) List(ctx context.Context, opts *metav1.ListOptions) (result *endpoint.DNSEndpointList, err error) { result = &endpoint.DNSEndpointList{} err = cs.crdClient.Get(). Namespace(cs.namespace). Resource(cs.crdResource). VersionedParams(opts, cs.codec). - Do(). + Do(ctx). Into(result) return } -func (cs *crdSource) UpdateStatus(dnsEndpoint *endpoint.DNSEndpoint) (result *endpoint.DNSEndpoint, err error) { +func (cs *crdSource) UpdateStatus(ctx context.Context, dnsEndpoint *endpoint.DNSEndpoint) (result *endpoint.DNSEndpoint, err error) { result = &endpoint.DNSEndpoint{} err = cs.crdClient.Put(). Namespace(dnsEndpoint.Namespace). @@ -200,7 +200,7 @@ func (cs *crdSource) UpdateStatus(dnsEndpoint *endpoint.DNSEndpoint) (result *en Name(dnsEndpoint.Name). SubResource("status"). Body(dnsEndpoint). - Do(). + Do(ctx). Into(result) return } diff --git a/source/crd_test.go b/source/crd_test.go index 0319031901..c4f8829906 100644 --- a/source/crd_test.go +++ b/source/crd_test.go @@ -18,6 +18,7 @@ package source import ( "bytes" + "context" "encoding/json" "fmt" "io" @@ -318,7 +319,7 @@ func testCRDSourceEndpoints(t *testing.T) { cs, _ := NewCRDSource(restClient, ti.namespace, ti.kind, ti.annotationFilter, scheme) - receivedEndpoints, err := cs.Endpoints() + receivedEndpoints, err := cs.Endpoints(context.Background()) if ti.expectError { require.Errorf(t, err, "Received err %v", err) } else { @@ -341,7 +342,7 @@ func testCRDSourceEndpoints(t *testing.T) { func validateCRDResource(t *testing.T, src Source, expectError bool) { cs := src.(*crdSource) - result, err := cs.List(&metav1.ListOptions{}) + result, err := cs.List(context.Background(), &metav1.ListOptions{}) if expectError { require.Errorf(t, err, "Received err %v", err) } else { diff --git a/source/dedup_source.go b/source/dedup_source.go index bfe5f8519d..758da43cbf 100644 --- a/source/dedup_source.go +++ b/source/dedup_source.go @@ -35,11 +35,11 @@ func NewDedupSource(source Source) Source { } // Endpoints collects endpoints from its wrapped source and returns them without duplicates. -func (ms *dedupSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (ms *dedupSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { result := []*endpoint.Endpoint{} collected := map[string]bool{} - endpoints, err := ms.source.Endpoints() + endpoints, err := ms.source.Endpoints(ctx) if err != nil { return nil, err } diff --git a/source/dedup_source_test.go b/source/dedup_source_test.go index fee8549214..bbd3a21c71 100644 --- a/source/dedup_source_test.go +++ b/source/dedup_source_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "testing" "sigs.k8s.io/external-dns/endpoint" @@ -97,7 +98,7 @@ func testDedupEndpoints(t *testing.T) { // Create our object under test and get the endpoints. source := NewDedupSource(mockSource) - endpoints, err := source.Endpoints() + endpoints, err := source.Endpoints(context.Background()) if err != nil { t.Fatal(err) } diff --git a/source/empty.go b/source/empty.go index f731ae3649..cf03fcef89 100644 --- a/source/empty.go +++ b/source/empty.go @@ -29,7 +29,7 @@ func (e *emptySource) AddEventHandler(ctx context.Context, handler func()) { } // Endpoints collects endpoints of all nested Sources and returns them in a single slice. -func (e *emptySource) Endpoints() ([]*endpoint.Endpoint, error) { +func (e *emptySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { return []*endpoint.Endpoint{}, nil } diff --git a/source/empty_test.go b/source/empty_test.go index f82f1a39d5..778d703315 100644 --- a/source/empty_test.go +++ b/source/empty_test.go @@ -17,13 +17,14 @@ limitations under the License. package source import ( + "context" "testing" ) func TestEmptySourceReturnsEmpty(t *testing.T) { e := NewEmptySource() - endpoints, err := e.Endpoints() + endpoints, err := e.Endpoints(context.Background()) if err != nil { t.Errorf("Expected no error but got %s", err.Error()) } diff --git a/source/fake.go b/source/fake.go index 54a59b604a..9173f4d0a1 100644 --- a/source/fake.go +++ b/source/fake.go @@ -59,7 +59,7 @@ func (sc *fakeSource) AddEventHandler(ctx context.Context, handler func()) { } // Endpoints returns endpoint objects. -func (sc *fakeSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (sc *fakeSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { endpoints := make([]*endpoint.Endpoint, 10) for i := 0; i < 10; i++ { diff --git a/source/fake_test.go b/source/fake_test.go index a45a6d98b4..ecc1aa1096 100644 --- a/source/fake_test.go +++ b/source/fake_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "net" "regexp" "testing" @@ -27,7 +28,7 @@ import ( func generateTestEndpoints() []*endpoint.Endpoint { sc, _ := NewFakeSource("") - endpoints, _ := sc.Endpoints() + endpoints, _ := sc.Endpoints(context.Background()) return endpoints } diff --git a/source/gateway.go b/source/gateway.go index 1ef00d9e5d..4ca0bfb9d5 100644 --- a/source/gateway.go +++ b/source/gateway.go @@ -116,8 +116,8 @@ func NewIstioGatewaySource( // Endpoints returns endpoint objects for each host-target combination that should be processed. // Retrieves all gateway resources in the source's namespace(s). -func (sc *gatewaySource) Endpoints() ([]*endpoint.Endpoint, error) { - gwList, err := sc.istioClient.NetworkingV1alpha3().Gateways(sc.namespace).List(metav1.ListOptions{}) +func (sc *gatewaySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { + gwList, err := sc.istioClient.NetworkingV1alpha3().Gateways(sc.namespace).List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } diff --git a/source/gateway_test.go b/source/gateway_test.go index 9324fcc055..884e9a1ced 100644 --- a/source/gateway_test.go +++ b/source/gateway_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "testing" "github.com/pkg/errors" @@ -64,7 +65,7 @@ func (suite *GatewaySuite) SetupTest() { } for _, service := range suite.lbServices { - _, err = fakeKubernetesClient.CoreV1().Services(service.Namespace).Create(service) + _, err = fakeKubernetesClient.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) suite.NoError(err, "should succeed") } @@ -82,7 +83,7 @@ func (suite *GatewaySuite) SetupTest() { } func (suite *GatewaySuite) TestResourceLabelIsSet() { - endpoints, _ := suite.source.Endpoints() + endpoints, _ := suite.source.Endpoints(context.Background()) for _, ep := range endpoints { suite.Equal("gateway/default/foo-gateway-with-targets", ep.Labels[endpoint.ResourceLabelKey], "should set correct resource label") } @@ -1078,14 +1079,14 @@ func testGatewayEndpoints(t *testing.T) { for _, lb := range ti.lbServices { service := lb.Service() - _, err := fakeKubernetesClient.CoreV1().Services(service.Namespace).Create(service) + _, err := fakeKubernetesClient.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) } fakeIstioClient := NewFakeConfigStore() for _, config := range ti.configItems { gatewayCfg := config.Config() - _, err := fakeIstioClient.NetworkingV1alpha3().Gateways(ti.targetNamespace).Create(&gatewayCfg) + _, err := fakeIstioClient.NetworkingV1alpha3().Gateways(ti.targetNamespace).Create(context.Background(), &gatewayCfg, metav1.CreateOptions{}) require.NoError(t, err) } @@ -1100,7 +1101,7 @@ func testGatewayEndpoints(t *testing.T) { ) require.NoError(t, err) - res, err := gatewaySource.Endpoints() + res, err := gatewaySource.Endpoints(context.Background()) if ti.expectError { assert.Error(t, err) } else { @@ -1119,7 +1120,7 @@ func newTestGatewaySource(loadBalancerList []fakeIngressGatewayService) (*gatewa for _, lb := range loadBalancerList { service := lb.Service() - _, err := fakeKubernetesClient.CoreV1().Services(service.Namespace).Create(service) + _, err := fakeKubernetesClient.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) if err != nil { return nil, err } diff --git a/source/httpproxy.go b/source/httpproxy.go new file mode 100644 index 0000000000..087eadd306 --- /dev/null +++ b/source/httpproxy.go @@ -0,0 +1,323 @@ +/* +Copyright 2017 The Kubernetes Authors. + +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. +*/ + +package source + +import ( + "bytes" + "context" + "fmt" + "sort" + "strings" + "text/template" + "time" + + "github.com/pkg/errors" + projectcontour "github.com/projectcontour/contour/apis/projectcontour/v1" + log "github.com/sirupsen/logrus" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/dynamic/dynamicinformer" + "k8s.io/client-go/informers" + "k8s.io/client-go/tools/cache" + + "sigs.k8s.io/external-dns/endpoint" +) + +// HTTPProxySource is an implementation of Source for ProjectContour HTTPProxy objects. +// The HTTPProxy implementation uses the spec.virtualHost.fqdn value for the hostname. +// Use targetAnnotationKey to explicitly set Endpoint. +type httpProxySource struct { + dynamicKubeClient dynamic.Interface + namespace string + annotationFilter string + fqdnTemplate *template.Template + combineFQDNAnnotation bool + ignoreHostnameAnnotation bool + httpProxyInformer informers.GenericInformer + unstructuredConverter *UnstructuredConverter +} + +// NewContourHTTPProxySource creates a new contourHTTPProxySource with the given config. +func NewContourHTTPProxySource( + dynamicKubeClient dynamic.Interface, + namespace string, + annotationFilter string, + fqdnTemplate string, + combineFqdnAnnotation bool, + ignoreHostnameAnnotation bool, +) (Source, error) { + var ( + tmpl *template.Template + err error + ) + if fqdnTemplate != "" { + tmpl, err = template.New("endpoint").Funcs(template.FuncMap{ + "trimPrefix": strings.TrimPrefix, + }).Parse(fqdnTemplate) + if err != nil { + return nil, err + } + } + + // Use shared informer to listen for add/update/delete of HTTPProxys in the specified namespace. + // Set resync period to 0, to prevent processing when nothing has changed. + informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicKubeClient, 0, namespace, nil) + httpProxyInformer := informerFactory.ForResource(projectcontour.HTTPProxyGVR) + + // Add default resource event handlers to properly initialize informer. + httpProxyInformer.Informer().AddEventHandler( + cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { + }, + }, + ) + + // TODO informer is not explicitly stopped since controller is not passing in its channel. + informerFactory.Start(wait.NeverStop) + + // wait for the local cache to be populated. + err = poll(time.Second, 60*time.Second, func() (bool, error) { + return httpProxyInformer.Informer().HasSynced(), nil + }) + if err != nil { + return nil, fmt.Errorf("failed to sync cache: %v", err) + } + + uc, err := NewUnstructuredConverter() + if err != nil { + return nil, fmt.Errorf("failed to setup Unstructured Converter: %v", err) + } + + return &httpProxySource{ + dynamicKubeClient: dynamicKubeClient, + namespace: namespace, + annotationFilter: annotationFilter, + fqdnTemplate: tmpl, + combineFQDNAnnotation: combineFqdnAnnotation, + ignoreHostnameAnnotation: ignoreHostnameAnnotation, + httpProxyInformer: httpProxyInformer, + unstructuredConverter: uc, + }, nil +} + +// Endpoints returns endpoint objects for each host-target combination that should be processed. +// Retrieves all HTTPProxy resources in the source's namespace(s). +func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { + hps, err := sc.httpProxyInformer.Lister().ByNamespace(sc.namespace).List(labels.Everything()) + if err != nil { + return nil, err + } + + // Convert to []*projectcontour.HTTPProxy + var httpProxies []*projectcontour.HTTPProxy + for _, hp := range hps { + unstrucuredHP, ok := hp.(*unstructured.Unstructured) + if !ok { + return nil, errors.New("could not convert") + } + + hpConverted := &projectcontour.HTTPProxy{} + err := sc.unstructuredConverter.scheme.Convert(unstrucuredHP, hpConverted, nil) + if err != nil { + return nil, err + } + httpProxies = append(httpProxies, hpConverted) + } + + httpProxies, err = sc.filterByAnnotations(httpProxies) + if err != nil { + return nil, err + } + + endpoints := []*endpoint.Endpoint{} + + for _, hp := range httpProxies { + // Check controller annotation to see if we are responsible. + controller, ok := hp.Annotations[controllerAnnotationKey] + if ok && controller != controllerAnnotationValue { + log.Debugf("Skipping HTTPProxy %s/%s because controller value does not match, found: %s, required: %s", + hp.Namespace, hp.Name, controller, controllerAnnotationValue) + continue + } else if hp.Status.CurrentStatus != "valid" { + log.Debugf("Skipping HTTPProxy %s/%s because it is not valid", hp.Namespace, hp.Name) + continue + } + + hpEndpoints, err := sc.endpointsFromHTTPProxy(hp) + if err != nil { + return nil, err + } + + // apply template if fqdn is missing on HTTPProxy + if (sc.combineFQDNAnnotation || len(hpEndpoints) == 0) && sc.fqdnTemplate != nil { + tmplEndpoints, err := sc.endpointsFromTemplate(hp) + if err != nil { + return nil, err + } + + if sc.combineFQDNAnnotation { + hpEndpoints = append(hpEndpoints, tmplEndpoints...) + } else { + hpEndpoints = tmplEndpoints + } + } + + if len(hpEndpoints) == 0 { + log.Debugf("No endpoints could be generated from HTTPProxy %s/%s", hp.Namespace, hp.Name) + continue + } + + log.Debugf("Endpoints generated from HTTPProxy: %s/%s: %v", hp.Namespace, hp.Name, hpEndpoints) + sc.setResourceLabel(hp, hpEndpoints) + endpoints = append(endpoints, hpEndpoints...) + } + + for _, ep := range endpoints { + sort.Sort(ep.Targets) + } + + return endpoints, nil +} + +func (sc *httpProxySource) endpointsFromTemplate(httpProxy *projectcontour.HTTPProxy) ([]*endpoint.Endpoint, error) { + // Process the whole template string + var buf bytes.Buffer + err := sc.fqdnTemplate.Execute(&buf, httpProxy) + if err != nil { + return nil, fmt.Errorf("failed to apply template on HTTPProxy %s/%s: %v", httpProxy.Namespace, httpProxy.Name, err) + } + + hostnames := buf.String() + + ttl, err := getTTLFromAnnotations(httpProxy.Annotations) + if err != nil { + log.Warn(err) + } + + targets := getTargetsFromTargetAnnotation(httpProxy.Annotations) + + if len(targets) == 0 { + for _, lb := range httpProxy.Status.LoadBalancer.Ingress { + if lb.IP != "" { + targets = append(targets, lb.IP) + } + if lb.Hostname != "" { + targets = append(targets, lb.Hostname) + } + } + } + + providerSpecific, setIdentifier := getProviderSpecificAnnotations(httpProxy.Annotations) + + var endpoints []*endpoint.Endpoint + // splits the FQDN template and removes the trailing periods + hostnameList := strings.Split(strings.Replace(hostnames, " ", "", -1), ",") + for _, hostname := range hostnameList { + hostname = strings.TrimSuffix(hostname, ".") + endpoints = append(endpoints, endpointsForHostname(hostname, targets, ttl, providerSpecific, setIdentifier)...) + } + return endpoints, nil +} + +// filterByAnnotations filters a list of configs by a given annotation selector. +func (sc *httpProxySource) filterByAnnotations(httpProxies []*projectcontour.HTTPProxy) ([]*projectcontour.HTTPProxy, error) { + labelSelector, err := metav1.ParseToLabelSelector(sc.annotationFilter) + if err != nil { + return nil, err + } + selector, err := metav1.LabelSelectorAsSelector(labelSelector) + if err != nil { + return nil, err + } + + // empty filter returns original list + if selector.Empty() { + return httpProxies, nil + } + + filteredList := []*projectcontour.HTTPProxy{} + + for _, httpProxy := range httpProxies { + // convert the HTTPProxy's annotations to an equivalent label selector + annotations := labels.Set(httpProxy.Annotations) + + // include HTTPProxy if its annotations match the selector + if selector.Matches(annotations) { + filteredList = append(filteredList, httpProxy) + } + } + + return filteredList, nil +} + +func (sc *httpProxySource) setResourceLabel(httpProxy *projectcontour.HTTPProxy, endpoints []*endpoint.Endpoint) { + for _, ep := range endpoints { + ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("HTTPProxy/%s/%s", httpProxy.Namespace, httpProxy.Name) + } +} + +// endpointsFromHTTPProxyConfig extracts the endpoints from a Contour HTTPProxy object +func (sc *httpProxySource) endpointsFromHTTPProxy(httpProxy *projectcontour.HTTPProxy) ([]*endpoint.Endpoint, error) { + if httpProxy.Status.CurrentStatus != "valid" { + log.Warn(errors.Errorf("cannot generate endpoints for HTTPProxy with status %s", httpProxy.Status.CurrentStatus)) + return nil, nil + } + + var endpoints []*endpoint.Endpoint + + ttl, err := getTTLFromAnnotations(httpProxy.Annotations) + if err != nil { + log.Warn(err) + } + + targets := getTargetsFromTargetAnnotation(httpProxy.Annotations) + + if len(targets) == 0 { + for _, lb := range httpProxy.Status.LoadBalancer.Ingress { + if lb.IP != "" { + targets = append(targets, lb.IP) + } + if lb.Hostname != "" { + targets = append(targets, lb.Hostname) + } + } + } + + providerSpecific, setIdentifier := getProviderSpecificAnnotations(httpProxy.Annotations) + + if virtualHost := httpProxy.Spec.VirtualHost; virtualHost != nil { + if fqdn := virtualHost.Fqdn; fqdn != "" { + endpoints = append(endpoints, endpointsForHostname(fqdn, targets, ttl, providerSpecific, setIdentifier)...) + } + } + + // Skip endpoints if we do not want entries from annotations + if !sc.ignoreHostnameAnnotation { + hostnameList := getHostnamesFromAnnotations(httpProxy.Annotations) + for _, hostname := range hostnameList { + endpoints = append(endpoints, endpointsForHostname(hostname, targets, ttl, providerSpecific, setIdentifier)...) + } + } + + return endpoints, nil +} + +func (sc *httpProxySource) AddEventHandler(ctx context.Context, handler func()) { +} diff --git a/source/httpproxy_test.go b/source/httpproxy_test.go new file mode 100644 index 0000000000..178b920851 --- /dev/null +++ b/source/httpproxy_test.go @@ -0,0 +1,1081 @@ +/* +Copyright 2017 The Kubernetes Authors. + +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. +*/ + +package source + +import ( + "context" + v1 "k8s.io/api/core/v1" + "testing" + + "github.com/pkg/errors" + projectcontour "github.com/projectcontour/contour/apis/projectcontour/v1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/external-dns/endpoint" +) + +// This is a compile-time validation that httpProxySource is a Source. +var _ Source = &httpProxySource{} + +type HTTPProxySuite struct { + suite.Suite + source Source + httpProxy *projectcontour.HTTPProxy +} + +func (suite *HTTPProxySuite) SetupTest() { + fakeDynamicClient, s := newDynamicKubernetesClient() + var err error + + suite.source, err = NewContourHTTPProxySource( + fakeDynamicClient, + "default", + "", + "{{.Name}}", + false, + false, + ) + suite.NoError(err, "should initialize httpproxy source") + + suite.httpProxy = (fakeHTTPProxy{ + name: "foo-httpproxy-with-targets", + namespace: "default", + host: "example.com", + }).HTTPProxy() + + // Convert to unstructured + unstructuredHTTPProxy, err := convertHTTPProxyToUnstructured(suite.httpProxy, s) + if err != nil { + suite.Error(err) + } + + _, err = fakeDynamicClient.Resource(projectcontour.HTTPProxyGVR).Namespace(suite.httpProxy.Namespace).Create(context.Background(), unstructuredHTTPProxy, metav1.CreateOptions{}) + suite.NoError(err, "should succeed") +} + +func (suite *HTTPProxySuite) TestResourceLabelIsSet() { + endpoints, _ := suite.source.Endpoints(context.Background()) + for _, ep := range endpoints { + suite.Equal("httpproxy/default/foo-httpproxy-with-targets", ep.Labels[endpoint.ResourceLabelKey], "should set correct resource label") + } +} + +func convertHTTPProxyToUnstructured(hp *projectcontour.HTTPProxy, s *runtime.Scheme) (*unstructured.Unstructured, error) { + unstructuredHTTPProxy := &unstructured.Unstructured{} + if err := s.Convert(hp, unstructuredHTTPProxy, context.Background()); err != nil { + return nil, err + } + return unstructuredHTTPProxy, nil +} + +func TestHTTPProxy(t *testing.T) { + suite.Run(t, new(HTTPProxySuite)) + t.Run("endpointsFromHTTPProxy", testEndpointsFromHTTPProxy) + t.Run("Endpoints", testHTTPProxyEndpoints) +} + +func TestNewContourHTTPProxySource(t *testing.T) { + for _, ti := range []struct { + title string + annotationFilter string + fqdnTemplate string + combineFQDNAndAnnotation bool + expectError bool + }{ + { + title: "invalid template", + expectError: true, + fqdnTemplate: "{{.Name", + }, + { + title: "valid empty template", + expectError: false, + }, + { + title: "valid template", + expectError: false, + fqdnTemplate: "{{.Name}}-{{.Namespace}}.ext-dns.test.com", + }, + { + title: "valid template", + expectError: false, + fqdnTemplate: "{{.Name}}-{{.Namespace}}.ext-dns.test.com, {{.Name}}-{{.Namespace}}.ext-dna.test.com", + }, + { + title: "valid template", + expectError: false, + fqdnTemplate: "{{.Name}}-{{.Namespace}}.ext-dns.test.com, {{.Name}}-{{.Namespace}}.ext-dna.test.com", + combineFQDNAndAnnotation: true, + }, + { + title: "non-empty annotation filter label", + expectError: false, + annotationFilter: "contour.heptio.com/ingress.class=contour", + }, + } { + t.Run(ti.title, func(t *testing.T) { + fakeDynamicClient, _ := newDynamicKubernetesClient() + + _, err := NewContourHTTPProxySource( + fakeDynamicClient, + "", + ti.annotationFilter, + ti.fqdnTemplate, + ti.combineFQDNAndAnnotation, + false, + ) + if ti.expectError { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + }) + } +} + +func testEndpointsFromHTTPProxy(t *testing.T) { + for _, ti := range []struct { + title string + httpProxy fakeHTTPProxy + expected []*endpoint.Endpoint + }{ + { + title: "one rule.host one lb.hostname", + httpProxy: fakeHTTPProxy{ + host: "foo.bar", // Kubernetes requires removal of trailing dot + loadBalancer: fakeLoadBalancerService{ + hostnames: []string{"lb.com"}, // Kubernetes omits the trailing dot + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "foo.bar", + Targets: endpoint.Targets{"lb.com"}, + }, + }, + }, + { + title: "one rule.host one lb.IP", + httpProxy: fakeHTTPProxy{ + host: "foo.bar", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "foo.bar", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + }, + }, + { + title: "one rule.host two lb.IP and two lb.Hostname", + httpProxy: fakeHTTPProxy{ + host: "foo.bar", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8", "127.0.0.1"}, + hostnames: []string{"elb.com", "alb.com"}, + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "foo.bar", + Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"}, + }, + { + DNSName: "foo.bar", + Targets: endpoint.Targets{"elb.com", "alb.com"}, + }, + }, + }, + { + title: "no rule.host", + httpProxy: fakeHTTPProxy{}, + expected: []*endpoint.Endpoint{}, + }, + { + title: "one rule.host invalid httpproxy", + httpProxy: fakeHTTPProxy{ + host: "foo.bar", + invalid: true, + }, + expected: []*endpoint.Endpoint{}, + }, + { + title: "no targets", + httpProxy: fakeHTTPProxy{}, + expected: []*endpoint.Endpoint{}, + }, + { + title: "delegate httpproxy", + httpProxy: fakeHTTPProxy{ + delegate: true, + }, + expected: []*endpoint.Endpoint{}, + }, + } { + t.Run(ti.title, func(t *testing.T) { + if source, err := newTestHTTPProxySource(); err != nil { + require.NoError(t, err) + } else if endpoints, err := source.endpointsFromHTTPProxy(ti.httpProxy.HTTPProxy()); err != nil { + require.NoError(t, err) + } else { + validateEndpoints(t, endpoints, ti.expected) + } + }) + } +} + +func testHTTPProxyEndpoints(t *testing.T) { + namespace := "testing" + for _, ti := range []struct { + title string + targetNamespace string + annotationFilter string + loadBalancer fakeLoadBalancerService + httpProxyItems []fakeHTTPProxy + expected []*endpoint.Endpoint + expectError bool + fqdnTemplate string + combineFQDNAndAnnotation bool + ignoreHostnameAnnotation bool + }{ + { + title: "no httpproxy", + targetNamespace: "", + }, + { + title: "two simple httpproxys", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + hostnames: []string{"lb.com"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + host: "example.org", + }, + { + name: "fake2", + namespace: namespace, + host: "new.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "example.org", + Targets: endpoint.Targets{"lb.com"}, + }, + { + DNSName: "new.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "new.org", + Targets: endpoint.Targets{"lb.com"}, + }, + }, + }, + { + title: "two simple httpproxys on different namespaces", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + hostnames: []string{"lb.com"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: "testing1", + host: "example.org", + }, + { + name: "fake2", + namespace: "testing2", + host: "new.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "example.org", + Targets: endpoint.Targets{"lb.com"}, + }, + { + DNSName: "new.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "new.org", + Targets: endpoint.Targets{"lb.com"}, + }, + }, + }, + { + title: "two simple httpproxys on different namespaces and a target namespace", + targetNamespace: "testing1", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + hostnames: []string{"lb.com"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: "testing1", + host: "example.org", + }, + { + name: "fake2", + namespace: "testing2", + host: "new.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "example.org", + Targets: endpoint.Targets{"lb.com"}, + }, + }, + }, + { + title: "valid matching annotation filter expression", + targetNamespace: "", + annotationFilter: "contour.heptio.com/ingress.class in (alb, contour)", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + "contour.heptio.com/ingress.class": "contour", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + }, + }, + { + title: "valid non-matching annotation filter expression", + targetNamespace: "", + annotationFilter: "contour.heptio.com/ingress.class in (alb, contour)", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + "contour.heptio.com/ingress.class": "tectonic", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{}, + }, + { + title: "invalid annotation filter expression", + targetNamespace: "", + annotationFilter: "contour.heptio.com/ingress.name in (a b)", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + "contour.heptio.com/ingress.class": "alb", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{}, + expectError: true, + }, + { + title: "valid matching annotation filter label", + targetNamespace: "", + annotationFilter: "contour.heptio.com/ingress.class=contour", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + "contour.heptio.com/ingress.class": "contour", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + }, + }, + { + title: "valid non-matching annotation filter label", + targetNamespace: "", + annotationFilter: "contour.heptio.com/ingress.class=contour", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + "contour.heptio.com/ingress.class": "alb", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{}, + }, + { + title: "our controller type is dns-controller", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + controllerAnnotationKey: controllerAnnotationValue, + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + }, + }, + { + title: "different controller types are ignored", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + controllerAnnotationKey: "some-other-tool", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{}, + }, + { + title: "template for httpproxy if host is missing", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + hostnames: []string{"elb.com"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + controllerAnnotationKey: controllerAnnotationValue, + }, + host: "", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "fake1.ext-dns.test.com", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "fake1.ext-dns.test.com", + Targets: endpoint.Targets{"elb.com"}, + }, + }, + fqdnTemplate: "{{.Name}}.ext-dns.test.com", + }, + { + title: "another controller annotation skipped even with template", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + controllerAnnotationKey: "other-controller", + }, + host: "", + }, + }, + expected: []*endpoint.Endpoint{}, + fqdnTemplate: "{{.Name}}.ext-dns.test.com", + }, + { + title: "multiple FQDN template hostnames", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{}, + host: "", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "fake1.ext-dns.test.com", + Targets: endpoint.Targets{"8.8.8.8"}, + RecordType: endpoint.RecordTypeA, + }, + { + DNSName: "fake1.ext-dna.test.com", + Targets: endpoint.Targets{"8.8.8.8"}, + RecordType: endpoint.RecordTypeA, + }, + }, + fqdnTemplate: "{{.Name}}.ext-dns.test.com, {{.Name}}.ext-dna.test.com", + }, + { + title: "multiple FQDN template hostnames", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{}, + host: "", + }, + { + name: "fake2", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "fake1.ext-dns.test.com", + Targets: endpoint.Targets{"8.8.8.8"}, + RecordType: endpoint.RecordTypeA, + }, + { + DNSName: "fake1.ext-dna.test.com", + Targets: endpoint.Targets{"8.8.8.8"}, + RecordType: endpoint.RecordTypeA, + }, + { + DNSName: "example.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "fake2.ext-dns.test.com", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "fake2.ext-dna.test.com", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + }, + fqdnTemplate: "{{.Name}}.ext-dns.test.com, {{.Name}}.ext-dna.test.com", + combineFQDNAndAnnotation: true, + }, + { + title: "httpproxy rules with annotation", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + }, + host: "example.org", + }, + { + name: "fake2", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + }, + host: "example2.org", + }, + { + name: "fake3", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "1.2.3.4", + }, + host: "example3.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "example2.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "example3.org", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + }, + }, + { + title: "httpproxy rules with hostname annotation", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"1.2.3.4"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + hostnameAnnotationKey: "dns-through-hostname.com", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + { + DNSName: "dns-through-hostname.com", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + }, + }, + { + title: "httpproxy rules with hostname annotation having multiple hostnames", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"1.2.3.4"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + hostnameAnnotationKey: "dns-through-hostname.com, another-dns-through-hostname.com", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + { + DNSName: "dns-through-hostname.com", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + { + DNSName: "another-dns-through-hostname.com", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + }, + }, + { + title: "httpproxy rules with hostname and target annotation", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + hostnameAnnotationKey: "dns-through-hostname.com", + targetAnnotationKey: "httpproxy-target.com", + }, + host: "example.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "dns-through-hostname.com", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + }, + }, + { + title: "httpproxy rules with annotation and custom TTL", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + ttlAnnotationKey: "6", + }, + host: "example.org", + }, + { + name: "fake2", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + ttlAnnotationKey: "1", + }, + host: "example2.org", + }, + { + name: "fake3", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + ttlAnnotationKey: "10s", + }, + host: "example3.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordTTL: endpoint.TTL(6), + }, + { + DNSName: "example2.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordTTL: endpoint.TTL(1), + }, + { + DNSName: "example3.org", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordTTL: endpoint.TTL(10), + }, + }, + }, + { + title: "template for httpproxy with annotation", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{}, + hostnames: []string{}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + }, + host: "", + }, + { + name: "fake2", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "httpproxy-target.com", + }, + host: "", + }, + { + name: "fake3", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "1.2.3.4", + }, + host: "", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "fake1.ext-dns.test.com", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "fake2.ext-dns.test.com", + Targets: endpoint.Targets{"httpproxy-target.com"}, + RecordType: endpoint.RecordTypeCNAME, + }, + { + DNSName: "fake3.ext-dns.test.com", + Targets: endpoint.Targets{"1.2.3.4"}, + RecordType: endpoint.RecordTypeA, + }, + }, + fqdnTemplate: "{{.Name}}.ext-dns.test.com", + }, + { + title: "httpproxy with empty annotation", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{}, + hostnames: []string{}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + targetAnnotationKey: "", + }, + host: "", + }, + }, + expected: []*endpoint.Endpoint{}, + fqdnTemplate: "{{.Name}}.ext-dns.test.com", + }, + { + title: "ignore hostname annotations", + targetNamespace: "", + loadBalancer: fakeLoadBalancerService{ + ips: []string{"8.8.8.8"}, + hostnames: []string{"lb.com"}, + }, + httpProxyItems: []fakeHTTPProxy{ + { + name: "fake1", + namespace: namespace, + annotations: map[string]string{ + hostnameAnnotationKey: "ignore.me", + }, + host: "example.org", + }, + { + name: "fake2", + namespace: namespace, + annotations: map[string]string{ + hostnameAnnotationKey: "ignore.me.too", + }, + host: "new.org", + }, + }, + expected: []*endpoint.Endpoint{ + { + DNSName: "example.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "example.org", + Targets: endpoint.Targets{"lb.com"}, + }, + { + DNSName: "new.org", + Targets: endpoint.Targets{"8.8.8.8"}, + }, + { + DNSName: "new.org", + Targets: endpoint.Targets{"lb.com"}, + }, + }, + ignoreHostnameAnnotation: true, + }, + } { + t.Run(ti.title, func(t *testing.T) { + httpProxies := make([]*projectcontour.HTTPProxy, 0) + for _, item := range ti.httpProxyItems { + item.loadBalancer = ti.loadBalancer + httpProxies = append(httpProxies, item.HTTPProxy()) + } + + fakeDynamicClient, scheme := newDynamicKubernetesClient() + for _, httpProxy := range httpProxies { + converted, err := convertHTTPProxyToUnstructured(httpProxy, scheme) + require.NoError(t, err) + _, err = fakeDynamicClient.Resource(projectcontour.HTTPProxyGVR).Namespace(httpProxy.Namespace).Create(context.Background(), converted, metav1.CreateOptions{}) + require.NoError(t, err) + } + + httpProxySource, err := NewContourHTTPProxySource( + fakeDynamicClient, + ti.targetNamespace, + ti.annotationFilter, + ti.fqdnTemplate, + ti.combineFQDNAndAnnotation, + ti.ignoreHostnameAnnotation, + ) + require.NoError(t, err) + + res, err := httpProxySource.Endpoints(context.Background()) + if ti.expectError { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + + validateEndpoints(t, res, ti.expected) + }) + } +} + +// httpproxy specific helper functions +func newTestHTTPProxySource() (*httpProxySource, error) { + fakeDynamicClient, _ := newDynamicKubernetesClient() + + src, err := NewContourHTTPProxySource( + fakeDynamicClient, + "default", + "", + "{{.Name}}", + false, + false, + ) + if err != nil { + return nil, err + } + + irsrc, ok := src.(*httpProxySource) + if !ok { + return nil, errors.New("underlying source type was not httpproxy") + } + + return irsrc, nil +} + +type fakeHTTPProxy struct { + namespace string + name string + annotations map[string]string + + host string + invalid bool + delegate bool + loadBalancer fakeLoadBalancerService +} + +func (ir fakeHTTPProxy) HTTPProxy() *projectcontour.HTTPProxy { + var status string + if ir.invalid { + status = "invalid" + } else { + status = "valid" + } + + var spec projectcontour.HTTPProxySpec + if ir.delegate { + spec = projectcontour.HTTPProxySpec{} + } else { + spec = projectcontour.HTTPProxySpec{ + VirtualHost: &projectcontour.VirtualHost{ + Fqdn: ir.host, + }, + } + } + + lb := v1.LoadBalancerStatus{ + Ingress: []v1.LoadBalancerIngress{}, + } + + for _, ip := range ir.loadBalancer.ips { + lb.Ingress = append(lb.Ingress, v1.LoadBalancerIngress{ + IP: ip, + }) + } + for _, hostname := range ir.loadBalancer.hostnames { + lb.Ingress = append(lb.Ingress, v1.LoadBalancerIngress{ + Hostname: hostname, + }) + } + + httpProxy := &projectcontour.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: ir.namespace, + Name: ir.name, + Annotations: ir.annotations, + }, + Spec: spec, + Status: projectcontour.Status{ + CurrentStatus: status, + LoadBalancer: lb, + }, + } + + return httpProxy +} \ No newline at end of file diff --git a/source/ingress.go b/source/ingress.go index 01972ec41e..89775f90a6 100644 --- a/source/ingress.go +++ b/source/ingress.go @@ -111,7 +111,7 @@ func NewIngressSource(kubeClient kubernetes.Interface, namespace, annotationFilt // Endpoints returns endpoint objects for each host-target combination that should be processed. // Retrieves all ingress resources on all namespaces -func (sc *ingressSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (sc *ingressSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { ingresses, err := sc.ingressInformer.Lister().Ingresses(sc.namespace).List(labels.Everything()) if err != nil { return nil, err diff --git a/source/ingress_test.go b/source/ingress_test.go index d20b3db748..f30060250a 100644 --- a/source/ingress_test.go +++ b/source/ingress_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "testing" "time" @@ -62,19 +63,19 @@ func (suite *IngressSuite) SetupTest() { hostnames: []string{"v1"}, annotations: map[string]string{ALBDualstackAnnotationKey: ALBDualstackAnnotationValue}, }).Ingress() - _, err = fakeClient.ExtensionsV1beta1().Ingresses(suite.fooWithTargets.Namespace).Create(suite.fooWithTargets) + _, err = fakeClient.ExtensionsV1beta1().Ingresses(suite.fooWithTargets.Namespace).Create(context.Background(), suite.fooWithTargets, metav1.CreateOptions{}) suite.NoError(err, "should succeed") } func (suite *IngressSuite) TestResourceLabelIsSet() { - endpoints, _ := suite.sc.Endpoints() + endpoints, _ := suite.sc.Endpoints(context.Background()) for _, ep := range endpoints { suite.Equal("ingress/default/foo-with-targets", ep.Labels[endpoint.ResourceLabelKey], "should set correct resource label") } } func (suite *IngressSuite) TestDualstackLabelIsSet() { - endpoints, _ := suite.sc.Endpoints() + endpoints, _ := suite.sc.Endpoints(context.Background()) for _, ep := range endpoints { suite.Equal("true", ep.Labels[endpoint.DualstackLabelKey], "should set dualstack label to true") } @@ -1009,7 +1010,7 @@ func testIngressEndpoints(t *testing.T) { ti.ignoreHostnameAnnotation, ) for _, ingress := range ingresses { - _, err := fakeClient.ExtensionsV1beta1().Ingresses(ingress.Namespace).Create(ingress) + _, err := fakeClient.ExtensionsV1beta1().Ingresses(ingress.Namespace).Create(context.Background(), ingress, metav1.CreateOptions{}) require.NoError(t, err) } @@ -1038,7 +1039,7 @@ func testIngressEndpoints(t *testing.T) { require.NoError(t, err) // Informer cache has all of the ingresses. Retrieve and validate their endpoints. - res, err := source.Endpoints() + res, err := source.Endpoints(context.Background()) if ti.expectError { require.Error(t, err) } else { diff --git a/source/ingressroute.go b/source/ingressroute.go index 412ab32dac..1301f65590 100644 --- a/source/ingressroute.go +++ b/source/ingressroute.go @@ -26,18 +26,16 @@ import ( "time" "github.com/pkg/errors" - contourapi "github.com/projectcontour/contour/apis/contour/v1beta1" + contour "github.com/projectcontour/contour/apis/contour/v1beta1" log "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/dynamic" "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/cache" "sigs.k8s.io/external-dns/endpoint" @@ -90,7 +88,7 @@ func NewContourIngressRouteSource( // Use shared informer to listen for add/update/delete of ingressroutes in the specified namespace. // Set resync period to 0, to prevent processing when nothing has changed. informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicKubeClient, 0, namespace, nil) - ingressRouteInformer := informerFactory.ForResource(contourapi.IngressRouteGVR) + ingressRouteInformer := informerFactory.ForResource(contour.IngressRouteGVR) // Add default resource event handlers to properly initialize informer. ingressRouteInformer.Informer().AddEventHandler( @@ -132,21 +130,21 @@ func NewContourIngressRouteSource( // Endpoints returns endpoint objects for each host-target combination that should be processed. // Retrieves all ingressroute resources in the source's namespace(s). -func (sc *ingressRouteSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (sc *ingressRouteSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { irs, err := sc.ingressRouteInformer.Lister().ByNamespace(sc.namespace).List(labels.Everything()) if err != nil { return nil, err } - // Convert to []*contourapi.IngressRoute - var ingressRoutes []*contourapi.IngressRoute + // Convert to []*contour.IngressRoute + var ingressRoutes []*contour.IngressRoute for _, ir := range irs { unstrucuredIR, ok := ir.(*unstructured.Unstructured) if !ok { return nil, errors.New("could not convert") } - irConverted := &contourapi.IngressRoute{} + irConverted := &contour.IngressRoute{} err := sc.unstructuredConverter.scheme.Convert(unstrucuredIR, irConverted, nil) if err != nil { return nil, err @@ -173,14 +171,14 @@ func (sc *ingressRouteSource) Endpoints() ([]*endpoint.Endpoint, error) { continue } - irEndpoints, err := sc.endpointsFromIngressRoute(ir) + irEndpoints, err := sc.endpointsFromIngressRoute(ctx, ir) if err != nil { return nil, err } // apply template if fqdn is missing on ingressroute if (sc.combineFQDNAnnotation || len(irEndpoints) == 0) && sc.fqdnTemplate != nil { - tmplEndpoints, err := sc.endpointsFromTemplate(ir) + tmplEndpoints, err := sc.endpointsFromTemplate(ctx, ir) if err != nil { return nil, err } @@ -209,7 +207,7 @@ func (sc *ingressRouteSource) Endpoints() ([]*endpoint.Endpoint, error) { return endpoints, nil } -func (sc *ingressRouteSource) endpointsFromTemplate(ingressRoute *contourapi.IngressRoute) ([]*endpoint.Endpoint, error) { +func (sc *ingressRouteSource) endpointsFromTemplate(ctx context.Context, ingressRoute *contour.IngressRoute) ([]*endpoint.Endpoint, error) { // Process the whole template string var buf bytes.Buffer err := sc.fqdnTemplate.Execute(&buf, ingressRoute) @@ -227,7 +225,7 @@ func (sc *ingressRouteSource) endpointsFromTemplate(ingressRoute *contourapi.Ing targets := getTargetsFromTargetAnnotation(ingressRoute.Annotations) if len(targets) == 0 { - targets, err = sc.targetsFromContourLoadBalancer() + targets, err = sc.targetsFromContourLoadBalancer(ctx) if err != nil { return nil, err } @@ -246,7 +244,7 @@ func (sc *ingressRouteSource) endpointsFromTemplate(ingressRoute *contourapi.Ing } // filterByAnnotations filters a list of configs by a given annotation selector. -func (sc *ingressRouteSource) filterByAnnotations(ingressRoutes []*contourapi.IngressRoute) ([]*contourapi.IngressRoute, error) { +func (sc *ingressRouteSource) filterByAnnotations(ingressRoutes []*contour.IngressRoute) ([]*contour.IngressRoute, error) { labelSelector, err := metav1.ParseToLabelSelector(sc.annotationFilter) if err != nil { return nil, err @@ -261,7 +259,7 @@ func (sc *ingressRouteSource) filterByAnnotations(ingressRoutes []*contourapi.In return ingressRoutes, nil } - filteredList := []*contourapi.IngressRoute{} + filteredList := []*contour.IngressRoute{} for _, ingressRoute := range ingressRoutes { // convert the ingressroute's annotations to an equivalent label selector @@ -276,18 +274,18 @@ func (sc *ingressRouteSource) filterByAnnotations(ingressRoutes []*contourapi.In return filteredList, nil } -func (sc *ingressRouteSource) setResourceLabel(ingressRoute *contourapi.IngressRoute, endpoints []*endpoint.Endpoint) { +func (sc *ingressRouteSource) setResourceLabel(ingressRoute *contour.IngressRoute, endpoints []*endpoint.Endpoint) { for _, ep := range endpoints { ep.Labels[endpoint.ResourceLabelKey] = fmt.Sprintf("ingressroute/%s/%s", ingressRoute.Namespace, ingressRoute.Name) } } -func (sc *ingressRouteSource) targetsFromContourLoadBalancer() (targets endpoint.Targets, err error) { +func (sc *ingressRouteSource) targetsFromContourLoadBalancer(ctx context.Context) (targets endpoint.Targets, err error) { lbNamespace, lbName, err := parseContourLoadBalancerService(sc.contourLoadBalancerService) if err != nil { return nil, err } - if svc, err := sc.kubeClient.CoreV1().Services(lbNamespace).Get(lbName, metav1.GetOptions{}); err != nil { + if svc, err := sc.kubeClient.CoreV1().Services(lbNamespace).Get(ctx, lbName, metav1.GetOptions{}); err != nil { log.Warn(err) } else { for _, lb := range svc.Status.LoadBalancer.Ingress { @@ -304,7 +302,7 @@ func (sc *ingressRouteSource) targetsFromContourLoadBalancer() (targets endpoint } // endpointsFromIngressRouteConfig extracts the endpoints from a Contour IngressRoute object -func (sc *ingressRouteSource) endpointsFromIngressRoute(ingressRoute *contourapi.IngressRoute) ([]*endpoint.Endpoint, error) { +func (sc *ingressRouteSource) endpointsFromIngressRoute(ctx context.Context, ingressRoute *contour.IngressRoute) ([]*endpoint.Endpoint, error) { if ingressRoute.CurrentStatus != "valid" { log.Warn(errors.Errorf("cannot generate endpoints for ingressroute with status %s", ingressRoute.CurrentStatus)) return nil, nil @@ -320,7 +318,7 @@ func (sc *ingressRouteSource) endpointsFromIngressRoute(ingressRoute *contourapi targets := getTargetsFromTargetAnnotation(ingressRoute.Annotations) if len(targets) == 0 { - targets, err = sc.targetsFromContourLoadBalancer() + targets, err = sc.targetsFromContourLoadBalancer(ctx) if err != nil { return nil, err } @@ -358,26 +356,3 @@ func parseContourLoadBalancerService(service string) (namespace, name string, er func (sc *ingressRouteSource) AddEventHandler(ctx context.Context, handler func()) { } - -// UnstructuredConverter handles conversions between unstructured.Unstructured and Contour types -type UnstructuredConverter struct { - // scheme holds an initializer for converting Unstructured to a type - scheme *runtime.Scheme -} - -// NewUnstructuredConverter returns a new UnstructuredConverter initialized -func NewUnstructuredConverter() (*UnstructuredConverter, error) { - uc := &UnstructuredConverter{ - scheme: runtime.NewScheme(), - } - - // Setup converter to understand custom CRD types - contourapi.AddKnownTypes(uc.scheme) - - // Add the core types we need - if err := scheme.AddToScheme(uc.scheme); err != nil { - return nil, err - } - - return uc, nil -} diff --git a/source/ingressroute_test.go b/source/ingressroute_test.go index 8dc5242555..8a18182c50 100644 --- a/source/ingressroute_test.go +++ b/source/ingressroute_test.go @@ -58,7 +58,7 @@ func (suite *IngressRouteSuite) SetupTest() { name: "contour", }).Service() - _, err = fakeKubernetesClient.CoreV1().Services(suite.loadBalancer.Namespace).Create(suite.loadBalancer) + _, err = fakeKubernetesClient.CoreV1().Services(suite.loadBalancer.Namespace).Create(context.Background(), suite.loadBalancer, metav1.CreateOptions{}) suite.NoError(err, "should succeed") suite.source, err = NewContourIngressRouteSource( @@ -80,17 +80,17 @@ func (suite *IngressRouteSuite) SetupTest() { }).IngressRoute() // Convert to unstructured - unstructuredIngressRoute, err := convertToUnstructured(suite.ingressRoute, s) + unstructuredIngressRoute, err := convertIngressRouteToUnstructured(suite.ingressRoute, s) if err != nil { suite.Error(err) } - _, err = fakeDynamicClient.Resource(contour.IngressRouteGVR).Namespace(suite.ingressRoute.Namespace).Create(unstructuredIngressRoute, metav1.CreateOptions{}) + _, err = fakeDynamicClient.Resource(contour.IngressRouteGVR).Namespace(suite.ingressRoute.Namespace).Create(context.Background(), unstructuredIngressRoute, metav1.CreateOptions{}) suite.NoError(err, "should succeed") } func (suite *IngressRouteSuite) TestResourceLabelIsSet() { - endpoints, _ := suite.source.Endpoints() + endpoints, _ := suite.source.Endpoints(context.Background()) for _, ep := range endpoints { suite.Equal("ingressroute/default/foo-ingressroute-with-targets", ep.Labels[endpoint.ResourceLabelKey], "should set correct resource label") } @@ -98,13 +98,14 @@ func (suite *IngressRouteSuite) TestResourceLabelIsSet() { func newDynamicKubernetesClient() (*fakeDynamic.FakeDynamicClient, *runtime.Scheme) { s := runtime.NewScheme() - contour.AddKnownTypes(s) + _ = contour.AddToScheme(s) + _ = projectcontour.AddToScheme(s) return fakeDynamic.NewSimpleDynamicClient(s), s } -func convertToUnstructured(ir *contour.IngressRoute, s *runtime.Scheme) (*unstructured.Unstructured, error) { +func convertIngressRouteToUnstructured(ir *contour.IngressRoute, s *runtime.Scheme) (*unstructured.Unstructured, error) { unstructuredIngressRoute := &unstructured.Unstructured{} - if err := s.Convert(ir, unstructuredIngressRoute, context.TODO()); err != nil { + if err := s.Convert(ir, unstructuredIngressRoute, context.Background()); err != nil { return nil, err } return unstructuredIngressRoute, nil @@ -275,7 +276,7 @@ func testEndpointsFromIngressRoute(t *testing.T) { t.Run(ti.title, func(t *testing.T) { if source, err := newTestIngressRouteSource(ti.loadBalancer); err != nil { require.NoError(t, err) - } else if endpoints, err := source.endpointsFromIngressRoute(ti.ingressRoute.IngressRoute()); err != nil { + } else if endpoints, err := source.endpointsFromIngressRoute(context.Background(), ti.ingressRoute.IngressRoute()); err != nil { require.NoError(t, err) } else { validateEndpoints(t, endpoints, ti.expected) @@ -1006,16 +1007,16 @@ func testIngressRouteEndpoints(t *testing.T) { fakeKubernetesClient := fakeKube.NewSimpleClientset() lbService := ti.loadBalancer.Service() - _, err := fakeKubernetesClient.CoreV1().Services(lbService.Namespace).Create(lbService) + _, err := fakeKubernetesClient.CoreV1().Services(lbService.Namespace).Create(context.Background(), lbService, metav1.CreateOptions{}) if err != nil { require.NoError(t, err) } fakeDynamicClient, scheme := newDynamicKubernetesClient() for _, ingressRoute := range ingressRoutes { - converted, err := convertToUnstructured(ingressRoute, scheme) + converted, err := convertIngressRouteToUnstructured(ingressRoute, scheme) require.NoError(t, err) - _, err = fakeDynamicClient.Resource(contour.IngressRouteGVR).Namespace(ingressRoute.Namespace).Create(converted, metav1.CreateOptions{}) + _, err = fakeDynamicClient.Resource(contour.IngressRouteGVR).Namespace(ingressRoute.Namespace).Create(context.Background(), converted, metav1.CreateOptions{}) require.NoError(t, err) } @@ -1031,7 +1032,7 @@ func testIngressRouteEndpoints(t *testing.T) { ) require.NoError(t, err) - res, err := ingressRouteSource.Endpoints() + res, err := ingressRouteSource.Endpoints(context.Background()) if ti.expectError { assert.Error(t, err) } else { @@ -1049,7 +1050,7 @@ func newTestIngressRouteSource(loadBalancer fakeLoadBalancerService) (*ingressRo fakeDynamicClient, _ := newDynamicKubernetesClient() lbService := loadBalancer.Service() - _, err := fakeKubernetesClient.CoreV1().Services(lbService.Namespace).Create(lbService) + _, err := fakeKubernetesClient.CoreV1().Services(lbService.Namespace).Create(context.Background(), lbService, metav1.CreateOptions{}) if err != nil { return nil, err } @@ -1133,7 +1134,7 @@ func (ir fakeIngressRoute) IngressRoute() *contour.IngressRoute { spec = contour.IngressRouteSpec{} } else { spec = contour.IngressRouteSpec{ - VirtualHost: &projectcontour.VirtualHost{ + VirtualHost: &contour.VirtualHost{ Fqdn: ir.host, }, } diff --git a/source/multi_source.go b/source/multi_source.go index 494acd16b7..28744863fe 100644 --- a/source/multi_source.go +++ b/source/multi_source.go @@ -28,11 +28,11 @@ type multiSource struct { } // Endpoints collects endpoints of all nested Sources and returns them in a single slice. -func (ms *multiSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (ms *multiSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { result := []*endpoint.Endpoint{} for _, s := range ms.children { - endpoints, err := s.Endpoints() + endpoints, err := s.Endpoints(ctx) if err != nil { return nil, err } diff --git a/source/multi_source_test.go b/source/multi_source_test.go index 59584d6af7..7c579a55c0 100644 --- a/source/multi_source_test.go +++ b/source/multi_source_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "errors" "testing" @@ -85,7 +86,7 @@ func testMultiSourceEndpoints(t *testing.T) { source := NewMultiSource(sources) // Get endpoints from the source. - endpoints, err := source.Endpoints() + endpoints, err := source.Endpoints(context.Background()) require.NoError(t, err) // Validate returned endpoints against desired endpoints. @@ -112,7 +113,7 @@ func testMultiSourceEndpointsWithError(t *testing.T) { source := NewMultiSource([]Source{src}) // Get endpoints from our source. - _, err := source.Endpoints() + _, err := source.Endpoints(context.Background()) assert.EqualError(t, err, "some error") // Validate that the nested source was called. diff --git a/source/node.go b/source/node.go index d54ff890b9..0ac6ea493f 100644 --- a/source/node.go +++ b/source/node.go @@ -94,7 +94,7 @@ func NewNodeSource(kubeClient kubernetes.Interface, annotationFilter, fqdnTempla } // Endpoints returns endpoint objects for each service that should be processed. -func (ns *nodeSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (ns *nodeSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { nodes, err := ns.nodeInformer.Lister().List(labels.Everything()) if err != nil { return nil, err diff --git a/source/node_test.go b/source/node_test.go index 231f4d8a10..1a9aa1d653 100644 --- a/source/node_test.go +++ b/source/node_test.go @@ -1,6 +1,7 @@ package source import ( + "context" "testing" "github.com/stretchr/testify/assert" @@ -306,7 +307,7 @@ func testNodeSourceEndpoints(t *testing.T) { }, } - _, err := kubernetes.CoreV1().Nodes().Create(node) + _, err := kubernetes.CoreV1().Nodes().Create(context.Background(), node, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -317,7 +318,7 @@ func testNodeSourceEndpoints(t *testing.T) { ) require.NoError(t, err) - endpoints, err := client.Endpoints() + endpoints, err := client.Endpoints(context.Background()) if tc.expectError { require.Error(t, err) } else { diff --git a/source/ocproute.go b/source/ocproute.go index 0f2ed30cfa..c09acf09fa 100644 --- a/source/ocproute.go +++ b/source/ocproute.go @@ -115,7 +115,7 @@ func (ors *ocpRouteSource) AddEventHandler(ctx context.Context, handler func()) // Endpoints returns endpoint objects for each host-target combination that should be processed. // Retrieves all OpenShift Route resources on all namespaces -func (ors *ocpRouteSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (ors *ocpRouteSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { ocpRoutes, err := ors.routeInformer.Lister().Routes(ors.namespace).List(labels.Everything()) if err != nil { return nil, err diff --git a/source/routegroup.go b/source/routegroup.go index a9dbe97cff..278ea5642f 100644 --- a/source/routegroup.go +++ b/source/routegroup.go @@ -245,7 +245,7 @@ func (sc *routeGroupSource) AddEventHandler(ctx context.Context, handler func()) // Endpoints returns endpoint objects for each host-target combination that should be processed. // Retrieves all routeGroup resources on all namespaces. // Logic is ported from ingress without fqdnTemplate -func (sc *routeGroupSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (sc *routeGroupSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { rgList, err := sc.cli.getRouteGroupList(sc.apiEndpoint) if err != nil { log.Errorf("Failed to get RouteGroup list: %v", err) diff --git a/source/routegroup_test.go b/source/routegroup_test.go index 69e78da592..b2f45eab73 100644 --- a/source/routegroup_test.go +++ b/source/routegroup_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "testing" "github.com/pkg/errors" @@ -716,7 +717,7 @@ func TestRouteGroupsEndpoints(t *testing.T) { tt.source.fqdnTemplate = tmpl } - got, err := tt.source.Endpoints() + got, err := tt.source.Endpoints(context.Background()) if err != nil && !tt.wantErr { t.Errorf("Got error, but does not want to get an error: %v", err) } @@ -750,7 +751,7 @@ func TestResourceLabelIsSet(t *testing.T) { }, } - got, _ := source.Endpoints() + got, _ := source.Endpoints(context.Background()) for _, ep := range got { if _, ok := ep.Labels[endpoint.ResourceLabelKey]; !ok { t.Errorf("Failed to set resource label on ep %v", ep) @@ -781,7 +782,7 @@ func TestDualstackLabelIsSet(t *testing.T) { }, } - got, _ := source.Endpoints() + got, _ := source.Endpoints(context.Background()) for _, ep := range got { if v, ok := ep.Labels[endpoint.DualstackLabelKey]; !ok || v != "true" { t.Errorf("Failed to set resource label on ep %v", ep) diff --git a/source/service.go b/source/service.go index 2c47dc7524..2b9389f504 100644 --- a/source/service.go +++ b/source/service.go @@ -157,7 +157,7 @@ func NewServiceSource(kubeClient kubernetes.Interface, namespace, annotationFilt } // Endpoints returns endpoint objects for each service that should be processed. -func (sc *serviceSource) Endpoints() ([]*endpoint.Endpoint, error) { +func (sc *serviceSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) { services, err := sc.serviceInformer.Lister().Services(sc.namespace).List(labels.Everything()) if err != nil { return nil, err diff --git a/source/service_test.go b/source/service_test.go index c5e0dd838d..13367463e0 100644 --- a/source/service_test.go +++ b/source/service_test.go @@ -17,6 +17,7 @@ limitations under the License. package source import ( + "context" "net" "testing" "time" @@ -75,13 +76,13 @@ func (suite *ServiceSuite) SetupTest() { suite.NoError(err, "should initialize service source") - _, err = fakeClient.CoreV1().Services(suite.fooWithTargets.Namespace).Create(suite.fooWithTargets) + _, err = fakeClient.CoreV1().Services(suite.fooWithTargets.Namespace).Create(context.Background(), suite.fooWithTargets, metav1.CreateOptions{}) suite.NoError(err, "should successfully create service") } func (suite *ServiceSuite) TestResourceLabelIsSet() { - endpoints, _ := suite.sc.Endpoints() + endpoints, _ := suite.sc.Endpoints(context.Background()) for _, ep := range endpoints { suite.Equal("service/default/foo-with-targets", ep.Labels[endpoint.ResourceLabelKey], "should set correct resource label") } @@ -1095,7 +1096,7 @@ func testServiceSourceEndpoints(t *testing.T) { }, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -1118,7 +1119,7 @@ func testServiceSourceEndpoints(t *testing.T) { // wait up to a few seconds for new resources to appear in informer cache. err = poll(time.Second, 3*time.Second, func() (bool, error) { - res, err = client.Endpoints() + res, err = client.Endpoints(context.Background()) if err != nil { // stop waiting if we get an error return true, err @@ -1266,7 +1267,7 @@ func TestClusterIpServices(t *testing.T) { }, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -1285,7 +1286,7 @@ func TestClusterIpServices(t *testing.T) { ) require.NoError(t, err) - endpoints, err := client.Endpoints() + endpoints, err := client.Endpoints(context.Background()) if tc.expectError { require.Error(t, err) } else { @@ -1551,7 +1552,7 @@ func TestNodePortServices(t *testing.T) { // Create the nodes for _, node := range tc.nodes { - if _, err := kubernetes.CoreV1().Nodes().Create(node); err != nil { + if _, err := kubernetes.CoreV1().Nodes().Create(context.Background(), node, metav1.CreateOptions{}); err != nil { t.Fatal(err) } } @@ -1575,7 +1576,7 @@ func TestNodePortServices(t *testing.T) { }, } - _, err := kubernetes.CoreV1().Pods(tc.svcNamespace).Create(pod) + _, err := kubernetes.CoreV1().Pods(tc.svcNamespace).Create(context.Background(), pod, metav1.CreateOptions{}) require.NoError(t, err) } @@ -1598,7 +1599,7 @@ func TestNodePortServices(t *testing.T) { }, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -1617,7 +1618,7 @@ func TestNodePortServices(t *testing.T) { ) require.NoError(t, err) - endpoints, err := client.Endpoints() + endpoints, err := client.Endpoints(context.Background()) if tc.expectError { require.Error(t, err) } else { @@ -1876,7 +1877,7 @@ func TestHeadlessServices(t *testing.T) { }, Status: v1.ServiceStatus{}, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) var addresses, notReadyAddresses []v1.EndpointAddress @@ -1897,7 +1898,7 @@ func TestHeadlessServices(t *testing.T) { }, } - _, err = kubernetes.CoreV1().Pods(tc.svcNamespace).Create(pod) + _, err = kubernetes.CoreV1().Pods(tc.svcNamespace).Create(context.Background(), pod, metav1.CreateOptions{}) require.NoError(t, err) address := v1.EndpointAddress{ @@ -1927,7 +1928,7 @@ func TestHeadlessServices(t *testing.T) { }, }, } - _, err = kubernetes.CoreV1().Endpoints(tc.svcNamespace).Create(endpointsObject) + _, err = kubernetes.CoreV1().Endpoints(tc.svcNamespace).Create(context.Background(), endpointsObject, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -1946,7 +1947,7 @@ func TestHeadlessServices(t *testing.T) { ) require.NoError(t, err) - endpoints, err := client.Endpoints() + endpoints, err := client.Endpoints(context.Background()) if tc.expectError { require.Error(t, err) } else { @@ -2177,7 +2178,7 @@ func TestHeadlessServicesHostIP(t *testing.T) { }, Status: v1.ServiceStatus{}, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) var addresses []v1.EndpointAddress @@ -2199,7 +2200,7 @@ func TestHeadlessServicesHostIP(t *testing.T) { }, } - _, err = kubernetes.CoreV1().Pods(tc.svcNamespace).Create(pod) + _, err = kubernetes.CoreV1().Pods(tc.svcNamespace).Create(context.Background(), pod, metav1.CreateOptions{}) require.NoError(t, err) address := v1.EndpointAddress{ @@ -2229,7 +2230,7 @@ func TestHeadlessServicesHostIP(t *testing.T) { }, }, } - _, err = kubernetes.CoreV1().Endpoints(tc.svcNamespace).Create(endpointsObject) + _, err = kubernetes.CoreV1().Endpoints(tc.svcNamespace).Create(context.Background(), endpointsObject, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -2248,7 +2249,7 @@ func TestHeadlessServicesHostIP(t *testing.T) { ) require.NoError(t, err) - endpoints, err := client.Endpoints() + endpoints, err := client.Endpoints(context.Background()) if tc.expectError { require.Error(t, err) } else { @@ -2334,7 +2335,7 @@ func TestExternalServices(t *testing.T) { }, Status: v1.ServiceStatus{}, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(t, err) // Create our object under test and get the endpoints. @@ -2353,7 +2354,7 @@ func TestExternalServices(t *testing.T) { ) require.NoError(t, err) - endpoints, err := client.Endpoints() + endpoints, err := client.Endpoints(context.Background()) if tc.expectError { require.Error(t, err) } else { @@ -2387,14 +2388,14 @@ func BenchmarkServiceEndpoints(b *testing.B) { }, } - _, err := kubernetes.CoreV1().Services(service.Namespace).Create(service) + _, err := kubernetes.CoreV1().Services(service.Namespace).Create(context.Background(), service, metav1.CreateOptions{}) require.NoError(b, err) client, err := NewServiceSource(kubernetes, v1.NamespaceAll, "", "", false, "", false, false, false, []string{}, false) require.NoError(b, err) for i := 0; i < b.N; i++ { - _, err := client.Endpoints() + _, err := client.Endpoints(context.Background()) require.NoError(b, err) } } diff --git a/source/source.go b/source/source.go index d8394ebfb1..a050d38323 100644 --- a/source/source.go +++ b/source/source.go @@ -62,7 +62,7 @@ const ( // Source defines the interface Endpoint sources should implement. type Source interface { - Endpoints() ([]*endpoint.Endpoint, error) + Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) // AddEventHandler adds an event handler that should be triggered if something in source changes AddEventHandler(context.Context, func()) } diff --git a/source/store.go b/source/store.go index 070ef97254..410cb224ac 100644 --- a/source/store.go +++ b/source/store.go @@ -212,6 +212,12 @@ func BuildWithConfig(source string, p ClientGenerator, cfg *Config) (Source, err return nil, err } return NewContourIngressRouteSource(dynamicClient, kubernetesClient, cfg.ContourLoadBalancerService, cfg.Namespace, cfg.AnnotationFilter, cfg.FQDNTemplate, cfg.CombineFQDNAndAnnotation, cfg.IgnoreHostnameAnnotation) + case "contour-httpproxy": + dynamicClient, err := p.DynamicKubernetesClient() + if err != nil { + return nil, err + } + return NewContourHTTPProxySource(dynamicClient, cfg.Namespace, cfg.AnnotationFilter, cfg.FQDNTemplate, cfg.CombineFQDNAndAnnotation, cfg.IgnoreHostnameAnnotation) case "openshift-route": ocpClient, err := p.OpenShiftClient() if err != nil { diff --git a/source/store_test.go b/source/store_test.go index 15652ddcd9..81360ac614 100644 --- a/source/store_test.go +++ b/source/store_test.go @@ -96,9 +96,9 @@ func (suite *ByNamesTestSuite) TestAllInitialized() { mockClientGenerator.On("IstioClient").Return(NewFakeConfigStore(), nil) mockClientGenerator.On("DynamicKubernetesClient").Return(fakeDynamic, nil) - sources, err := ByNames(mockClientGenerator, []string{"service", "ingress", "istio-gateway", "contour-ingressroute", "fake"}, minimalConfig) + sources, err := ByNames(mockClientGenerator, []string{"service", "ingress", "istio-gateway", "contour-ingressroute", "contour-httpproxy", "fake"}, minimalConfig) suite.NoError(err, "should not generate errors") - suite.Len(sources, 5, "should generate all five sources") + suite.Len(sources, 6, "should generate all five sources") } func (suite *ByNamesTestSuite) TestOnlyFake() { @@ -148,6 +148,8 @@ func (suite *ByNamesTestSuite) TestIstioClientFails() { _, err = ByNames(mockClientGenerator, []string{"contour-ingressroute"}, minimalConfig) suite.Error(err, "should return an error if contour client cannot be created") + _, err = ByNames(mockClientGenerator, []string{"contour-httpproxy"}, minimalConfig) + suite.Error(err, "should return an error if contour client cannot be created") } func TestByNames(t *testing.T) { diff --git a/source/unstructured_converter.go b/source/unstructured_converter.go new file mode 100644 index 0000000000..def5ce9c5b --- /dev/null +++ b/source/unstructured_converter.go @@ -0,0 +1,32 @@ +package source + +import ( + contour "github.com/projectcontour/contour/apis/contour/v1beta1" + projectcontour "github.com/projectcontour/contour/apis/projectcontour/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/kubernetes/scheme" +) + +// UnstructuredConverter handles conversions between unstructured.Unstructured and Contour types +type UnstructuredConverter struct { + // scheme holds an initializer for converting Unstructured to a type + scheme *runtime.Scheme +} + +// NewUnstructuredConverter returns a new UnstructuredConverter initialized +func NewUnstructuredConverter() (*UnstructuredConverter, error) { + uc := &UnstructuredConverter{ + scheme: runtime.NewScheme(), + } + + // Setup converter to understand custom CRD types + _ = contour.AddToScheme(uc.scheme) + _ = projectcontour.AddToScheme(uc.scheme) + + // Add the core types we need + if err := scheme.AddToScheme(uc.scheme); err != nil { + return nil, err + } + + return uc, nil +}