From e879ddb5be59efeb493e0f01e361cb058f91df3b Mon Sep 17 00:00:00 2001 From: Rafael Franzke Date: Wed, 29 Jan 2020 20:50:58 +0100 Subject: [PATCH] Fix build by vendoring calico extension --- .../provider-azure/pkg/webhook/network/add.go | 2 +- .../pkg/webhook/network/mutate.go | 4 +- go.mod | 10 +- go.sum | 7 + .../LICENSE.md | 288 ++++++++++++++++++ .../NOTICE.md | 15 + .../pkg/apis/calico/doc.go | 20 ++ .../pkg/apis/calico/install/install.go | 43 +++ .../pkg/apis/calico/register.go | 52 ++++ .../pkg/apis/calico/types_network.go | 111 +++++++ .../pkg/apis/calico/v1alpha1/defaults.go | 23 ++ .../pkg/apis/calico/v1alpha1/doc.go | 24 ++ .../pkg/apis/calico/v1alpha1/register.go | 55 ++++ .../pkg/apis/calico/v1alpha1/types_network.go | 123 ++++++++ .../v1alpha1/zz_generated.conversion.go | 205 +++++++++++++ .../calico/v1alpha1/zz_generated.deepcopy.go | 178 +++++++++++ .../calico/v1alpha1/zz_generated.defaults.go | 32 ++ .../pkg/apis/calico/zz_generated.deepcopy.go | 178 +++++++++++ .../pkg/calico/predicates.go | 17 ++ .../pkg/calico/types.go | 43 +++ .../pkg/charts/utils.go | 206 +++++++++++++ .../pkg/charts/values.go | 39 +++ .../pkg/controller/actuator.go | 74 +++++ .../pkg/controller/actuator_delete.go | 45 +++ .../pkg/controller/actuator_reconcile.go | 91 ++++++ .../pkg/controller/add.go | 60 ++++ .../pkg/controller/decode.go | 54 ++++ .../pkg/controller/status.go | 57 ++++ .../pkg/imagevector/imagevector.go | 96 ++++++ .../test/framework/gardenerframework.go | 3 + vendor/github.com/onsi/ginkgo/CHANGELOG.md | 26 ++ .../github.com/onsi/ginkgo/config/config.go | 10 +- .../onsi/ginkgo/ginkgo/bootstrap_command.go | 5 +- .../onsi/ginkgo/ginkgo/convert/import.go | 3 +- .../ginkgo/ginkgo/convert/package_rewriter.go | 1 - .../ginkgo/convert/testfile_rewriter.go | 2 - .../interrupthandler/interrupt_handler.go | 2 +- vendor/github.com/onsi/ginkgo/ginkgo/main.go | 12 +- .../onsi/ginkgo/ginkgo/suite_runner.go | 2 +- .../ginkgo/ginkgo/testrunner/test_runner.go | 6 +- .../onsi/ginkgo/ginkgo/watch/dependencies.go | 2 +- .../onsi/ginkgo/ginkgo/watch/package_hash.go | 2 +- vendor/github.com/onsi/ginkgo/ginkgo_dsl.go | 4 +- .../internal/codelocation/code_location.go | 20 +- .../ginkgo/internal/leafnodes/benchmarker.go | 2 +- .../onsi/ginkgo/internal/remote/aggregator.go | 12 +- .../onsi/ginkgo/internal/remote/server.go | 2 +- .../onsi/ginkgo/internal/spec/spec.go | 10 +- .../onsi/ginkgo/internal/spec/specs.go | 4 +- .../ginkgo/internal/specrunner/spec_runner.go | 2 +- .../onsi/ginkgo/reporters/default_reporter.go | 3 + .../onsi/ginkgo/reporters/junit_reporter.go | 25 +- .../ginkgo/reporters/teamcity_reporter.go | 9 +- vendor/github.com/onsi/ginkgo/types/types.go | 2 +- vendor/github.com/onsi/gomega/.travis.yml | 1 + vendor/github.com/onsi/gomega/CHANGELOG.md | 32 ++ .../github.com/onsi/gomega/format/format.go | 37 ++- vendor/github.com/onsi/gomega/gomega_dsl.go | 10 +- .../onsi/gomega/gstruct/elements.go | 2 + .../github.com/onsi/gomega/gstruct/fields.go | 2 + .../github.com/onsi/gomega/gstruct/ignore.go | 2 + vendor/github.com/onsi/gomega/gstruct/keys.go | 2 + .../github.com/onsi/gomega/gstruct/pointer.go | 2 + .../asyncassertion/async_assertion.go | 2 + vendor/github.com/onsi/gomega/matchers.go | 16 + .../matchers/assignable_to_type_of_matcher.go | 2 + .../onsi/gomega/matchers/be_a_directory.go | 2 + .../onsi/gomega/matchers/be_a_regular_file.go | 2 + .../gomega/matchers/be_an_existing_file.go | 2 + .../onsi/gomega/matchers/be_closed_matcher.go | 2 + .../gomega/matchers/be_element_of_matcher.go | 57 ++++ .../onsi/gomega/matchers/be_empty_matcher.go | 2 + .../matchers/be_equivalent_to_matcher.go | 2 + .../onsi/gomega/matchers/be_false_matcher.go | 2 + .../onsi/gomega/matchers/be_identical_to.go | 2 + .../onsi/gomega/matchers/be_nil_matcher.go | 2 + .../gomega/matchers/be_numerically_matcher.go | 2 + .../onsi/gomega/matchers/be_sent_matcher.go | 2 + .../gomega/matchers/be_temporally_matcher.go | 2 + .../onsi/gomega/matchers/be_true_matcher.go | 2 + .../onsi/gomega/matchers/consist_of.go | 2 + .../matchers/contain_element_matcher.go | 22 +- .../matchers/contain_substring_matcher.go | 2 + .../onsi/gomega/matchers/have_cap_matcher.go | 2 + .../onsi/gomega/matchers/have_key_matcher.go | 2 + .../matchers/have_key_with_value_matcher.go | 2 + .../gomega/matchers/have_occurred_matcher.go | 2 + .../onsi/gomega/matchers/receive_matcher.go | 2 + .../matchers/semi_structured_data_support.go | 2 + .../goraph/bipartitegraph/bipartitegraph.go | 3 +- .../onsi/gomega/matchers/type_support.go | 3 + vendor/modules.txt | 47 ++- 92 files changed, 2518 insertions(+), 89 deletions(-) create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/LICENSE.md create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/NOTICE.md create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/doc.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/install/install.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/register.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/types_network.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/defaults.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/doc.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/register.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/types_network.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.conversion.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.defaults.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/zz_generated.deepcopy.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/predicates.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/types.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/utils.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/values.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_delete.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_reconcile.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/add.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/decode.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/status.go create mode 100644 vendor/github.com/gardener/gardener-extension-networking-calico/pkg/imagevector/imagevector.go create mode 100644 vendor/github.com/onsi/gomega/matchers/be_element_of_matcher.go diff --git a/controllers/provider-azure/pkg/webhook/network/add.go b/controllers/provider-azure/pkg/webhook/network/add.go index e82cf35ae..477cad001 100644 --- a/controllers/provider-azure/pkg/webhook/network/add.go +++ b/controllers/provider-azure/pkg/webhook/network/add.go @@ -15,11 +15,11 @@ package network import ( - "github.com/gardener/gardener-extensions/controllers/networking-calico/pkg/calico" "github.com/gardener/gardener-extensions/controllers/provider-azure/pkg/azure" extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook" "github.com/gardener/gardener-extensions/pkg/webhook/network" + "github.com/gardener/gardener-extension-networking-calico/pkg/calico" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/controllers/provider-azure/pkg/webhook/network/mutate.go b/controllers/provider-azure/pkg/webhook/network/mutate.go index 20bb6ca99..cefc425ab 100644 --- a/controllers/provider-azure/pkg/webhook/network/mutate.go +++ b/controllers/provider-azure/pkg/webhook/network/mutate.go @@ -15,10 +15,10 @@ package network import ( - calicov1alpha1 "github.com/gardener/gardener-extensions/controllers/networking-calico/pkg/apis/calico/v1alpha1" - "github.com/gardener/gardener-extensions/controllers/networking-calico/pkg/controller" extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook" + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + "github.com/gardener/gardener-extension-networking-calico/pkg/controller" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/go.mod b/go.mod index 90c97fe61..6ef3cd9ac 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,9 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.60.340 github.com/aliyun/aliyun-oss-go-sdk v2.0.1+incompatible github.com/aws/aws-sdk-go v1.21.10 - github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f github.com/gardener/gardener v0.35.1-0.20200128130120-5b69a02f511a + github.com/gardener/gardener-extension-networking-calico v0.0.0-20200129184310-ca90704ba78e github.com/gardener/gardener-resource-manager v0.9.1-0.20200124091350-6ea41bbae81f github.com/gardener/machine-controller-manager v0.25.1-0.20200115123605-0510de7ddfca // master github.com/go-logr/logr v0.1.0 @@ -24,9 +24,8 @@ require ( github.com/gophercloud/gophercloud v0.7.0 github.com/gophercloud/utils v0.0.0-20190527093828-25f1b77b8c03 github.com/huandu/xstrings v1.3.0 - github.com/json-iterator/go v1.1.9 // indirect - github.com/onsi/ginkgo v1.8.0 - github.com/onsi/gomega v1.5.0 + github.com/onsi/ginkgo v1.10.1 + github.com/onsi/gomega v1.7.0 github.com/packethost/packngo v0.0.0-20181217122008-b3b45f1b4979 github.com/pkg/errors v0.8.1 github.com/sirupsen/logrus v1.4.2 @@ -36,9 +35,6 @@ require ( golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 gomodules.xyz/jsonpatch/v2 v2.0.1 google.golang.org/api v0.9.0 - google.golang.org/grpc v1.23.1 // indirect - gopkg.in/ini.v1 v1.51.1 // indirect - gopkg.in/yaml.v2 v2.2.7 k8s.io/api v0.0.0-20191010143144-fbf594f18f80 k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783 k8s.io/apimachinery v0.0.0-20191016060620-86f2f1b9c076 diff --git a/go.sum b/go.sum index 325cc3a39..5caae8dc9 100644 --- a/go.sum +++ b/go.sum @@ -139,6 +139,9 @@ github.com/gardener/external-dns-management v0.0.0-20190927090840-6659f5a46d13 h github.com/gardener/external-dns-management v0.0.0-20190927090840-6659f5a46d13/go.mod h1:Y3om11E865x4aQ7cmcHjknb8RMgCO153huRb/SvP+9o= github.com/gardener/gardener v0.35.1-0.20200128130120-5b69a02f511a h1:rLj4qh4PWFtlGo4PWjC4Mbovp9tQZjcHDoRrNcSdHK4= github.com/gardener/gardener v0.35.1-0.20200128130120-5b69a02f511a/go.mod h1:cu4WkHhpM9JLvqx76qSViagsPO4UH9Qx5i0h3AEIdiE= +github.com/gardener/gardener-extension-networking-calico v0.0.0-20200129184310-ca90704ba78e h1:qoYA1gs9+Sv1C8N9IMp9S/fa9fEaHfLYffrFX/f+2Vo= +github.com/gardener/gardener-extension-networking-calico v0.0.0-20200129184310-ca90704ba78e/go.mod h1:IY4O46FVVDcmmlTwTP8keIiD5G+4HRm+oMhKQ64Mdv4= +github.com/gardener/gardener-extensions v1.2.1-0.20200129183102-afdd6bad562a/go.mod h1:qJHM2NaRCdCBKjnvWXpixWBq1866kqZR76kA7edk8I4= github.com/gardener/gardener-resource-manager v0.9.1-0.20200124091350-6ea41bbae81f h1:kaJJ2j6/uHTt6tDQiDO25HOq6Uit6Hu31hu47HfY/Lw= github.com/gardener/gardener-resource-manager v0.9.1-0.20200124091350-6ea41bbae81f/go.mod h1:0pKTHOhvU91eQB0EYr/6Ymd7lXc/5Hi8P8tF/gpV0VQ= github.com/gardener/hvpa-controller v0.0.0-20191014062307-fad3bdf06a25 h1:nOFITmV7vt4fcYPEXgj66Qs83FdDEMvL/LQcR0diRRE= @@ -398,11 +401,15 @@ github.com/onsi/ginkgo v1.4.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 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/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.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 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/packethost/packngo v0.0.0-20181217122008-b3b45f1b4979 h1:Ts8y7YbUMuHPAerXDOpnZWr7TeV2b3oTzKa6rP0erow= github.com/packethost/packngo v0.0.0-20181217122008-b3b45f1b4979/go.mod h1:otzZQXgoO96RTzDB/Hycg0qZcXZsWJGJRSXbmEIJ+4M= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/LICENSE.md b/vendor/github.com/gardener/gardener-extension-networking-calico/LICENSE.md new file mode 100644 index 000000000..065c1271e --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/LICENSE.md @@ -0,0 +1,288 @@ +``` + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. +``` + +## APIs + +This project may include APIs to SAP or third party products or services. The use of these APIs, products and services may be subject to additional agreements. In no event shall the application of the Apache Software License, v.2 to this project grant any rights in or to these APIs, products or services that would alter, expand, be inconsistent with, or supersede any terms of these additional agreements. API means application programming interfaces, as well as their respective specifications and implementing code that allows other software products to communicate with or call on SAP or third party products or services (for example, SAP Enterprise Services, BAPIs, Idocs, RFCs and ABAP calls or other user exits) and may be made available through SAP or third party products, SDKs, documentation or other media. + +## Subcomponents + +This project includes the following subcomponents that are subject to separate license terms. +Your use of these subcomponents is subject to the separate license terms applicable to +each subcomponent. + +Gardener. +https://github.com/gardener/gardener. +Copyright (c) 2019 SAP SE or an SAP affiliate company. +Apache 2 license (https://github.com/gardener/gardener/blob/master/LICENSE.md). + +controller-runtime. +https://sigs.k8s.io/controller-runtime. +Copyright 2019 The Kubernetes Authors. +Apache 2 license (https://sigs.k8s.io/controller-runtime/LICENSE). + +API. +https://git.k8s.io/api. +Copyright 2019 The Kubernetes Authors. +Apache 2 license (https://git.k8s.io/api/LICENSE). + +APIMachinery. +https://git.k8s.io/apimachinery. +Copyright 2019 The Kubernetes Authors. +Apache 2 license (https://git.k8s.io/apimachinery/LICENSE). + +Client-Go. +https://git.k8s.io/client-go. +Copyright 2017 The Kubernetes Authors. +Apache 2 license (https://git.k8s.io/client-go/LICENSE). + +YAML marshaling and unmarshalling support for Go. +gopkg.in/yaml.v2. +Copyright 2011-2016 Canonical Ltd. +Apache 2 license (https://github.com/go-yaml/yaml/blob/v2/LICENSE) + +Packr. +https://github.com/gobuffalo/packr +Copyright (c) 2016 Mark Bates. +MIT license (https://github.com/gobuffalo/packr/blob/master/LICENSE.txt) + +Cobra. +https://github.com/spf13/cobra +Copyright 2019 Steve Francia. +Apache 2 license (https://github.com/spf13/cobra/blob/master/LICENSE.txt) + +Ginkgo. +https://github.com/onsi/ginkgo. +Copyright (c) 2013-2014 Onsi Fakhouri. +MIT license (https://github.com/onsi/ginkgo/blob/master/LICENSE) + +Gomega. +github.com/onsi/gomega. +Copyright (c) 2013-2014 Onsi Fakhouri. +MIT license (https://github.com/onsi/gomega/blob/master/LICENSE) + +------ +## MIT License + + The MIT License (MIT) + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/NOTICE.md b/vendor/github.com/gardener/gardener-extension-networking-calico/NOTICE.md new file mode 100644 index 000000000..4bbe7e82f --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/NOTICE.md @@ -0,0 +1,15 @@ +## Gardener Extensions +Copyright (c) 2017-2019 SAP SE or an SAP affiliate company. All rights reserved. + +## Seed Source + +The source code of this component was seeded based on a copy of the following files from [github.com/kubernetes-sigs](github.com/kubernetes-sigs): + +controller-runtime. +https://sigs.k8s.io/controller-runtime. +Copyright 2018 The Kubernetes Authors. +Apache 2 license (https://sigs.k8s.io/controller-runtime/LICENSE). + +Version: 0.1.9. +Commit-ID: f6f0bc9611363b43664d08fb097ab13243ef621d +Commit-Message: Merge pull request #263 from DirectXMan12/release/v0.1.9 diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/doc.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/doc.go new file mode 100644 index 000000000..fa789b81b --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/doc.go @@ -0,0 +1,20 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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. + +// +k8s:deepcopy-gen=package +// +groupName="calico.networking.extensions.gardener.cloud" + +//go:generate ../../../hack/generate-code + +package calico // import "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico" diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/install/install.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/install/install.go new file mode 100644 index 000000000..eb05e8b5b --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/install/install.go @@ -0,0 +1,43 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 install + +import ( + "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico" + "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var ( + schemeBuilder = runtime.NewSchemeBuilder( + v1alpha1.AddToScheme, + calico.AddToScheme, + setVersionPriority, + ) + + // AddToScheme adds all APIs to the scheme. + AddToScheme = schemeBuilder.AddToScheme +) + +func setVersionPriority(scheme *runtime.Scheme) error { + return scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion) +} + +// Install installs all APIs in the scheme. +func Install(scheme *runtime.Scheme) { + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/register.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/register.go new file mode 100644 index 000000000..79ddaaff4 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/register.go @@ -0,0 +1,52 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 calico + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "calico.networking.extensions.gardener.cloud" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder used to register the Shoot resource. + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a pointer to SchemeBuilder.AddToScheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &NetworkConfig{}, + &NetworkStatus{}, + ) + return nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/types_network.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/types_network.go new file mode 100644 index 000000000..6b8dc996d --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/types_network.go @@ -0,0 +1,111 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 calico + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Backend string + +const ( + Bird Backend = "bird" + None Backend = "none" + VXLan Backend = "vxlan" +) + +type IPv4PoolMode string + +const ( + Always IPv4PoolMode = "Always" + Never IPv4PoolMode = "Never" + CrossSubnet IPv4PoolMode = "CrossSubnet" + Off IPv4PoolMode = "Off" +) + +type CIDR string + +type IPv4Pool string + +const ( + PoolIPIP IPv4Pool = "ipip" + PoolVXLan IPv4Pool = "vxlan" +) + +// IPv4 contains configuration for calico ipv4 specific settings +type IPv4 struct { + // Pool configures the type of ip pool for the tunnel interface. + // https://docs.projectcalico.org/v3.8/reference/node/configuration#environment-variables + Pool *IPv4Pool + // Mode is the mode for the IPv4 Pool (e.g. Always, Never, CrossSubnet) + // ipip pools accept all pool mode values values + // vxlan pools accept only Always and Never (unchecked) + Mode *IPv4PoolMode + // AutoDetectionMethod is the method to use to autodetect the IPv4 address for this host. This is only used when the IPv4 address is being autodetected. + // https://docs.projectcalico.org/v3.8/reference/node/configuration#ip-autodetection-methods + AutoDetectionMethod *string +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NetworkConfig configuration for the calico networking plugin +type NetworkConfig struct { + metav1.TypeMeta + // Backend defines whether a backend should be used or not (e.g., bird or none) + Backend *Backend + // IPAM to use for the Calico Plugin (e.g., host-local or Calico) + IPAM *IPAM + // IPv4 contains configuration for calico ipv4 specific settings + IPv4 *IPv4 + // Typha settings to use for calico-typha component + Typha *Typha + // VethMTU settings used to configure calico port mtu + VethMTU *string + + // DEPRECATED. + // IPIP is the IPIP Mode for the IPv4 Pool (e.g. Always, Never, CrossSubnet) + // It was moved into the IPv4 struct, kept for backwards compatibility. + // Will be removed in a future Gardener release. + IPIP *IPv4PoolMode + // DEPRECATED. + // IPAutoDetectionMethod is the method to use to autodetect the IPv4 address for this host. This is only used when the IPv4 address is being autodetected. + // It was moved into the IPv4 struct, kept for backwards compatibility. + // Will be removed in a future Gardener release. + IPAutoDetectionMethod *string +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NetworkStatus contains information about created Network resources. +type NetworkStatus struct { + metav1.TypeMeta +} + +// IPAM defines the block that configuration for the ip assignment plugin to be used +type IPAM struct { + // Type defines the IPAM plugin type + Type string + // CIDR defines the CIDR block to be used + CIDR *CIDR +} + +// Typha defines the block with configurations for calico typha +type Typha struct { + // Enabled is used to define whether calico-typha is required or not. + // Note, typha is used to offload kubernetes API server, + // thus consider not to disable it for large clusters in terms of node count. + // More info can be found here https://docs.projectcalico.org/v3.9/reference/typha/ + Enabled bool +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/defaults.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/defaults.go new file mode 100644 index 000000000..8b665d270 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/defaults.go @@ -0,0 +1,23 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime" +) + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + return RegisterDefaults(scheme) +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/doc.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/doc.go new file mode 100644 index 000000000..692856993 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/doc.go @@ -0,0 +1,24 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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. + +// +k8s:deepcopy-gen=package +// +k8s:conversion-gen=github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico +// +k8s:openapi-gen=true +// +k8s:defaulter-gen=TypeMeta + +//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../../hack/api-reference/calico.json -template-dir ../../../../vendor/github.com/gardener/gardener-extensions/hack/api-reference/template -out-file ../../../../hack/api-reference/calico.md + +// Package v1alpha1 contains the configuration of the Calico Network Extension. +// +groupName=calico.networking.extensions.gardener.cloud +package v1alpha1 // import "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/register.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/register.go new file mode 100644 index 000000000..c7e3004b6 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/register.go @@ -0,0 +1,55 @@ +// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "calico.networking.extensions.gardener.cloud" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder used to register the Shoot resource. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // AddToScheme is a pointer to SchemeBuilder.AddToScheme. + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addDefaultingFuncs, addKnownTypes) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &NetworkConfig{}, + &NetworkStatus{}, + ) + return nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/types_network.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/types_network.go new file mode 100644 index 000000000..5509ddcf4 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/types_network.go @@ -0,0 +1,123 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Backend string + +const ( + Bird Backend = "bird" + None Backend = "none" + VXLan Backend = "vxlan" +) + +type IPv4PoolMode string + +const ( + Always IPv4PoolMode = "Always" + Never IPv4PoolMode = "Never" + CrossSubnet IPv4PoolMode = "CrossSubnet" + Off IPv4PoolMode = "Off" +) + +type CIDR string + +type IPv4Pool string + +const ( + PoolIPIP IPv4Pool = "ipip" + PoolVXLan IPv4Pool = "vxlan" +) + +// IPv4 contains configuration for calico ipv4 specific settings +type IPv4 struct { + // Pool configures the type of ip pool for the tunnel interface + // https://docs.projectcalico.org/v3.8/reference/node/configuration#environment-variables + // +optional + Pool *IPv4Pool `json:"pool,omitempty"` + // Mode is the mode for the IPv4 Pool (e.g. Always, Never, CrossSubnet) + // ipip pools accept all pool mode values values + // vxlan pools accept only Always and Never (unchecked) + // +optional + Mode *IPv4PoolMode `json:"mode,omitempty"` + // AutoDetectionMethod is the method to use to autodetect the IPv4 address for this host. This is only used when the IPv4 address is being autodetected. + // https://docs.projectcalico.org/v3.8/reference/node/configuration#ip-autodetection-methods + // +optional + AutoDetectionMethod *string `json:"autoDetectionMethod,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NetworkConfig configuration for the calico networking plugin +type NetworkConfig struct { + metav1.TypeMeta `json:",inline"` + // Backend defines whether a backend should be used or not (e.g., bird or none) + // +optional + Backend *Backend `json:"backend"` + // IPAM to use for the Calico Plugin (e.g., host-local or Calico) + // +optional + IPAM *IPAM `json:"ipam,omitempty"` + // IPv4 contains configuration for calico ipv4 specific settings + // +optional + IPv4 *IPv4 `json:"ipv4,omitempty"` + // Typha settings to use for calico-typha component + // +optional + Typha *Typha `json:"typha,omitempty"` + // VethMTU settings used to configure calico port mtu + // +optional + VethMTU *string `json:"vethMTU,omitempty"` + + // DEPRECATED. + // IPIP is the IPIP Mode for the IPv4 Pool (e.g. Always, Never, CrossSubnet) + // It was moved into the IPv4 struct, kept for backwards compatibility. + // Will be removed in a future Gardener release. + // +optional + IPIP *IPv4PoolMode `json:"ipip,omitempty"` + // DEPRECATED. + // IPAutoDetectionMethod is the method to use to autodetect the IPv4 address for this host. This is only used when the IPv4 address is being autodetected. + // It was moved into the IPv4 struct, kept for backwards compatibility. + // Will be removed in a future Gardener release. + // +optional + IPAutoDetectionMethod *string `json:"ipAutodetectionMethod,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NetworkStatus contains information about created Network resources. +type NetworkStatus struct { + metav1.TypeMeta `json:",inline"` +} + +// IPAM defines the block that configuration for the ip assignment plugin to be used +type IPAM struct { + // Type defines the IPAM plugin type + Type string `json:"type"` + // CIDR defines the CIDR block to be used + // +optional + CIDR *CIDR `json:"cidr,omitempty"` +} + +// Typha defines the block with configurations for calico typha +type Typha struct { + // Enabled is used to define whether calico-typha is required or not. + // Note, typha is used to offload kubernetes API server, + // thus consider not to disable it for large clusters in terms of node count. + // More info can be found here https://docs.projectcalico.org/v3.9/reference/typha/ + Enabled bool `json:"enabled"` +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.conversion.go new file mode 100644 index 000000000..27e2b410d --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.conversion.go @@ -0,0 +1,205 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + unsafe "unsafe" + + calico "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*IPAM)(nil), (*calico.IPAM)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_IPAM_To_calico_IPAM(a.(*IPAM), b.(*calico.IPAM), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*calico.IPAM)(nil), (*IPAM)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_calico_IPAM_To_v1alpha1_IPAM(a.(*calico.IPAM), b.(*IPAM), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IPv4)(nil), (*calico.IPv4)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_IPv4_To_calico_IPv4(a.(*IPv4), b.(*calico.IPv4), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*calico.IPv4)(nil), (*IPv4)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_calico_IPv4_To_v1alpha1_IPv4(a.(*calico.IPv4), b.(*IPv4), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkConfig)(nil), (*calico.NetworkConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_NetworkConfig_To_calico_NetworkConfig(a.(*NetworkConfig), b.(*calico.NetworkConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*calico.NetworkConfig)(nil), (*NetworkConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_calico_NetworkConfig_To_v1alpha1_NetworkConfig(a.(*calico.NetworkConfig), b.(*NetworkConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*calico.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_NetworkStatus_To_calico_NetworkStatus(a.(*NetworkStatus), b.(*calico.NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*calico.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_calico_NetworkStatus_To_v1alpha1_NetworkStatus(a.(*calico.NetworkStatus), b.(*NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Typha)(nil), (*calico.Typha)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Typha_To_calico_Typha(a.(*Typha), b.(*calico.Typha), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*calico.Typha)(nil), (*Typha)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_calico_Typha_To_v1alpha1_Typha(a.(*calico.Typha), b.(*Typha), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha1_IPAM_To_calico_IPAM(in *IPAM, out *calico.IPAM, s conversion.Scope) error { + out.Type = in.Type + out.CIDR = (*calico.CIDR)(unsafe.Pointer(in.CIDR)) + return nil +} + +// Convert_v1alpha1_IPAM_To_calico_IPAM is an autogenerated conversion function. +func Convert_v1alpha1_IPAM_To_calico_IPAM(in *IPAM, out *calico.IPAM, s conversion.Scope) error { + return autoConvert_v1alpha1_IPAM_To_calico_IPAM(in, out, s) +} + +func autoConvert_calico_IPAM_To_v1alpha1_IPAM(in *calico.IPAM, out *IPAM, s conversion.Scope) error { + out.Type = in.Type + out.CIDR = (*CIDR)(unsafe.Pointer(in.CIDR)) + return nil +} + +// Convert_calico_IPAM_To_v1alpha1_IPAM is an autogenerated conversion function. +func Convert_calico_IPAM_To_v1alpha1_IPAM(in *calico.IPAM, out *IPAM, s conversion.Scope) error { + return autoConvert_calico_IPAM_To_v1alpha1_IPAM(in, out, s) +} + +func autoConvert_v1alpha1_IPv4_To_calico_IPv4(in *IPv4, out *calico.IPv4, s conversion.Scope) error { + out.Pool = (*calico.IPv4Pool)(unsafe.Pointer(in.Pool)) + out.Mode = (*calico.IPv4PoolMode)(unsafe.Pointer(in.Mode)) + out.AutoDetectionMethod = (*string)(unsafe.Pointer(in.AutoDetectionMethod)) + return nil +} + +// Convert_v1alpha1_IPv4_To_calico_IPv4 is an autogenerated conversion function. +func Convert_v1alpha1_IPv4_To_calico_IPv4(in *IPv4, out *calico.IPv4, s conversion.Scope) error { + return autoConvert_v1alpha1_IPv4_To_calico_IPv4(in, out, s) +} + +func autoConvert_calico_IPv4_To_v1alpha1_IPv4(in *calico.IPv4, out *IPv4, s conversion.Scope) error { + out.Pool = (*IPv4Pool)(unsafe.Pointer(in.Pool)) + out.Mode = (*IPv4PoolMode)(unsafe.Pointer(in.Mode)) + out.AutoDetectionMethod = (*string)(unsafe.Pointer(in.AutoDetectionMethod)) + return nil +} + +// Convert_calico_IPv4_To_v1alpha1_IPv4 is an autogenerated conversion function. +func Convert_calico_IPv4_To_v1alpha1_IPv4(in *calico.IPv4, out *IPv4, s conversion.Scope) error { + return autoConvert_calico_IPv4_To_v1alpha1_IPv4(in, out, s) +} + +func autoConvert_v1alpha1_NetworkConfig_To_calico_NetworkConfig(in *NetworkConfig, out *calico.NetworkConfig, s conversion.Scope) error { + out.Backend = (*calico.Backend)(unsafe.Pointer(in.Backend)) + out.IPAM = (*calico.IPAM)(unsafe.Pointer(in.IPAM)) + out.IPv4 = (*calico.IPv4)(unsafe.Pointer(in.IPv4)) + out.Typha = (*calico.Typha)(unsafe.Pointer(in.Typha)) + out.VethMTU = (*string)(unsafe.Pointer(in.VethMTU)) + out.IPIP = (*calico.IPv4PoolMode)(unsafe.Pointer(in.IPIP)) + out.IPAutoDetectionMethod = (*string)(unsafe.Pointer(in.IPAutoDetectionMethod)) + return nil +} + +// Convert_v1alpha1_NetworkConfig_To_calico_NetworkConfig is an autogenerated conversion function. +func Convert_v1alpha1_NetworkConfig_To_calico_NetworkConfig(in *NetworkConfig, out *calico.NetworkConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_NetworkConfig_To_calico_NetworkConfig(in, out, s) +} + +func autoConvert_calico_NetworkConfig_To_v1alpha1_NetworkConfig(in *calico.NetworkConfig, out *NetworkConfig, s conversion.Scope) error { + out.Backend = (*Backend)(unsafe.Pointer(in.Backend)) + out.IPAM = (*IPAM)(unsafe.Pointer(in.IPAM)) + out.IPv4 = (*IPv4)(unsafe.Pointer(in.IPv4)) + out.Typha = (*Typha)(unsafe.Pointer(in.Typha)) + out.VethMTU = (*string)(unsafe.Pointer(in.VethMTU)) + out.IPIP = (*IPv4PoolMode)(unsafe.Pointer(in.IPIP)) + out.IPAutoDetectionMethod = (*string)(unsafe.Pointer(in.IPAutoDetectionMethod)) + return nil +} + +// Convert_calico_NetworkConfig_To_v1alpha1_NetworkConfig is an autogenerated conversion function. +func Convert_calico_NetworkConfig_To_v1alpha1_NetworkConfig(in *calico.NetworkConfig, out *NetworkConfig, s conversion.Scope) error { + return autoConvert_calico_NetworkConfig_To_v1alpha1_NetworkConfig(in, out, s) +} + +func autoConvert_v1alpha1_NetworkStatus_To_calico_NetworkStatus(in *NetworkStatus, out *calico.NetworkStatus, s conversion.Scope) error { + return nil +} + +// Convert_v1alpha1_NetworkStatus_To_calico_NetworkStatus is an autogenerated conversion function. +func Convert_v1alpha1_NetworkStatus_To_calico_NetworkStatus(in *NetworkStatus, out *calico.NetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_NetworkStatus_To_calico_NetworkStatus(in, out, s) +} + +func autoConvert_calico_NetworkStatus_To_v1alpha1_NetworkStatus(in *calico.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + return nil +} + +// Convert_calico_NetworkStatus_To_v1alpha1_NetworkStatus is an autogenerated conversion function. +func Convert_calico_NetworkStatus_To_v1alpha1_NetworkStatus(in *calico.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + return autoConvert_calico_NetworkStatus_To_v1alpha1_NetworkStatus(in, out, s) +} + +func autoConvert_v1alpha1_Typha_To_calico_Typha(in *Typha, out *calico.Typha, s conversion.Scope) error { + out.Enabled = in.Enabled + return nil +} + +// Convert_v1alpha1_Typha_To_calico_Typha is an autogenerated conversion function. +func Convert_v1alpha1_Typha_To_calico_Typha(in *Typha, out *calico.Typha, s conversion.Scope) error { + return autoConvert_v1alpha1_Typha_To_calico_Typha(in, out, s) +} + +func autoConvert_calico_Typha_To_v1alpha1_Typha(in *calico.Typha, out *Typha, s conversion.Scope) error { + out.Enabled = in.Enabled + return nil +} + +// Convert_calico_Typha_To_v1alpha1_Typha is an autogenerated conversion function. +func Convert_calico_Typha_To_v1alpha1_Typha(in *calico.Typha, out *Typha, s conversion.Scope) error { + return autoConvert_calico_Typha_To_v1alpha1_Typha(in, out, s) +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..3bf8c1f91 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,178 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAM) DeepCopyInto(out *IPAM) { + *out = *in + if in.CIDR != nil { + in, out := &in.CIDR, &out.CIDR + *out = new(CIDR) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAM. +func (in *IPAM) DeepCopy() *IPAM { + if in == nil { + return nil + } + out := new(IPAM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPv4) DeepCopyInto(out *IPv4) { + *out = *in + if in.Pool != nil { + in, out := &in.Pool, &out.Pool + *out = new(IPv4Pool) + **out = **in + } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(IPv4PoolMode) + **out = **in + } + if in.AutoDetectionMethod != nil { + in, out := &in.AutoDetectionMethod, &out.AutoDetectionMethod + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPv4. +func (in *IPv4) DeepCopy() *IPv4 { + if in == nil { + return nil + } + out := new(IPv4) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Backend != nil { + in, out := &in.Backend, &out.Backend + *out = new(Backend) + **out = **in + } + if in.IPAM != nil { + in, out := &in.IPAM, &out.IPAM + *out = new(IPAM) + (*in).DeepCopyInto(*out) + } + if in.IPv4 != nil { + in, out := &in.IPv4, &out.IPv4 + *out = new(IPv4) + (*in).DeepCopyInto(*out) + } + if in.Typha != nil { + in, out := &in.Typha, &out.Typha + *out = new(Typha) + **out = **in + } + if in.VethMTU != nil { + in, out := &in.VethMTU, &out.VethMTU + *out = new(string) + **out = **in + } + if in.IPIP != nil { + in, out := &in.IPIP, &out.IPIP + *out = new(IPv4PoolMode) + **out = **in + } + if in.IPAutoDetectionMethod != nil { + in, out := &in.IPAutoDetectionMethod, &out.IPAutoDetectionMethod + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfig. +func (in *NetworkConfig) DeepCopy() *NetworkConfig { + if in == nil { + return nil + } + out := new(NetworkConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Typha) DeepCopyInto(out *Typha) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Typha. +func (in *Typha) DeepCopy() *Typha { + if in == nil { + return nil + } + out := new(Typha) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.defaults.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.defaults.go new file mode 100644 index 000000000..5db2b64b0 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/zz_generated.deepcopy.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/zz_generated.deepcopy.go new file mode 100644 index 000000000..807462d9e --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/zz_generated.deepcopy.go @@ -0,0 +1,178 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package calico + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAM) DeepCopyInto(out *IPAM) { + *out = *in + if in.CIDR != nil { + in, out := &in.CIDR, &out.CIDR + *out = new(CIDR) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAM. +func (in *IPAM) DeepCopy() *IPAM { + if in == nil { + return nil + } + out := new(IPAM) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPv4) DeepCopyInto(out *IPv4) { + *out = *in + if in.Pool != nil { + in, out := &in.Pool, &out.Pool + *out = new(IPv4Pool) + **out = **in + } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(IPv4PoolMode) + **out = **in + } + if in.AutoDetectionMethod != nil { + in, out := &in.AutoDetectionMethod, &out.AutoDetectionMethod + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPv4. +func (in *IPv4) DeepCopy() *IPv4 { + if in == nil { + return nil + } + out := new(IPv4) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Backend != nil { + in, out := &in.Backend, &out.Backend + *out = new(Backend) + **out = **in + } + if in.IPAM != nil { + in, out := &in.IPAM, &out.IPAM + *out = new(IPAM) + (*in).DeepCopyInto(*out) + } + if in.IPv4 != nil { + in, out := &in.IPv4, &out.IPv4 + *out = new(IPv4) + (*in).DeepCopyInto(*out) + } + if in.Typha != nil { + in, out := &in.Typha, &out.Typha + *out = new(Typha) + **out = **in + } + if in.VethMTU != nil { + in, out := &in.VethMTU, &out.VethMTU + *out = new(string) + **out = **in + } + if in.IPIP != nil { + in, out := &in.IPIP, &out.IPIP + *out = new(IPv4PoolMode) + **out = **in + } + if in.IPAutoDetectionMethod != nil { + in, out := &in.IPAutoDetectionMethod, &out.IPAutoDetectionMethod + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfig. +func (in *NetworkConfig) DeepCopy() *NetworkConfig { + if in == nil { + return nil + } + out := new(NetworkConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + out.TypeMeta = in.TypeMeta + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkStatus) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Typha) DeepCopyInto(out *Typha) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Typha. +func (in *Typha) DeepCopy() *Typha { + if in == nil { + return nil + } + out := new(Typha) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/predicates.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/predicates.go new file mode 100644 index 000000000..f9800f89c --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/predicates.go @@ -0,0 +1,17 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 calico + +const Type = "calico" diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/types.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/types.go new file mode 100644 index 000000000..c6123fe06 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/calico/types.go @@ -0,0 +1,43 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 calico + +import "path/filepath" + +const ( + Name = "networking-calico" + + // ImageNames + CNIImageName = "calico-cni" + NodeImageName = "calico-node" + KubeControllersImageName = "calico-kube-controllers" + PodToDaemonFlexVolumeDriverImageName = "calico-podtodaemon-flex" + TyphaImageName = "calico-typha" + TyphaClusterProportionalAutoscalerImageName = "typha-cpa" + TyphaClusterProportionalVerticalAutoscalerImageName = "typha-cpva" + + // ReleaseName is the name of the Calico Release + ReleaseName = "calico" +) + +var ( + // ChartsPath is the path to the charts + ChartsPath = filepath.Join("charts") + // InternalChartsPath is the path to the internal charts + InternalChartsPath = filepath.Join(ChartsPath, "internal") + + // ChartPath path for internal Calico Chart + ChartPath = filepath.Join(InternalChartsPath, "calico") +) diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/utils.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/utils.go new file mode 100644 index 000000000..30e97c896 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/utils.go @@ -0,0 +1,206 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 charts + +import ( + "encoding/json" + "fmt" + + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + "github.com/gardener/gardener-extension-networking-calico/pkg/calico" + "github.com/gardener/gardener-extension-networking-calico/pkg/imagevector" + + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" +) + +const ( + hostLocal = "host-local" + usePodCIDR = "usePodCidr" + defaultMTU = "1440" +) + +type calicoConfig struct { + Backend calicov1alpha1.Backend `json:"backend"` + Felix felix `json:"felix"` + IPv4 ipv4 `json:"ipv4"` + IPAM ipam `json:"ipam"` + Typha typha `json:"typha"` + VethMTU string `json:"veth_mtu"` +} + +type felix struct { + IPInIP felixIPinIP `json:"ipinip"` +} + +type felixIPinIP struct { + Enabled bool `json:"enabled"` +} + +type ipv4 struct { + Pool calicov1alpha1.IPv4Pool `json:"pool"` + Mode calicov1alpha1.IPv4PoolMode `json:"mode"` + AutoDetectionMethod *string `json:"autoDetectionMethod"` +} + +type ipam struct { + IPAMType string `json:"type"` + Subnet string `json:"subnet"` +} + +type typha struct { + Enabled bool `json:"enabled"` +} + +var defaultCalicoConfig = calicoConfig{ + Backend: calicov1alpha1.Bird, + Felix: felix{ + IPInIP: felixIPinIP{ + Enabled: true, + }, + }, + IPv4: ipv4{ + Pool: calicov1alpha1.PoolIPIP, + Mode: calicov1alpha1.Always, + AutoDetectionMethod: nil, + }, + IPAM: ipam{ + IPAMType: hostLocal, + Subnet: usePodCIDR, + }, + Typha: typha{ + Enabled: true, + }, + VethMTU: defaultMTU, +} + +func newCalicoConfig() calicoConfig { + return defaultCalicoConfig +} + +func (c *calicoConfig) toMap() (map[string]interface{}, error) { + bytes, err := json.Marshal(c) + if err != nil { + return nil, fmt.Errorf("could not marshal calico config: %v", err) + } + var configMap map[string]interface{} + err = json.Unmarshal(bytes, &configMap) + if err != nil { + return nil, fmt.Errorf("could not unmarshal calico config: %v", err) + } + return configMap, nil +} + +// ComputeCalicoChartValues computes the values for the calico chart. +func ComputeCalicoChartValues(network *extensionsv1alpha1.Network, config *calicov1alpha1.NetworkConfig) (map[string]interface{}, error) { + typedConfig, err := generateChartValues(config) + if err != nil { + return nil, fmt.Errorf("error when generating calico config: %v", err) + } + calicoConfig, err := typedConfig.toMap() + if err != nil { + return nil, fmt.Errorf("could not convert calico config: %v", err) + } + calicoChartValues := map[string]interface{}{ + "images": map[string]interface{}{ + calico.CNIImageName: imagevector.CalicoCNIImage(), + calico.TyphaImageName: imagevector.CalicoTyphaImage(), + calico.KubeControllersImageName: imagevector.CalicoKubeControllersImage(), + calico.NodeImageName: imagevector.CalicoNodeImage(), + calico.PodToDaemonFlexVolumeDriverImageName: imagevector.CalicoFlexVolumeDriverImage(), + calico.TyphaClusterProportionalAutoscalerImageName: imagevector.TyphaClusterProportionalAutoscalerImage(), + calico.TyphaClusterProportionalVerticalAutoscalerImageName: imagevector.TyphaClusterProportionalVerticalAutoscalerImage(), + }, + "global": map[string]string{ + "podCIDR": network.Spec.PodCIDR, + }, + "config": calicoConfig, + } + return calicoChartValues, nil +} + +func generateChartValues(config *calicov1alpha1.NetworkConfig) (*calicoConfig, error) { + c := newCalicoConfig() + if config == nil { + return &c, nil + } + + if config.Backend != nil { + switch *config.Backend { + case calicov1alpha1.Bird, calicov1alpha1.VXLan, calicov1alpha1.None: + c.Backend = *config.Backend + default: + return nil, fmt.Errorf("unsupported value for backend: %s", *config.Backend) + } + } + if c.Backend == calicov1alpha1.None { + c.Felix.IPInIP.Enabled = false + c.IPv4.Mode = calicov1alpha1.Never + } + + if config.IPAM != nil { + if config.IPAM.Type != "" { + c.IPAM.IPAMType = config.IPAM.Type + } + if config.IPAM.Type == hostLocal && config.IPAM.CIDR != nil { + c.IPAM.Subnet = string(*config.IPAM.CIDR) + } + } + + if config.IPv4 != nil { + if config.IPv4.Pool != nil { + switch *config.IPv4.Pool { + case calicov1alpha1.PoolIPIP, calicov1alpha1.PoolVXLan: + c.IPv4.Pool = *config.IPv4.Pool + default: + return nil, fmt.Errorf("unsupported value for ipv4 pool: %s", *config.IPv4.Pool) + } + } + if config.IPv4.Mode != nil { + switch *config.IPv4.Mode { + case calicov1alpha1.Always, calicov1alpha1.Never, calicov1alpha1.Off, calicov1alpha1.CrossSubnet: + c.IPv4.Mode = *config.IPv4.Mode + default: + return nil, fmt.Errorf("unsupported value for ipv4 mode: %s", *config.IPv4.Mode) + } + } + if config.IPv4.AutoDetectionMethod != nil { + c.IPv4.AutoDetectionMethod = config.IPv4.AutoDetectionMethod + } + } else { + // fallback to deprecated configuration fields + // will be removed in a future Gardener release + if config.IPIP != nil { + switch *config.IPIP { + case calicov1alpha1.Always, calicov1alpha1.Never, calicov1alpha1.Off, calicov1alpha1.CrossSubnet: + c.IPv4.Mode = *config.IPIP + default: + return nil, fmt.Errorf("unsupported value for ipip: %s", *config.IPIP) + } + } + if config.IPAutoDetectionMethod != nil { + c.IPv4.AutoDetectionMethod = config.IPAutoDetectionMethod + } + } + + if config.Typha != nil { + c.Typha.Enabled = config.Typha.Enabled + } + + if config.VethMTU != nil { + c.VethMTU = *config.VethMTU + } + + return &c, nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/values.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/values.go new file mode 100644 index 000000000..f87db11f0 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/charts/values.go @@ -0,0 +1,39 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 charts + +import ( + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + "github.com/gardener/gardener-extension-networking-calico/pkg/calico" + + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "github.com/gardener/gardener/pkg/chartrenderer" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const CalicoConfigKey = "config.yaml" + +// RenderCalicoChart renders the calico chart with the given values. +func RenderCalicoChart(renderer chartrenderer.Interface, network *extensionsv1alpha1.Network, config *calicov1alpha1.NetworkConfig) ([]byte, error) { + values, err := ComputeCalicoChartValues(network, config) + if err != nil { + return nil, err + } + release, err := renderer.Render(calico.ChartPath, calico.ReleaseName, metav1.NamespaceSystem, values) + if err != nil { + return nil, err + } + return release.Manifest(), nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator.go new file mode 100644 index 000000000..a090d2f3f --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator.go @@ -0,0 +1,74 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 controller + +import ( + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller" + "github.com/gardener/gardener-extensions/pkg/controller/network" + + "github.com/go-logr/logr" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" +) + +var ( + // StatusTypeMeta is the TypeMeta of Calico Status + StatusTypeMeta = metav1.TypeMeta{ + APIVersion: calicov1alpha1.SchemeGroupVersion.String(), + Kind: "NetworkStatus", + } +) + +type actuator struct { + logger logr.Logger + + chartRendererFactory extensionscontroller.ChartRendererFactory + restConfig *rest.Config + + client client.Client + scheme *runtime.Scheme + decoder runtime.Decoder +} + +const LogID = "network-calico-actuator" + +// NewActuator creates a new Actuator that updates the status of the handled Network resources. +func NewActuator(chartRendererFactory extensionscontroller.ChartRendererFactory) network.Actuator { + return &actuator{ + logger: log.Log.WithName(LogID), + chartRendererFactory: chartRendererFactory, + } +} + +func (a *actuator) InjectScheme(scheme *runtime.Scheme) error { + a.scheme = scheme + a.decoder = serializer.NewCodecFactory(a.scheme).UniversalDecoder() + return nil +} + +func (a *actuator) InjectClient(client client.Client) error { + a.client = client + return nil +} + +func (a *actuator) InjectConfig(config *rest.Config) error { + a.restConfig = config + return nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_delete.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_delete.go new file mode 100644 index 000000000..ec9731740 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_delete.go @@ -0,0 +1,45 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 controller + +import ( + "context" + "time" + + extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller" + + resourcemanager "github.com/gardener/gardener-resource-manager/pkg/manager" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" +) + +// Delete implements Network.Actuator. +func (a *actuator) Delete(ctx context.Context, network *extensionsv1alpha1.Network, cluster *extensionscontroller.Cluster) error { + if err := resourcemanager. + NewSecret(a.client). + WithNamespacedName(network.Namespace, CalicoConfigSecretName). + Delete(ctx); err != nil { + return err + } + if err := resourcemanager. + NewManagedResource(a.client). + WithNamespacedName(network.Namespace, CalicoConfigSecretName). + Delete(ctx); err != nil { + return err + } + + timeoutCtx, cancel := context.WithTimeout(ctx, 2*time.Minute) + defer cancel() + return extensionscontroller.WaitUntilManagedResourceDeleted(timeoutCtx, a.client, network.Namespace, CalicoConfigSecretName) +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_reconcile.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_reconcile.go new file mode 100644 index 000000000..cd8d725a8 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/actuator_reconcile.go @@ -0,0 +1,91 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 controller + +import ( + "context" + + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + "github.com/gardener/gardener-extension-networking-calico/pkg/charts" + extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller" + + "github.com/gardener/gardener-resource-manager/pkg/manager" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "github.com/gardener/gardener/pkg/operation/common" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + // CalicoConfigSecretName is the name of the secret used for the managed resource of networking calico + CalicoConfigSecretName = "extension-networking-calico-config" +) + +func withLocalObjectRefs(refs ...string) []corev1.LocalObjectReference { + var localObjectRefs []corev1.LocalObjectReference + for _, ref := range refs { + localObjectRefs = append(localObjectRefs, corev1.LocalObjectReference{Name: ref}) + } + return localObjectRefs +} + +func calicoSecret(cl client.Client, calicoConfig []byte, namespace string) (*manager.Secret, []corev1.LocalObjectReference) { + return manager.NewSecret(cl). + WithKeyValues(map[string][]byte{charts.CalicoConfigKey: calicoConfig}). + WithNamespacedName(namespace, CalicoConfigSecretName), withLocalObjectRefs(CalicoConfigSecretName) +} + +// Reconcile implements Network.Actuator. +func (a *actuator) Reconcile(ctx context.Context, network *extensionsv1alpha1.Network, cluster *extensionscontroller.Cluster) error { + var ( + networkConfig *calicov1alpha1.NetworkConfig + err error + ) + + if network.Spec.ProviderConfig != nil { + networkConfig, err = CalicoNetworkConfigFromNetworkResource(network) + if err != nil { + return err + } + } + + // Create shoot chart renderer + chartRenderer, err := a.chartRendererFactory.NewChartRendererForShoot(cluster.Shoot.Spec.Kubernetes.Version) + if err != nil { + return errors.Wrapf(err, "could not create chart renderer for shoot '%s'", network.Namespace) + } + + calicoChart, err := charts.RenderCalicoChart(chartRenderer, network, networkConfig) + if err != nil { + return err + } + + secret, secretRefs := calicoSecret(a.client, calicoChart, network.Namespace) + if err := secret.Reconcile(ctx); err != nil { + return err + } + + if err := manager. + NewManagedResource(a.client). + WithNamespacedName(network.Namespace, CalicoConfigSecretName). + WithSecretRefs(secretRefs). + WithInjectedLabels(map[string]string{common.ShootNoCleanup: "true"}). + Reconcile(ctx); err != nil { + return err + } + + return a.updateProviderStatus(ctx, network, networkConfig) +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/add.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/add.go new file mode 100644 index 000000000..870a9e89b --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/add.go @@ -0,0 +1,60 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 controller + +import ( + "github.com/gardener/gardener-extension-networking-calico/pkg/calico" + extensioncontroller "github.com/gardener/gardener-extensions/pkg/controller" + "github.com/gardener/gardener-extensions/pkg/controller/network" + "github.com/gardener/gardener-extensions/pkg/util" + + resourcemanagerscheme "github.com/gardener/gardener-resource-manager/pkg/apis/resources/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/manager" +) + +var ( + // DefaultAddOptions are the default AddOptions for AddToManager. + DefaultAddOptions = AddOptions{} +) + +// AddOptions are options to apply when adding the Calico networking controller to the manager. +type AddOptions struct { + // Controller are the controller.Options. + Controller controller.Options + // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not. + IgnoreOperationAnnotation bool +} + +// AddToManagerWithOptions adds a controller with the given Options to the given manager. +// The opts.Reconciler is being set with a newly instantiated actuator. +func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error { + scheme := mgr.GetScheme() + if err := resourcemanagerscheme.AddToScheme(scheme); err != nil { + return err + } + + return network.Add(mgr, network.AddArgs{ + Actuator: NewActuator(extensioncontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot)), + ControllerOptions: opts.Controller, + Predicates: network.DefaultPredicates(opts.IgnoreOperationAnnotation), + Type: calico.Type, + }) +} + +// AddToManager adds a controller with the default Options. +func AddToManager(mgr manager.Manager) error { + return AddToManagerWithOptions(mgr, DefaultAddOptions) +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/decode.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/decode.go new file mode 100644 index 000000000..4dbadd2b4 --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/decode.go @@ -0,0 +1,54 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 controller + +import ( + "fmt" + + "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/install" + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var ( + // Scheme is a scheme with the types relevant for Network actuators. + Scheme *runtime.Scheme + + decoder runtime.Decoder +) + +func init() { + Scheme = runtime.NewScheme() + utilruntime.Must(install.AddToScheme(Scheme)) + + decoder = serializer.NewCodecFactory(Scheme).UniversalDecoder() +} + +// CalicoNetworkConfigFromNetworkResource extracts the NetworkConfig from the +// ProviderConfig section of the given Network resource. +func CalicoNetworkConfigFromNetworkResource(network *extensionsv1alpha1.Network) (*calicov1alpha1.NetworkConfig, error) { + config := &calicov1alpha1.NetworkConfig{} + if network.Spec.ProviderConfig != nil && network.Spec.ProviderConfig.Raw != nil { + if _, _, err := decoder.Decode(network.Spec.ProviderConfig.Raw, nil, config); err != nil { + return nil, err + } + return config, nil + } + return nil, fmt.Errorf("provider config is not set on the network resource") +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/status.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/status.go new file mode 100644 index 000000000..9fe8b5a0c --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/controller/status.go @@ -0,0 +1,57 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 controller + +import ( + "context" + + gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + + calicov1alpha1 "github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1" + extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/util/retry" +) + +func (a *actuator) updateProviderStatus( + ctx context.Context, + network *extensionsv1alpha1.Network, + config *calicov1alpha1.NetworkConfig, +) error { + status, err := a.ComputeNetworkStatus(config) + if err != nil { + return err + } + + return extensionscontroller.TryUpdateStatus(ctx, retry.DefaultBackoff, a.client, network, func() error { + network.Status.ProviderStatus = &runtime.RawExtension{Object: status} + network.Status.LastOperation = extensionscontroller.LastOperation(gardencorev1beta1.LastOperationTypeReconcile, + gardencorev1beta1.LastOperationStateSucceeded, + 100, + "Calico was configured successfully") + return nil + }) +} + +func (a *actuator) ComputeNetworkStatus(networkConfig *calicov1alpha1.NetworkConfig) (*calicov1alpha1.NetworkStatus, error) { + var ( + status = &calicov1alpha1.NetworkStatus{ + TypeMeta: StatusTypeMeta, + } + ) + + return status, nil +} diff --git a/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/imagevector/imagevector.go b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/imagevector/imagevector.go new file mode 100644 index 000000000..ddc8ae17a --- /dev/null +++ b/vendor/github.com/gardener/gardener-extension-networking-calico/pkg/imagevector/imagevector.go @@ -0,0 +1,96 @@ +// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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. + +//go:generate packr2 + +package imagevector + +import ( + "strings" + + "github.com/gardener/gardener-extension-networking-calico/pkg/calico" + + "github.com/gardener/gardener/pkg/utils/imagevector" + "github.com/gobuffalo/packr/v2" + "k8s.io/apimachinery/pkg/util/runtime" +) + +var imageVector imagevector.ImageVector + +func init() { + box := packr.New("charts", "../../charts") + + imagesYaml, err := box.FindString("images.yaml") + runtime.Must(err) + + imageVector, err = imagevector.Read(strings.NewReader(imagesYaml)) + runtime.Must(err) + + imageVector, err = imagevector.WithEnvOverride(imageVector) + runtime.Must(err) +} + +// ImageVector is the image vector that contains all the needed images. +func ImageVector() imagevector.ImageVector { + return imageVector +} + +// CalicoCNIImage returns the Calico CNI Image. +func CalicoCNIImage() string { + image, err := imageVector.FindImage(calico.CNIImageName) + runtime.Must(err) + return image.String() +} + +// CalicoNodeImage returns the Calico Node image. +func CalicoNodeImage() string { + image, err := imageVector.FindImage(calico.NodeImageName) + runtime.Must(err) + return image.String() +} + +// CalicoTyphaImage returns the Calico Typha image. +func CalicoTyphaImage() string { + image, err := imageVector.FindImage(calico.TyphaImageName) + runtime.Must(err) + return image.String() +} + +// CalicoKubeControllersImage returns the Calico Kube-controllers image. +func CalicoKubeControllersImage() string { + image, err := imageVector.FindImage(calico.KubeControllersImageName) + runtime.Must(err) + return image.String() +} + +// CalicoFlexVolumeDriverImage returns the Calico flexvol image. +func CalicoFlexVolumeDriverImage() string { + image, err := imageVector.FindImage(calico.PodToDaemonFlexVolumeDriverImageName) + runtime.Must(err) + return image.String() +} + +// TyphaClusterProportionalAutoscalerImage returns the Calico cluster-proportional-autoscaler image. +func TyphaClusterProportionalAutoscalerImage() string { + image, err := imageVector.FindImage(calico.TyphaClusterProportionalAutoscalerImageName) + runtime.Must(err) + return image.String() +} + +// TyphaClusterProportionalVerticalAutoscalerImage returns the Calico cluster-proportional-vertical-autoscaler image. +func TyphaClusterProportionalVerticalAutoscalerImage() string { + image, err := imageVector.FindImage(calico.TyphaClusterProportionalVerticalAutoscalerImageName) + runtime.Must(err) + return image.String() +} diff --git a/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go b/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go index 4471e6a49..956592a32 100644 --- a/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go +++ b/vendor/github.com/gardener/gardener/test/framework/gardenerframework.go @@ -152,6 +152,9 @@ func RegisterGardenerFrameworkFlags(flagset *flag.FlagSet) *GardenerConfig { func (f *GardenerFramework) NewShootFramework(shoot *gardencorev1beta1.Shoot) (*ShootFramework, error) { shootFramework := &ShootFramework{ GardenerFramework: f, + Config: &ShootConfig{ + GardenerConfig: f.GardenerFrameworkConfig, + }, } if err := shootFramework.AddShoot(context.TODO(), shoot.GetName(), shoot.GetNamespace()); err != nil { return nil, err diff --git a/vendor/github.com/onsi/ginkgo/CHANGELOG.md b/vendor/github.com/onsi/ginkgo/CHANGELOG.md index 4920406ae..aeadb66e0 100644 --- a/vendor/github.com/onsi/ginkgo/CHANGELOG.md +++ b/vendor/github.com/onsi/ginkgo/CHANGELOG.md @@ -1,3 +1,29 @@ +## 1.10.1 + +## Fixes +- stack backtrace: fix skipping (#600) [2a4c0bd] + +## 1.10.0 + +## Fixes +- stack backtrace: fix alignment and skipping [66915d6] +- fix typo in documentation [8f97b93] + +## 1.9.0 + +## Features +- Option to print output into report, when tests have passed [0545415] + +## Fixes +- Fixed typos in comments [0ecbc58] +- gofmt code [a7f8bfb] +- Simplify code [7454d00] +- Simplify concatenation, incrementation and function assignment [4825557] +- Avoid unnecessary conversions [9d9403c] +- JUnit: include more detailed information about panic [19cca4b] +- Print help to stdout when the user asks for help [4cb7441] + + ## 1.8.0 ### New Features diff --git a/vendor/github.com/onsi/ginkgo/config/config.go b/vendor/github.com/onsi/ginkgo/config/config.go index dab2a2470..ac55a5ad2 100644 --- a/vendor/github.com/onsi/ginkgo/config/config.go +++ b/vendor/github.com/onsi/ginkgo/config/config.go @@ -20,7 +20,7 @@ import ( "fmt" ) -const VERSION = "1.8.0" +const VERSION = "1.10.1" type GinkgoConfigType struct { RandomSeed int64 @@ -52,13 +52,14 @@ type DefaultReporterConfigType struct { Succinct bool Verbose bool FullTrace bool + ReportPassed bool } var DefaultReporterConfig = DefaultReporterConfigType{} func processPrefix(prefix string) string { if prefix != "" { - prefix = prefix + "." + prefix += "." } return prefix } @@ -98,6 +99,7 @@ func Flags(flagSet *flag.FlagSet, prefix string, includeParallelFlags bool) { flagSet.BoolVar(&(DefaultReporterConfig.Verbose), prefix+"v", false, "If set, default reporter print out all specs as they begin.") flagSet.BoolVar(&(DefaultReporterConfig.Succinct), prefix+"succinct", false, "If set, default reporter prints out a very succinct report") flagSet.BoolVar(&(DefaultReporterConfig.FullTrace), prefix+"trace", false, "If set, default reporter prints out the full stack trace when a failure occurs") + flagSet.BoolVar(&(DefaultReporterConfig.ReportPassed), prefix+"reportPassed", false, "If set, default reporter prints out captured output of passed tests.") } func BuildFlagArgs(prefix string, ginkgo GinkgoConfigType, reporter DefaultReporterConfigType) []string { @@ -196,5 +198,9 @@ func BuildFlagArgs(prefix string, ginkgo GinkgoConfigType, reporter DefaultRepor result = append(result, fmt.Sprintf("--%strace", prefix)) } + if reporter.ReportPassed { + result = append(result, fmt.Sprintf("--%sreportPassed", prefix)) + } + return result } diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go b/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go index fea4d4d4e..93150d1a4 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go @@ -131,10 +131,7 @@ func determinePackageName(name string, internal bool) string { func fileExists(path string) bool { _, err := os.Stat(path) - if err == nil { - return true - } - return false + return err == nil } func generateBootstrap(agouti, noDot, internal bool, customBootstrapFile string) { diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go b/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go index e226196f7..06c6ec94c 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go @@ -1,7 +1,6 @@ package convert import ( - "errors" "fmt" "go/ast" ) @@ -24,7 +23,7 @@ func importsForRootNode(rootNode *ast.File) (imports *ast.GenDecl, err error) { } } - err = errors.New(fmt.Sprintf("Could not find imports for root node:\n\t%#v\n", rootNode)) + err = fmt.Errorf("Could not find imports for root node:\n\t%#v\n", rootNode) return } diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go b/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go index ed09c460d..5e00d5618 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go @@ -24,7 +24,6 @@ func RewritePackage(packageName string) { for _, filename := range findTestsInPackage(pkg) { rewriteTestsInFile(filename) } - return } /* diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go b/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go index 4b001a7db..d415050ef 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go @@ -61,7 +61,6 @@ func rewriteTestsInFile(pathToFile string) { } ioutil.WriteFile(pathToFile, buffer.Bytes(), fileInfo.Mode()) - return } /* @@ -88,7 +87,6 @@ func rewriteTestFuncAsItStatement(testFunc *ast.FuncDecl, rootNode *ast.File, de // remove the old test func from the root node's declarations rootNode.Decls = append(rootNode.Decls[:funcIndex], rootNode.Decls[funcIndex+1:]...) - return } /* diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go b/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go index c15db0b02..ec456bf29 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go @@ -16,7 +16,7 @@ type InterruptHandler struct { func NewInterruptHandler() *InterruptHandler { h := &InterruptHandler{ lock: &sync.Mutex{}, - C: make(chan bool, 0), + C: make(chan bool), } go h.handleInterrupt() diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/main.go b/vendor/github.com/onsi/ginkgo/ginkgo/main.go index 4a1aeef4f..0741ba8c9 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/main.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/main.go @@ -153,6 +153,7 @@ func (c *Command) Matches(name string) bool { } func (c *Command) Run(args []string, additionalArgs []string) { + c.FlagSet.Usage = usage c.FlagSet.Parse(args) c.Command(c.FlagSet.Args(), additionalArgs) } @@ -215,20 +216,21 @@ func commandMatching(name string) (*Command, bool) { } func usage() { - fmt.Fprintf(os.Stderr, "Ginkgo Version %s\n\n", config.VERSION) + fmt.Printf("Ginkgo Version %s\n\n", config.VERSION) usageForCommand(DefaultCommand, false) for _, command := range Commands { - fmt.Fprintf(os.Stderr, "\n") + fmt.Printf("\n") usageForCommand(command, false) } } func usageForCommand(command *Command, longForm bool) { - fmt.Fprintf(os.Stderr, "%s\n%s\n", command.UsageCommand, strings.Repeat("-", len(command.UsageCommand))) - fmt.Fprintf(os.Stderr, "%s\n", strings.Join(command.Usage, "\n")) + fmt.Printf("%s\n%s\n", command.UsageCommand, strings.Repeat("-", len(command.UsageCommand))) + fmt.Printf("%s\n", strings.Join(command.Usage, "\n")) if command.SuppressFlagDocumentation && !longForm { - fmt.Fprintf(os.Stderr, "%s\n", strings.Join(command.FlagDocSubstitute, "\n ")) + fmt.Printf("%s\n", strings.Join(command.FlagDocSubstitute, "\n ")) } else { + command.FlagSet.SetOutput(os.Stdout) command.FlagSet.PrintDefaults() } } diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go b/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go index ce6c94602..ab746d7e9 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go @@ -41,7 +41,7 @@ func (r *SuiteRunner) compileInParallel(runners []*testrunner.TestRunner, numCom //an array of channels - the nth runner's compilation output is sent to the nth channel in this array //we read from these channels in order to ensure we run the suites in order orderedCompilationOutputs := []chan compilationOutput{} - for _ = range runners { + for range runners { orderedCompilationOutputs = append(orderedCompilationOutputs, make(chan compilationOutput, 1)) } diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go b/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go index dccb39518..80670d24a 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go @@ -156,7 +156,7 @@ func (t *TestRunner) CompileTo(path string) error { fmt.Println(string(output)) } - if fileExists(path) == false { + if !fileExists(path) { compiledFile := t.Suite.PackageName + ".test" if fileExists(compiledFile) { // seems like we are on an old go version that does not support the -o flag on go test @@ -182,7 +182,7 @@ func (t *TestRunner) CompileTo(path string) error { func fileExists(path string) bool { _, err := os.Stat(path) - return err == nil || os.IsNotExist(err) == false + return err == nil || !os.IsNotExist(err) } // copyFile copies the contents of the file named src to the file named @@ -523,7 +523,7 @@ func (t *TestRunner) combineCoverprofiles() { lines := map[string]int{} lineOrder := []string{} for i, coverProfile := range profiles { - for _, line := range strings.Split(string(coverProfile), "\n")[1:] { + for _, line := range strings.Split(coverProfile, "\n")[1:] { if len(line) == 0 { continue } diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go b/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go index 82c25face..b7f756777 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go @@ -77,7 +77,7 @@ func (d Dependencies) resolveAndAdd(deps []string, depth int) { if err != nil { continue } - if pkg.Goroot == false && !ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) { + if !pkg.Goroot && !ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) { d.addDepIfNotPresent(pkg.Dir, depth) } } diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go b/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go index 7e1e4192d..67e2c1c32 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go @@ -36,7 +36,7 @@ func (p *PackageHash) CheckForChanges() bool { codeHash, codeModifiedTime, testHash, testModifiedTime, deleted := p.computeHashes() if deleted { - if p.Deleted == false { + if !p.Deleted { t := time.Now() p.CodeModifiedTime = t p.TestModifiedTime = t diff --git a/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go b/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go index a6b96d88f..8734c061d 100644 --- a/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go +++ b/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go @@ -283,7 +283,7 @@ func GinkgoRecover() { //BeforeEach, AfterEach, JustBeforeEach, It, and Measurement blocks. // //In addition you can nest Describe, Context and When blocks. Describe, Context and When blocks are functionally -//equivalent. The difference is purely semantic -- you typical Describe the behavior of an object +//equivalent. The difference is purely semantic -- you typically Describe the behavior of an object //or method and, within that Describe, outline a number of Contexts and Whens. func Describe(text string, body func()) bool { globalSuite.PushContainerNode(text, body, types.FlagTypeNone, codelocation.New(1)) @@ -499,7 +499,7 @@ func AfterSuite(body interface{}, timeout ...float64) bool { //until that node is done before running. // //SynchronizedBeforeSuite accomplishes this by taking *two* function arguments. The first is only run on parallel node #1. The second is -//run on all nodes, but *only* after the first function completes succesfully. Ginkgo also makes it possible to send data from the first function (on Node 1) +//run on all nodes, but *only* after the first function completes successfully. Ginkgo also makes it possible to send data from the first function (on Node 1) //to the second function (on all the other nodes). // //The functions have the following signatures. The first function (which only runs on node 1) has the signature: diff --git a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go b/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go index fa2f0bf73..aa89d6cba 100644 --- a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go +++ b/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go @@ -11,19 +11,35 @@ import ( func New(skip int) types.CodeLocation { _, file, line, _ := runtime.Caller(skip + 1) - stackTrace := PruneStack(string(debug.Stack()), skip) + stackTrace := PruneStack(string(debug.Stack()), skip+1) return types.CodeLocation{FileName: file, LineNumber: line, FullStackTrace: stackTrace} } +// PruneStack removes references to functions that are internal to Ginkgo +// and the Go runtime from a stack string and a certain number of stack entries +// at the beginning of the stack. The stack string has the format +// as returned by runtime/debug.Stack. The leading goroutine information is +// optional and always removed if present. Beware that runtime/debug.Stack +// adds itself as first entry, so typically skip must be >= 1 to remove that +// entry. func PruneStack(fullStackTrace string, skip int) string { stack := strings.Split(fullStackTrace, "\n") + // Ensure that the even entries are the method names and the + // the odd entries the source code information. + if len(stack) > 0 && strings.HasPrefix(stack[0], "goroutine ") { + // Ignore "goroutine 29 [running]:" line. + stack = stack[1:] + } + // The "+1" is for skipping over the initial entry, which is + // runtime/debug.Stack() itself. if len(stack) > 2*(skip+1) { stack = stack[2*(skip+1):] } prunedStack := []string{} re := regexp.MustCompile(`\/ginkgo\/|\/pkg\/testing\/|\/pkg\/runtime\/`) for i := 0; i < len(stack)/2; i++ { - if !re.Match([]byte(stack[i*2])) { + // We filter out based on the source code file name. + if !re.Match([]byte(stack[i*2+1])) { prunedStack = append(prunedStack, stack[i*2]) prunedStack = append(prunedStack, stack[i*2+1]) } diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go index d6d54234c..393901e11 100644 --- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go +++ b/vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go @@ -17,7 +17,7 @@ type benchmarker struct { func newBenchmarker() *benchmarker { return &benchmarker{ - measurements: make(map[string]*types.SpecMeasurement, 0), + measurements: make(map[string]*types.SpecMeasurement), } } diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/aggregator.go b/vendor/github.com/onsi/ginkgo/internal/remote/aggregator.go index 6b54afe01..f9ab30067 100644 --- a/vendor/github.com/onsi/ginkgo/internal/remote/aggregator.go +++ b/vendor/github.com/onsi/ginkgo/internal/remote/aggregator.go @@ -54,11 +54,11 @@ func NewAggregator(nodeCount int, result chan bool, config config.DefaultReporte config: config, stenographer: stenographer, - suiteBeginnings: make(chan configAndSuite, 0), - beforeSuites: make(chan *types.SetupSummary, 0), - afterSuites: make(chan *types.SetupSummary, 0), - specCompletions: make(chan *types.SpecSummary, 0), - suiteEndings: make(chan *types.SuiteSummary, 0), + suiteBeginnings: make(chan configAndSuite), + beforeSuites: make(chan *types.SetupSummary), + afterSuites: make(chan *types.SetupSummary), + specCompletions: make(chan *types.SpecSummary), + suiteEndings: make(chan *types.SuiteSummary), } go aggregator.mux() @@ -227,7 +227,7 @@ func (aggregator *Aggregator) registerSuiteEnding(suite *types.SuiteSummary) (fi aggregatedSuiteSummary.SuiteSucceeded = true for _, suiteSummary := range aggregator.aggregatedSuiteEndings { - if suiteSummary.SuiteSucceeded == false { + if !suiteSummary.SuiteSucceeded { aggregatedSuiteSummary.SuiteSucceeded = false } diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/server.go b/vendor/github.com/onsi/ginkgo/internal/remote/server.go index 367c54daf..93e9dac05 100644 --- a/vendor/github.com/onsi/ginkgo/internal/remote/server.go +++ b/vendor/github.com/onsi/ginkgo/internal/remote/server.go @@ -213,7 +213,7 @@ func (server *Server) handleCounter(writer http.ResponseWriter, request *http.Re c := spec_iterator.Counter{} server.lock.Lock() c.Index = server.counter - server.counter = server.counter + 1 + server.counter++ server.lock.Unlock() json.NewEncoder(writer).Encode(c) diff --git a/vendor/github.com/onsi/ginkgo/internal/spec/spec.go b/vendor/github.com/onsi/ginkgo/internal/spec/spec.go index 7fd68ee8e..6eef40a0e 100644 --- a/vendor/github.com/onsi/ginkgo/internal/spec/spec.go +++ b/vendor/github.com/onsi/ginkgo/internal/spec/spec.go @@ -107,11 +107,11 @@ func (spec *Spec) Summary(suiteID string) *types.SpecSummary { NumberOfSamples: spec.subject.Samples(), ComponentTexts: componentTexts, ComponentCodeLocations: componentCodeLocations, - State: spec.getState(), - RunTime: runTime, - Failure: spec.failure, - Measurements: spec.measurementsReport(), - SuiteID: suiteID, + State: spec.getState(), + RunTime: runTime, + Failure: spec.failure, + Measurements: spec.measurementsReport(), + SuiteID: suiteID, } } diff --git a/vendor/github.com/onsi/ginkgo/internal/spec/specs.go b/vendor/github.com/onsi/ginkgo/internal/spec/specs.go index 27c0d1d6c..8a2007137 100644 --- a/vendor/github.com/onsi/ginkgo/internal/spec/specs.go +++ b/vendor/github.com/onsi/ginkgo/internal/spec/specs.go @@ -107,11 +107,11 @@ func (e *Specs) applyRegExpFocusAndSkip(description string, focusString string, toMatch := e.toMatch(description, i) if focusFilter != nil { - matchesFocus = focusFilter.Match([]byte(toMatch)) + matchesFocus = focusFilter.Match(toMatch) } if skipFilter != nil { - matchesSkip = skipFilter.Match([]byte(toMatch)) + matchesSkip = skipFilter.Match(toMatch) } if !matchesFocus || matchesSkip { diff --git a/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go b/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go index 2c683cb8b..c9a0a60d8 100644 --- a/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go +++ b/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go @@ -300,7 +300,7 @@ func (runner *SpecRunner) reportSpecWillRun(summary *types.SpecSummary) { } func (runner *SpecRunner) reportSpecDidComplete(summary *types.SpecSummary, failed bool) { - if failed && len(summary.CapturedOutput) == 0 { + if len(summary.CapturedOutput) == 0 { summary.CapturedOutput = string(runner.writer.Bytes()) } for i := len(runner.reporters) - 1; i >= 1; i-- { diff --git a/vendor/github.com/onsi/ginkgo/reporters/default_reporter.go b/vendor/github.com/onsi/ginkgo/reporters/default_reporter.go index ac58dd5f7..c76283b46 100644 --- a/vendor/github.com/onsi/ginkgo/reporters/default_reporter.go +++ b/vendor/github.com/onsi/ginkgo/reporters/default_reporter.go @@ -62,6 +62,9 @@ func (reporter *DefaultReporter) SpecDidComplete(specSummary *types.SpecSummary) reporter.stenographer.AnnounceSuccesfulSlowSpec(specSummary, reporter.config.Succinct) } else { reporter.stenographer.AnnounceSuccesfulSpec(specSummary) + if reporter.config.ReportPassed { + reporter.stenographer.AnnounceCapturedOutput(specSummary.CapturedOutput) + } } case types.SpecStatePending: reporter.stenographer.AnnouncePendingSpec(specSummary, reporter.config.NoisyPendings && !reporter.config.Succinct) diff --git a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go index 2c9f3c792..89a7c8465 100644 --- a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go +++ b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go @@ -32,12 +32,17 @@ type JUnitTestSuite struct { type JUnitTestCase struct { Name string `xml:"name,attr"` ClassName string `xml:"classname,attr"` + PassedMessage *JUnitPassedMessage `xml:"passed,omitempty"` FailureMessage *JUnitFailureMessage `xml:"failure,omitempty"` Skipped *JUnitSkipped `xml:"skipped,omitempty"` Time float64 `xml:"time,attr"` SystemOut string `xml:"system-out,omitempty"` } +type JUnitPassedMessage struct { + Message string `xml:",chardata"` +} + type JUnitFailureMessage struct { Type string `xml:"type,attr"` Message string `xml:",chardata"` @@ -48,9 +53,10 @@ type JUnitSkipped struct { } type JUnitReporter struct { - suite JUnitTestSuite - filename string - testSuiteName string + suite JUnitTestSuite + filename string + testSuiteName string + ReporterConfig config.DefaultReporterConfigType } //NewJUnitReporter creates a new JUnit XML reporter. The XML will be stored in the passed in filename. @@ -60,12 +66,13 @@ func NewJUnitReporter(filename string) *JUnitReporter { } } -func (reporter *JUnitReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { +func (reporter *JUnitReporter) SpecSuiteWillBegin(ginkgoConfig config.GinkgoConfigType, summary *types.SuiteSummary) { reporter.suite = JUnitTestSuite{ Name: summary.SuiteDescription, TestCases: []JUnitTestCase{}, } reporter.testSuiteName = summary.SuiteDescription + reporter.ReporterConfig = config.DefaultReporterConfig } func (reporter *JUnitReporter) SpecWillRun(specSummary *types.SpecSummary) { @@ -105,11 +112,21 @@ func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary) { Name: strings.Join(specSummary.ComponentTexts[1:], " "), ClassName: reporter.testSuiteName, } + if reporter.ReporterConfig.ReportPassed && specSummary.State == types.SpecStatePassed { + testCase.PassedMessage = &JUnitPassedMessage{ + Message: specSummary.CapturedOutput, + } + } if specSummary.State == types.SpecStateFailed || specSummary.State == types.SpecStateTimedOut || specSummary.State == types.SpecStatePanicked { testCase.FailureMessage = &JUnitFailureMessage{ Type: reporter.failureTypeForState(specSummary.State), Message: failureMessage(specSummary.Failure), } + if specSummary.State == types.SpecStatePanicked { + testCase.FailureMessage.Message += fmt.Sprintf("\n\nPanic: %s\n\nFull stack:\n%s", + specSummary.Failure.ForwardedPanic, + specSummary.Failure.Location.FullStackTrace) + } testCase.SystemOut = specSummary.CapturedOutput } if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending { diff --git a/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter.go b/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter.go index 36ee2a600..c8e27b2a7 100644 --- a/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter.go +++ b/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter.go @@ -22,8 +22,9 @@ const ( ) type TeamCityReporter struct { - writer io.Writer - testSuiteName string + writer io.Writer + testSuiteName string + ReporterConfig config.DefaultReporterConfigType } func NewTeamCityReporter(writer io.Writer) *TeamCityReporter { @@ -65,6 +66,10 @@ func (reporter *TeamCityReporter) SpecWillRun(specSummary *types.SpecSummary) { func (reporter *TeamCityReporter) SpecDidComplete(specSummary *types.SpecSummary) { testName := escape(strings.Join(specSummary.ComponentTexts[1:], " ")) + if reporter.ReporterConfig.ReportPassed && specSummary.State == types.SpecStatePassed { + details := escape(specSummary.CapturedOutput) + fmt.Fprintf(reporter.writer, "%s[testPassed name='%s' details='%s']", messageId, testName, details) + } if specSummary.State == types.SpecStateFailed || specSummary.State == types.SpecStateTimedOut || specSummary.State == types.SpecStatePanicked { message := escape(specSummary.Failure.ComponentCodeLocation.String()) details := escape(specSummary.Failure.Message) diff --git a/vendor/github.com/onsi/ginkgo/types/types.go b/vendor/github.com/onsi/ginkgo/types/types.go index 0e89521be..e4e32b761 100644 --- a/vendor/github.com/onsi/ginkgo/types/types.go +++ b/vendor/github.com/onsi/ginkgo/types/types.go @@ -17,7 +17,7 @@ each node does not deterministically know how many specs it will end up running. Unfortunately making such a change would break backward compatibility. -Until Ginkgo 2.0 comes out we will continue to reuse this struct but populate unkown fields +Until Ginkgo 2.0 comes out we will continue to reuse this struct but populate unknown fields with -1. */ type SuiteSummary struct { diff --git a/vendor/github.com/onsi/gomega/.travis.yml b/vendor/github.com/onsi/gomega/.travis.yml index 2420a5d07..d147e451d 100644 --- a/vendor/github.com/onsi/gomega/.travis.yml +++ b/vendor/github.com/onsi/gomega/.travis.yml @@ -4,6 +4,7 @@ go: - 1.10.x - 1.11.x - 1.12.x + - gotip env: - GO111MODULE=on diff --git a/vendor/github.com/onsi/gomega/CHANGELOG.md b/vendor/github.com/onsi/gomega/CHANGELOG.md index 5d1eda837..f67074016 100644 --- a/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,35 @@ +## 1.7.0 + +### Features +- export format property variables (#347) [642e5ba] + +### Fixes +- minor fix in the documentation of ExpectWithOffset (#358) [beea727] + +## 1.6.0 + +### Features + +- Display special chars on error [41e1b26] +- Add BeElementOf matcher [6a48b48] + +### Fixes + +- Remove duplication in XML matcher tests [cc1a6cb] +- Remove unnecessary conversions (#357) [7bf756a] +- Fixed import order (#353) [2e3b965] +- Added missing error handling in test (#355) [c98d3eb] +- Simplify code (#356) [0001ed9] +- Simplify code (#354) [0d9100e] +- Fixed typos (#352) [3f647c4] +- Add failure message tests to BeElementOf matcher [efe19c3] +- Update go-testcov untested sections [37ee382] +- Mark all uncovered files so go-testcov ./... works [53b150e] +- Reenable gotip in travis [5c249dc] +- Fix the typo of comment (#345) [f0e010e] +- Optimize contain_element_matcher [abeb93d] + + ## 1.5.0 ### Features diff --git a/vendor/github.com/onsi/gomega/format/format.go b/vendor/github.com/onsi/gomega/format/format.go index 6559525f1..fae25adce 100644 --- a/vendor/github.com/onsi/gomega/format/format.go +++ b/vendor/github.com/onsi/gomega/format/format.go @@ -1,6 +1,9 @@ /* Gomega's format package pretty-prints objects. It explores input objects recursively and generates formatted, indented output with type information. */ + +// untested sections: 4 + package format import ( @@ -33,7 +36,15 @@ var PrintContextObjects = false // TruncatedDiff choose if we should display a truncated pretty diff or not var TruncatedDiff = true -// Ctx interface defined here to keep backwards compatability with go < 1.7 +// TruncateThreshold (default 50) specifies the maximum length string to print in string comparison assertion error +// messages. +var TruncateThreshold uint = 50 + +// CharactersAroundMismatchToInclude (default 5) specifies how many contextual characters should be printed before and +// after the first diff location in a truncated string assertion error message. +var CharactersAroundMismatchToInclude uint = 5 + +// Ctx interface defined here to keep backwards compatibility with go < 1.7 // It matches the context.Context interface type Ctx interface { Deadline() (deadline time.Time, ok bool) @@ -58,7 +69,7 @@ Generates a formatted matcher success/failure message of the form: -If expected is omited, then the message looks like: +If expected is omitted, then the message looks like: Expected @@ -85,7 +96,7 @@ to equal | */ func MessageWithDiff(actual, message, expected string) string { - if TruncatedDiff && len(actual) >= truncateThreshold && len(expected) >= truncateThreshold { + if TruncatedDiff && len(actual) >= int(TruncateThreshold) && len(expected) >= int(TruncateThreshold) { diffPoint := findFirstMismatch(actual, expected) formattedActual := truncateAndFormat(actual, diffPoint) formattedExpected := truncateAndFormat(expected, diffPoint) @@ -97,14 +108,23 @@ func MessageWithDiff(actual, message, expected string) string { padding := strings.Repeat(" ", spaceFromMessageToActual+spacesBeforeFormattedMismatch) + "|" return Message(formattedActual, message+padding, formattedExpected) } + + actual = escapedWithGoSyntax(actual) + expected = escapedWithGoSyntax(expected) + return Message(actual, message, expected) } +func escapedWithGoSyntax(str string) string { + withQuotes := fmt.Sprintf("%q", str) + return withQuotes[1 : len(withQuotes)-1] +} + func truncateAndFormat(str string, index int) string { leftPadding := `...` rightPadding := `...` - start := index - charactersAroundMismatchToInclude + start := index - int(CharactersAroundMismatchToInclude) if start < 0 { start = 0 leftPadding = "" @@ -112,7 +132,7 @@ func truncateAndFormat(str string, index int) string { // slice index must include the mis-matched character lengthOfMismatchedCharacter := 1 - end := index + charactersAroundMismatchToInclude + lengthOfMismatchedCharacter + end := index + int(CharactersAroundMismatchToInclude) + lengthOfMismatchedCharacter if end > len(str) { end = len(str) rightPadding = "" @@ -141,11 +161,6 @@ func findFirstMismatch(a, b string) int { return 0 } -const ( - truncateThreshold = 50 - charactersAroundMismatchToInclude = 5 -) - /* Pretty prints the passed in object at the passed in indentation level. @@ -288,7 +303,7 @@ func formatString(object interface{}, indentation uint) string { } } - return fmt.Sprintf("%s", result) + return result } else { return fmt.Sprintf("%q", object) } diff --git a/vendor/github.com/onsi/gomega/gomega_dsl.go b/vendor/github.com/onsi/gomega/gomega_dsl.go index 448d595da..b145768cf 100644 --- a/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -24,7 +24,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.5.0" +const GOMEGA_VERSION = "1.7.0" const nilFailHandlerPanic = `You are trying to make an assertion, but Gomega's fail handler is nil. If you're using Ginkgo then you probably forgot to put your assertion in an It(). @@ -155,7 +155,7 @@ func Expect(actual interface{}, extra ...interface{}) Assertion { // ExpectWithOffset(1, "foo").To(Equal("foo")) // // Unlike `Expect` and `Ω`, `ExpectWithOffset` takes an additional integer argument -// this is used to modify the call-stack offset when computing line numbers. +// that is used to modify the call-stack offset when computing line numbers. // // This is most useful in helper functions that make assertions. If you want Gomega's // error message to refer to the calling line in the test (as opposed to the line in the helper function) @@ -242,7 +242,7 @@ func EventuallyWithOffset(offset int, actual interface{}, intervals ...interface // assert that all other values are nil/zero. // This allows you to pass Consistently a function that returns a value and an error - a common pattern in Go. // -// Consistently is useful in cases where you want to assert that something *does not happen* over a period of tiem. +// Consistently is useful in cases where you want to assert that something *does not happen* over a period of time. // For example, you want to assert that a goroutine does *not* send data down a channel. In this case, you could: // // Consistently(channel).ShouldNot(Receive()) @@ -280,7 +280,7 @@ func SetDefaultEventuallyPollingInterval(t time.Duration) { defaultEventuallyPollingInterval = t } -// SetDefaultConsistentlyDuration sets the default duration for Consistently. Consistently will verify that your condition is satsified for this long. +// SetDefaultConsistentlyDuration sets the default duration for Consistently. Consistently will verify that your condition is satisfied for this long. func SetDefaultConsistentlyDuration(t time.Duration) { defaultConsistentlyDuration = t } @@ -320,7 +320,7 @@ type GomegaAsyncAssertion = AsyncAssertion // All methods take a variadic optionalDescription argument. This is passed on to fmt.Sprintf() // and is used to annotate failure messages. // -// All methods return a bool that is true if hte assertion passed and false if it failed. +// All methods return a bool that is true if the assertion passed and false if it failed. // // Example: // diff --git a/vendor/github.com/onsi/gomega/gstruct/elements.go b/vendor/github.com/onsi/gomega/gstruct/elements.go index 13bf5b895..30e3369e0 100644 --- a/vendor/github.com/onsi/gomega/gstruct/elements.go +++ b/vendor/github.com/onsi/gomega/gstruct/elements.go @@ -1,3 +1,5 @@ +// untested sections: 6 + package gstruct import ( diff --git a/vendor/github.com/onsi/gomega/gstruct/fields.go b/vendor/github.com/onsi/gomega/gstruct/fields.go index 154c1d480..faf07b1a2 100644 --- a/vendor/github.com/onsi/gomega/gstruct/fields.go +++ b/vendor/github.com/onsi/gomega/gstruct/fields.go @@ -1,3 +1,5 @@ +// untested sections: 6 + package gstruct import ( diff --git a/vendor/github.com/onsi/gomega/gstruct/ignore.go b/vendor/github.com/onsi/gomega/gstruct/ignore.go index 0365f32ad..4396573e4 100644 --- a/vendor/github.com/onsi/gomega/gstruct/ignore.go +++ b/vendor/github.com/onsi/gomega/gstruct/ignore.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package gstruct import ( diff --git a/vendor/github.com/onsi/gomega/gstruct/keys.go b/vendor/github.com/onsi/gomega/gstruct/keys.go index d5549ff55..56aed4bab 100644 --- a/vendor/github.com/onsi/gomega/gstruct/keys.go +++ b/vendor/github.com/onsi/gomega/gstruct/keys.go @@ -1,3 +1,5 @@ +// untested sections: 6 + package gstruct import ( diff --git a/vendor/github.com/onsi/gomega/gstruct/pointer.go b/vendor/github.com/onsi/gomega/gstruct/pointer.go index 0a2f35de3..cc828a325 100644 --- a/vendor/github.com/onsi/gomega/gstruct/pointer.go +++ b/vendor/github.com/onsi/gomega/gstruct/pointer.go @@ -1,3 +1,5 @@ +// untested sections: 3 + package gstruct import ( diff --git a/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go b/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go index cdab233eb..a233e48c0 100644 --- a/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go +++ b/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package asyncassertion import ( diff --git a/vendor/github.com/onsi/gomega/matchers.go b/vendor/github.com/onsi/gomega/matchers.go index c3a326dd4..9ec8893cb 100644 --- a/vendor/github.com/onsi/gomega/matchers.go +++ b/vendor/github.com/onsi/gomega/matchers.go @@ -269,6 +269,22 @@ func ContainElement(element interface{}) types.GomegaMatcher { } } +//BeElementOf succeeds if actual is contained in the passed in elements. +//BeElementOf() always uses Equal() to perform the match. +//When the passed in elements are comprised of a single element that is either an Array or Slice, BeElementOf() behaves +//as the reverse of ContainElement() that operates with Equal() to perform the match. +// Expect(2).Should(BeElementOf([]int{1, 2})) +// Expect(2).Should(BeElementOf([2]int{1, 2})) +//Otherwise, BeElementOf() provides a syntactic sugar for Or(Equal(_), Equal(_), ...): +// Expect(2).Should(BeElementOf(1, 2)) +// +//Actual must be typed. +func BeElementOf(elements ...interface{}) types.GomegaMatcher { + return &matchers.BeElementOfMatcher{ + Elements: elements, + } +} + //ConsistOf succeeds if actual contains precisely the elements passed into the matcher. The ordering of the elements does not matter. //By default ConsistOf() uses Equal() to match the elements, however custom matchers can be passed in instead. Here are some examples: // diff --git a/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go b/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go index 51f8be6ae..be4839520 100644 --- a/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_a_directory.go b/vendor/github.com/onsi/gomega/matchers/be_a_directory.go index 7b6975e41..acffc8570 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_a_directory.go +++ b/vendor/github.com/onsi/gomega/matchers/be_a_directory.go @@ -1,3 +1,5 @@ +// untested sections: 5 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_a_regular_file.go b/vendor/github.com/onsi/gomega/matchers/be_a_regular_file.go index e239131fb..89441c800 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_a_regular_file.go +++ b/vendor/github.com/onsi/gomega/matchers/be_a_regular_file.go @@ -1,3 +1,5 @@ +// untested sections: 5 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go b/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go index d42eba223..ec6506b00 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go +++ b/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go @@ -1,3 +1,5 @@ +// untested sections: 3 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_closed_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_closed_matcher.go index 80c9c8bb1..f13c24490 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_closed_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_closed_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher.go new file mode 100644 index 000000000..1f9d7a8e6 --- /dev/null +++ b/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher.go @@ -0,0 +1,57 @@ +// untested sections: 1 + +package matchers + +import ( + "fmt" + "reflect" + + "github.com/onsi/gomega/format" +) + +type BeElementOfMatcher struct { + Elements []interface{} +} + +func (matcher *BeElementOfMatcher) Match(actual interface{}) (success bool, err error) { + if reflect.TypeOf(actual) == nil { + return false, fmt.Errorf("BeElement matcher expects actual to be typed") + } + + length := len(matcher.Elements) + valueAt := func(i int) interface{} { + return matcher.Elements[i] + } + // Special handling of a single element of type Array or Slice + if length == 1 && isArrayOrSlice(valueAt(0)) { + element := valueAt(0) + value := reflect.ValueOf(element) + length = value.Len() + valueAt = func(i int) interface{} { + return value.Index(i).Interface() + } + } + + var lastError error + for i := 0; i < length; i++ { + matcher := &EqualMatcher{Expected: valueAt(i)} + success, err := matcher.Match(actual) + if err != nil { + lastError = err + continue + } + if success { + return true, nil + } + } + + return false, lastError +} + +func (matcher *BeElementOfMatcher) FailureMessage(actual interface{}) (message string) { + return format.Message(actual, "to be an element of", matcher.Elements) +} + +func (matcher *BeElementOfMatcher) NegatedFailureMessage(actual interface{}) (message string) { + return format.Message(actual, "not to be an element of", matcher.Elements) +} diff --git a/vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go index 8b00311b0..527c1a1c1 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go index 97ab20a4e..263627f40 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_false_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_false_matcher.go index 91d3b779e..e326c0157 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_false_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_false_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_identical_to.go b/vendor/github.com/onsi/gomega/matchers/be_identical_to.go index fdcda4d1f..631ce11e3 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_identical_to.go +++ b/vendor/github.com/onsi/gomega/matchers/be_identical_to.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go index 7ee84fe1b..551d99d74 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import "github.com/onsi/gomega/format" diff --git a/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher.go index 9f4f77eec..f72591a1a 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 4 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_sent_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_sent_matcher.go index 302dd1a0a..cf582a3fc 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_sent_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_sent_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 3 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher.go index cb7c038ef..dec4db024 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 3 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/be_true_matcher.go b/vendor/github.com/onsi/gomega/matchers/be_true_matcher.go index ec57c5db4..60bc1e3fa 100644 --- a/vendor/github.com/onsi/gomega/matchers/be_true_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/be_true_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/consist_of.go b/vendor/github.com/onsi/gomega/matchers/consist_of.go index 7b0e08868..cbbf61802 100644 --- a/vendor/github.com/onsi/gomega/matchers/consist_of.go +++ b/vendor/github.com/onsi/gomega/matchers/consist_of.go @@ -1,3 +1,5 @@ +// untested sections: 3 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/contain_element_matcher.go b/vendor/github.com/onsi/gomega/matchers/contain_element_matcher.go index 4159335d0..8d6c44c7a 100644 --- a/vendor/github.com/onsi/gomega/matchers/contain_element_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/contain_element_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( @@ -22,19 +24,21 @@ func (matcher *ContainElementMatcher) Match(actual interface{}) (success bool, e } value := reflect.ValueOf(actual) - var keys []reflect.Value + var valueAt func(int) interface{} if isMap(actual) { - keys = value.MapKeys() + keys := value.MapKeys() + valueAt = func(i int) interface{} { + return value.MapIndex(keys[i]).Interface() + } + } else { + valueAt = func(i int) interface{} { + return value.Index(i).Interface() + } } + var lastError error for i := 0; i < value.Len(); i++ { - var success bool - var err error - if isMap(actual) { - success, err = elemMatcher.Match(value.MapIndex(keys[i]).Interface()) - } else { - success, err = elemMatcher.Match(value.Index(i).Interface()) - } + success, err := elemMatcher.Match(valueAt(i)) if err != nil { lastError = err continue diff --git a/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go b/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go index f8dc41e74..e725f8c27 100644 --- a/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go b/vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go index 7ace93dc3..9856752f1 100644 --- a/vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/have_key_matcher.go b/vendor/github.com/onsi/gomega/matchers/have_key_matcher.go index ea5b92336..00cffec70 100644 --- a/vendor/github.com/onsi/gomega/matchers/have_key_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/have_key_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 6 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go b/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go index 06355b1e9..4c5916804 100644 --- a/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go @@ -1,3 +1,5 @@ +// untested sections:10 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go b/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go index bef00ae21..5bcfdd2ad 100644 --- a/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 2 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/receive_matcher.go b/vendor/github.com/onsi/gomega/matchers/receive_matcher.go index 2018a6128..1936a2ba5 100644 --- a/vendor/github.com/onsi/gomega/matchers/receive_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/receive_matcher.go @@ -1,3 +1,5 @@ +// untested sections: 3 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/semi_structured_data_support.go b/vendor/github.com/onsi/gomega/matchers/semi_structured_data_support.go index 639295684..1369c1e87 100644 --- a/vendor/github.com/onsi/gomega/matchers/semi_structured_data_support.go +++ b/vendor/github.com/onsi/gomega/matchers/semi_structured_data_support.go @@ -1,3 +1,5 @@ +// untested sections: 5 + package matchers import ( diff --git a/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go b/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go index 8aaf8759d..108f28586 100644 --- a/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go +++ b/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go @@ -1,6 +1,5 @@ package bipartitegraph -import "errors" import "fmt" import . "github.com/onsi/gomega/matchers/support/goraph/node" @@ -28,7 +27,7 @@ func NewBipartiteGraph(leftValues, rightValues []interface{}, neighbours func(in for j, rightValue := range rightValues { neighbours, err := neighbours(leftValue, rightValue) if err != nil { - return nil, errors.New(fmt.Sprintf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error())) + return nil, fmt.Errorf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error()) } if neighbours { diff --git a/vendor/github.com/onsi/gomega/matchers/type_support.go b/vendor/github.com/onsi/gomega/matchers/type_support.go index 75afcd844..dced2419e 100644 --- a/vendor/github.com/onsi/gomega/matchers/type_support.go +++ b/vendor/github.com/onsi/gomega/matchers/type_support.go @@ -6,6 +6,9 @@ See the docs for Gomega for documentation on the matchers http://onsi.github.io/gomega/ */ + +// untested sections: 11 + package matchers import ( diff --git a/vendor/modules.txt b/vendor/modules.txt index 5b9070ab3..ff50ff1dd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -136,6 +136,8 @@ github.com/emicklei/go-restful github.com/emicklei/go-restful/log # github.com/evanphx/json-patch v4.5.0+incompatible github.com/evanphx/json-patch +# github.com/fsnotify/fsnotify v1.4.7 +github.com/fsnotify/fsnotify # github.com/gardener/controller-manager-library v0.1.1-0.20191212112146-917449ad760c github.com/gardener/controller-manager-library/pkg/controllermanager/controller/reconcile/conditions github.com/gardener/controller-manager-library/pkg/ctxutil @@ -178,6 +180,7 @@ github.com/gardener/gardener/pkg/client/kubernetes github.com/gardener/gardener/pkg/controllerutils github.com/gardener/gardener/pkg/controllerutils/metrics github.com/gardener/gardener/pkg/logger +github.com/gardener/gardener/pkg/mock/go/context github.com/gardener/gardener/pkg/operation/common github.com/gardener/gardener/pkg/scheduler github.com/gardener/gardener/pkg/scheduler/apis/config @@ -200,11 +203,23 @@ github.com/gardener/gardener/pkg/utils/validation/cidr github.com/gardener/gardener/pkg/utils/validation/gomega github.com/gardener/gardener/pkg/utils/version github.com/gardener/gardener/pkg/version +github.com/gardener/gardener/test/framework +github.com/gardener/gardener/test/framework/config +github.com/gardener/gardener/test/framework/reporter github.com/gardener/gardener/test/integration/framework github.com/gardener/gardener/test/integration/shoots +# github.com/gardener/gardener-extension-networking-calico v0.0.0-20200129184310-ca90704ba78e +github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico +github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/install +github.com/gardener/gardener-extension-networking-calico/pkg/apis/calico/v1alpha1 +github.com/gardener/gardener-extension-networking-calico/pkg/calico +github.com/gardener/gardener-extension-networking-calico/pkg/charts +github.com/gardener/gardener-extension-networking-calico/pkg/controller +github.com/gardener/gardener-extension-networking-calico/pkg/imagevector # github.com/gardener/gardener-resource-manager v0.9.1-0.20200124091350-6ea41bbae81f github.com/gardener/gardener-resource-manager/pkg/apis/resources github.com/gardener/gardener-resource-manager/pkg/apis/resources/v1alpha1 +github.com/gardener/gardener-resource-manager/pkg/apis/resources/v1alpha1/helper github.com/gardener/gardener-resource-manager/pkg/manager # github.com/gardener/hvpa-controller v0.0.0-20191014062307-fad3bdf06a25 github.com/gardener/hvpa-controller/api/v1alpha1 @@ -319,6 +334,17 @@ github.com/hashicorp/go-multierror # github.com/hashicorp/golang-lru v0.5.3 github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru +# github.com/hashicorp/hcl v1.0.0 +github.com/hashicorp/hcl +github.com/hashicorp/hcl/hcl/ast +github.com/hashicorp/hcl/hcl/parser +github.com/hashicorp/hcl/hcl/printer +github.com/hashicorp/hcl/hcl/scanner +github.com/hashicorp/hcl/hcl/strconv +github.com/hashicorp/hcl/hcl/token +github.com/hashicorp/hcl/json/parser +github.com/hashicorp/hcl/json/scanner +github.com/hashicorp/hcl/json/token # github.com/hpcloud/tail v1.0.0 github.com/hpcloud/tail github.com/hpcloud/tail/ratelimiter @@ -341,6 +367,8 @@ github.com/json-iterator/go github.com/karrick/godirwalk # github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/konsorten/go-windows-terminal-sequences +# github.com/magiconair/properties v1.8.1 +github.com/magiconair/properties # github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63 github.com/mailru/easyjson/buffer github.com/mailru/easyjson/jlexer @@ -359,6 +387,8 @@ github.com/mholt/archiver github.com/mitchellh/copystructure # github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir +# github.com/mitchellh/mapstructure v1.1.2 +github.com/mitchellh/mapstructure # github.com/mitchellh/reflectwalk v1.0.0 github.com/mitchellh/reflectwalk # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd @@ -367,7 +397,7 @@ github.com/modern-go/concurrent github.com/modern-go/reflect2 # github.com/nwaples/rardecode v1.0.0 github.com/nwaples/rardecode -# github.com/onsi/ginkgo v1.8.0 +# github.com/onsi/ginkgo v1.10.1 github.com/onsi/ginkgo github.com/onsi/ginkgo/config github.com/onsi/ginkgo/extensions/table @@ -394,7 +424,7 @@ github.com/onsi/ginkgo/reporters/stenographer github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty github.com/onsi/ginkgo/types -# github.com/onsi/gomega v1.5.0 +# github.com/onsi/gomega v1.7.0 github.com/onsi/gomega github.com/onsi/gomega/format github.com/onsi/gomega/gstruct @@ -411,6 +441,8 @@ github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types # github.com/packethost/packngo v0.0.0-20181217122008-b3b45f1b4979 github.com/packethost/packngo +# github.com/pelletier/go-toml v1.2.0 +github.com/pelletier/go-toml # github.com/pierrec/lz4 v2.3.0+incompatible github.com/pierrec/lz4 github.com/pierrec/lz4/internal/xxh32 @@ -439,10 +471,21 @@ github.com/russross/blackfriday/v2 github.com/shurcooL/sanitized_anchor_name # github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus +# github.com/spf13/afero v1.2.2 +github.com/spf13/afero +github.com/spf13/afero/mem +# github.com/spf13/cast v1.3.0 +github.com/spf13/cast # github.com/spf13/cobra v0.0.5 github.com/spf13/cobra +# github.com/spf13/jwalterweatherman v1.0.0 +github.com/spf13/jwalterweatherman # github.com/spf13/pflag v1.0.5 github.com/spf13/pflag +# github.com/spf13/viper v1.6.1 +github.com/spf13/viper +# github.com/subosito/gotenv v1.2.0 +github.com/subosito/gotenv # github.com/ulikunitz/xz v0.5.6 github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash