From 74126847a55d28410f1aef75e7ecdc6d9e46f8ce Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Thu, 2 May 2019 13:24:23 -0700 Subject: [PATCH] Update cluster-api release-0.1 vendor (#750) Signed-off-by: Vince Prignano --- Gopkg.lock | 12 +- cmd/clusterctl/examples/aws/generate-yaml.sh | 5 + .../aws/machine-deployment.yaml.template | 27 +++ .../examples/aws/machines-ha.yaml.template | 17 -- pkg/cloud/aws/services/ec2/instances.go | 19 +- vendor/k8s.io/component-base/LICENSE | 202 ++++++++++++++++++ .../component-base/cli/flag/BUILD.bazel | 28 +++ .../cli/flag/ciphersuites_flag.go | 105 +++++++++ .../colon_separated_multimap_string_string.go | 102 +++++++++ .../cli/flag/configuration_map.go | 53 +++++ .../k8s.io/component-base/cli/flag/flags.go | 54 +++++ .../langle_separated_map_string_string.go | 82 +++++++ .../cli/flag/map_string_bool.go | 90 ++++++++ .../cli/flag/map_string_string.go | 112 ++++++++++ .../cli/flag/namedcertkey_flag.go | 113 ++++++++++ vendor/k8s.io/component-base/cli/flag/noop.go | 41 ++++ .../component-base/cli/flag/omitempty.go | 24 +++ .../component-base/cli/flag/sectioned.go | 79 +++++++ .../component-base/cli/flag/string_flag.go | 56 +++++ .../component-base/cli/flag/tristate.go | 83 +++++++ vendor/sigs.k8s.io/cluster-api/Dockerfile | 2 +- vendor/sigs.k8s.io/cluster-api/Gopkg.lock | 15 +- vendor/sigs.k8s.io/cluster-api/Makefile | 4 +- vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES | 11 +- .../sigs.k8s.io/cluster-api/SECURITY_CONTACTS | 4 +- vendor/sigs.k8s.io/cluster-api/WORKSPACE | 10 +- .../cluster-api/cmd/clusterctl/README.md | 3 + .../bootstrap/minikube/minikube.go | 2 +- .../clusterclient/clusterclient.go | 16 +- .../cmd/clusterctl/cmd/BUILD.bazel | 1 + .../cluster-api/cmd/clusterctl/cmd/root.go | 2 + .../phases/createbootstrapcluster.go | 2 +- ...create-cluster-no-args-invalid-flag.golden | 12 +- .../testdata/create-cluster-no-args.golden | 12 +- .../create-no-args-invalid-flag.golden | 12 +- .../clusterctl/testdata/create-no-args.golden | 12 +- ...delete-cluster-no-args-invalid-flag.golden | 12 +- .../testdata/delete-cluster-no-args.golden | 12 +- .../delete-no-args-invalid-flag.golden | 12 +- .../clusterctl/testdata/delete-no-args.golden | 12 +- .../testdata/no-args-invalid-flag.golden | 12 +- .../cmd/clusterctl/testdata/no-args.golden | 12 +- ...lidate-cluster-no-args-invalid-flag.golden | 12 +- .../validate-no-args-invalid-flag.golden | 12 +- .../testdata/validate-no-args.golden | 12 +- .../cluster-api/cmd/manager/main.go | 9 +- .../config/crds/cluster_v1alpha1_machine.yaml | 24 ++- .../cluster_v1alpha1_machinedeployment.yaml | 10 +- .../crds/cluster_v1alpha1_machineset.yaml | 10 +- .../cluster-api/config/rbac/rbac_role.yaml | 2 + vendor/sigs.k8s.io/cluster-api/hack/sed.sh | 29 +++ .../cluster-api/hack/update-bazel.sh | 7 +- .../cluster-api/hack/verify_clientset.sh | 3 +- .../apis/cluster/v1alpha1/machine_types.go | 1 + .../pkg/controller/machine/controller.go | 4 +- .../machinedeployment/controller.go | 76 +++---- .../pkg/controller/machineset/controller.go | 10 +- .../pkg/controller/machineset/status.go | 2 +- .../pkg/controller/noderefutil/util.go | 2 +- .../sigs.k8s.io/cluster-api/pkg/util/util.go | 21 +- .../cluster-api/scripts/ci-build.sh | 4 +- .../cluster-api/scripts/ci-integration.sh | 8 +- .../scripts/ci-is-vendor-in-sync.sh | 4 +- .../cluster-api/scripts/ci-make.sh | 4 +- .../cluster-api/scripts/ci-test.sh | 4 +- .../cluster-api/scripts/fetch_ext_bins.sh | 2 - 66 files changed, 1566 insertions(+), 202 deletions(-) create mode 100644 cmd/clusterctl/examples/aws/machine-deployment.yaml.template create mode 100644 vendor/k8s.io/component-base/LICENSE create mode 100644 vendor/k8s.io/component-base/cli/flag/BUILD.bazel create mode 100644 vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go create mode 100644 vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go create mode 100644 vendor/k8s.io/component-base/cli/flag/configuration_map.go create mode 100644 vendor/k8s.io/component-base/cli/flag/flags.go create mode 100644 vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go create mode 100644 vendor/k8s.io/component-base/cli/flag/map_string_bool.go create mode 100644 vendor/k8s.io/component-base/cli/flag/map_string_string.go create mode 100644 vendor/k8s.io/component-base/cli/flag/namedcertkey_flag.go create mode 100644 vendor/k8s.io/component-base/cli/flag/noop.go create mode 100644 vendor/k8s.io/component-base/cli/flag/omitempty.go create mode 100644 vendor/k8s.io/component-base/cli/flag/sectioned.go create mode 100644 vendor/k8s.io/component-base/cli/flag/string_flag.go create mode 100644 vendor/k8s.io/component-base/cli/flag/tristate.go create mode 100755 vendor/sigs.k8s.io/cluster-api/hack/sed.sh diff --git a/Gopkg.lock b/Gopkg.lock index 9670ca5e11..953d094602 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1074,6 +1074,14 @@ pruneopts = "UT" revision = "1ee79a9ecd464778e01acf39100bbb3acbaa86d4" +[[projects]] + branch = "master" + digest = "1:dc54d24e166e75a89145883b6080306f5684db2e8ab7a068625f010dee604c6e" + name = "k8s.io/component-base" + packages = ["cli/flag"] + pruneopts = "UT" + revision = "9fe063da3132df1f14a39226ca80374b9fc22ec9" + [[projects]] branch = "master" digest = "1:28514fabca4356625720ffb012408790a9d00d31963a9bd9daf7b5ccd894c301" @@ -1138,7 +1146,7 @@ [[projects]] branch = "release-0.1" - digest = "1:d92175fcffa434a7440cee734b886f32f586dfb6413702b08b25f701662b2bbb" + digest = "1:544e478bb32f15bbaeef4a44c3db17863552b3afd6e33f25ad8771ea62881afc" name = "sigs.k8s.io/cluster-api" packages = [ "cmd/clusterctl/clientcmd", @@ -1166,7 +1174,7 @@ "pkg/util", ] pruneopts = "T" - revision = "560b000be51c1dc371c901ab84af8070bc29e8dc" + revision = "2186e24916f7dd57deb490c19bd453ac4ebfa711" [[projects]] digest = "1:4e97dc637c467531240326f56e253c6d42b519424b6a89d80664ef0f3ed4f721" diff --git a/cmd/clusterctl/examples/aws/generate-yaml.sh b/cmd/clusterctl/examples/aws/generate-yaml.sh index 18b8440a22..8b1f4b10bd 100755 --- a/cmd/clusterctl/examples/aws/generate-yaml.sh +++ b/cmd/clusterctl/examples/aws/generate-yaml.sh @@ -40,6 +40,8 @@ MACHINES_TEMPLATE_FILE=${DIR}/machines.yaml.template MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines.yaml HA_MACHINES_TEMPLATE_FILE=${DIR}/machines-ha.yaml.template HA_MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines-ha.yaml +DEPLOYMENT_MACHINES_TEMPLATE_FILE=${DIR}/machine-deployment.yaml.template +DEPLOYMENT_MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machine-deployment.yaml ADDONS_FILE=${OUTPUT_DIR}/addons.yaml PROVIDER_COMPONENTS_SRC=${DIR}/provider-components-base.yaml PROVIDER_COMPONENTS_FILE=${OUTPUT_DIR}/provider-components.yaml @@ -106,6 +108,9 @@ echo "Done generating ${MACHINES_GENERATED_FILE}" $ENVSUBST < $HA_MACHINES_TEMPLATE_FILE > "${HA_MACHINES_GENERATED_FILE}" echo "Done generating ${HA_MACHINES_GENERATED_FILE}" +$ENVSUBST < $DEPLOYMENT_MACHINES_TEMPLATE_FILE > "${DEPLOYMENT_MACHINES_GENERATED_FILE}" +echo "Done generating ${DEPLOYMENT_MACHINES_GENERATED_FILE}" + cp ${DIR}/addons.yaml ${ADDONS_FILE} echo "Done copying ${ADDONS_FILE}" diff --git a/cmd/clusterctl/examples/aws/machine-deployment.yaml.template b/cmd/clusterctl/examples/aws/machine-deployment.yaml.template new file mode 100644 index 0000000000..1a10a15509 --- /dev/null +++ b/cmd/clusterctl/examples/aws/machine-deployment.yaml.template @@ -0,0 +1,27 @@ +apiVersion: "cluster.k8s.io/v1alpha1" +kind: MachineDeployment +metadata: + name: sample-machinedeployment + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} +spec: + replicas: 1 + selector: + matchLabels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: node + template: + metadata: + labels: + cluster.k8s.io/cluster-name: ${CLUSTER_NAME} + set: node + spec: + versions: + kubelet: v1.13.5 + providerSpec: + value: + apiVersion: awsprovider/v1alpha1 + kind: AWSMachineProviderSpec + instanceType: "${NODE_MACHINE_TYPE}" + iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" + keyName: "${SSH_KEY_NAME}" diff --git a/cmd/clusterctl/examples/aws/machines-ha.yaml.template b/cmd/clusterctl/examples/aws/machines-ha.yaml.template index e669889bb9..e7bb2fad99 100644 --- a/cmd/clusterctl/examples/aws/machines-ha.yaml.template +++ b/cmd/clusterctl/examples/aws/machines-ha.yaml.template @@ -55,20 +55,3 @@ items: instanceType: "${CONTROL_PLANE_MACHINE_TYPE}" iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" keyName: "${SSH_KEY_NAME}" - - apiVersion: "cluster.k8s.io/v1alpha1" - kind: Machine - metadata: - generateName: node- - labels: - cluster.k8s.io/cluster-name: ${CLUSTER_NAME} - set: node - spec: - versions: - kubelet: v1.13.5 - providerSpec: - value: - apiVersion: awsprovider/v1alpha1 - kind: AWSMachineProviderSpec - instanceType: "${NODE_MACHINE_TYPE}" - iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" - keyName: "${SSH_KEY_NAME}" diff --git a/pkg/cloud/aws/services/ec2/instances.go b/pkg/cloud/aws/services/ec2/instances.go index aaa2a926ee..6c816010da 100644 --- a/pkg/cloud/aws/services/ec2/instances.go +++ b/pkg/cloud/aws/services/ec2/instances.go @@ -19,8 +19,10 @@ package ec2 import ( "bytes" "compress/gzip" + "context" "encoding/base64" "strings" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" @@ -437,13 +439,20 @@ func (s *Service) runInstance(role string, i *v1alpha1.Instance) (*v1alpha1.Inst return nil, errors.Errorf("no instance returned for reservation %v", out.GoString()) } - s.scope.V(2).Info("Waiting for instance to run", "instance-id", *out.Instances[0].InstanceId) - err = s.scope.EC2.WaitUntilInstanceRunningWithContext( - aws.BackgroundContext(), + waitTimeout := 1 * time.Minute + s.scope.V(2).Info("Waiting for instance to be in running state", "instance-id", *out.Instances[0].InstanceId, "timeout", waitTimeout.String()) + ctx, cancel := context.WithTimeout(aws.BackgroundContext(), waitTimeout) + defer cancel() + + if err := s.scope.EC2.WaitUntilInstanceRunningWithContext( + ctx, &ec2.DescribeInstancesInput{InstanceIds: []*string{out.Instances[0].InstanceId}}, request.WithWaiterLogger(&awslog{s.scope.Logger}), - ) - return converters.SDKToInstance(out.Instances[0]), err + ); err != nil { + s.scope.V(2).Info("Could not determine if Machine is running. Machine state might be unavailable until next renconciliation.") + } + + return converters.SDKToInstance(out.Instances[0]), nil } // An internal type to satisfy aws' log interface. diff --git a/vendor/k8s.io/component-base/LICENSE b/vendor/k8s.io/component-base/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/vendor/k8s.io/component-base/LICENSE @@ -0,0 +1,202 @@ + + 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. diff --git a/vendor/k8s.io/component-base/cli/flag/BUILD.bazel b/vendor/k8s.io/component-base/cli/flag/BUILD.bazel new file mode 100644 index 0000000000..78b437887d --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "ciphersuites_flag.go", + "colon_separated_multimap_string_string.go", + "configuration_map.go", + "flags.go", + "langle_separated_map_string_string.go", + "map_string_bool.go", + "map_string_string.go", + "namedcertkey_flag.go", + "noop.go", + "omitempty.go", + "sectioned.go", + "string_flag.go", + "tristate.go", + ], + importmap = "sigs.k8s.io/cluster-api-provider-aws/vendor/k8s.io/component-base/cli/flag", + importpath = "k8s.io/component-base/cli/flag", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) diff --git a/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go b/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go new file mode 100644 index 0000000000..764747c259 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go @@ -0,0 +1,105 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "crypto/tls" + "fmt" + + "k8s.io/apimachinery/pkg/util/sets" +) + +// ciphers maps strings into tls package cipher constants in +// https://golang.org/pkg/crypto/tls/#pkg-constants +var ciphers = map[string]uint16{ + "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, + "TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA, + "TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256, + "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, +} + +func TLSCipherPossibleValues() []string { + cipherKeys := sets.NewString() + for key := range ciphers { + cipherKeys.Insert(key) + } + return cipherKeys.List() +} + +func TLSCipherSuites(cipherNames []string) ([]uint16, error) { + if len(cipherNames) == 0 { + return nil, nil + } + ciphersIntSlice := make([]uint16, 0) + for _, cipher := range cipherNames { + intValue, ok := ciphers[cipher] + if !ok { + return nil, fmt.Errorf("Cipher suite %s not supported or doesn't exist", cipher) + } + ciphersIntSlice = append(ciphersIntSlice, intValue) + } + return ciphersIntSlice, nil +} + +var versions = map[string]uint16{ + "VersionTLS10": tls.VersionTLS10, + "VersionTLS11": tls.VersionTLS11, + "VersionTLS12": tls.VersionTLS12, +} + +func TLSPossibleVersions() []string { + versionsKeys := sets.NewString() + for key := range versions { + versionsKeys.Insert(key) + } + return versionsKeys.List() +} + +func TLSVersion(versionName string) (uint16, error) { + if len(versionName) == 0 { + return DefaultTLSVersion(), nil + } + if version, ok := versions[versionName]; ok { + return version, nil + } + return 0, fmt.Errorf("unknown tls version %q", versionName) +} + +func DefaultTLSVersion() uint16 { + // Can't use SSLv3 because of POODLE and BEAST + // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher + // Can't use TLSv1.1 because of RC4 cipher usage + return tls.VersionTLS12 +} diff --git a/vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go b/vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go new file mode 100644 index 0000000000..bd2cf5f875 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/colon_separated_multimap_string_string.go @@ -0,0 +1,102 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "fmt" + "sort" + "strings" +) + +// ColonSeparatedMultimapStringString supports setting a map[string][]string from an encoding +// that separates keys from values with ':' and separates key-value pairs with ','. +// A key can be repeated multiple times, in which case the values are appended to a +// slice of strings associated with that key. Items in the list associated with a given +// key will appear in the order provided. +// For example: `a:hello,b:again,c:world,b:beautiful` results in `{"a": ["hello"], "b": ["again", "beautiful"], "c": ["world"]}` +// The first call to Set will clear the map before adding entries; subsequent calls will simply append to the map. +// This makes it possible to override default values with a command-line option rather than appending to defaults, +// while still allowing the distribution of key-value pairs across multiple flag invocations. +// For example: `--flag "a:hello" --flag "b:again" --flag "b:beautiful" --flag "c:world"` results in `{"a": ["hello"], "b": ["again", "beautiful"], "c": ["world"]}` +type ColonSeparatedMultimapStringString struct { + Multimap *map[string][]string + initialized bool // set to true after the first Set call +} + +// NewColonSeparatedMultimapStringString takes a pointer to a map[string][]string and returns the +// ColonSeparatedMultimapStringString flag parsing shim for that map. +func NewColonSeparatedMultimapStringString(m *map[string][]string) *ColonSeparatedMultimapStringString { + return &ColonSeparatedMultimapStringString{Multimap: m} +} + +// Set implements github.com/spf13/pflag.Value +func (m *ColonSeparatedMultimapStringString) Set(value string) error { + if m.Multimap == nil { + return fmt.Errorf("no target (nil pointer to map[string][]string)") + } + if !m.initialized || *m.Multimap == nil { + // clear default values, or allocate if no existing map + *m.Multimap = make(map[string][]string) + m.initialized = true + } + for _, pair := range strings.Split(value, ",") { + if len(pair) == 0 { + continue + } + kv := strings.SplitN(pair, ":", 2) + if len(kv) != 2 { + return fmt.Errorf("malformed pair, expect string:string") + } + k := strings.TrimSpace(kv[0]) + v := strings.TrimSpace(kv[1]) + (*m.Multimap)[k] = append((*m.Multimap)[k], v) + } + return nil +} + +// String implements github.com/spf13/pflag.Value +func (m *ColonSeparatedMultimapStringString) String() string { + type kv struct { + k string + v string + } + kvs := make([]kv, 0, len(*m.Multimap)) + for k, vs := range *m.Multimap { + for i := range vs { + kvs = append(kvs, kv{k: k, v: vs[i]}) + } + } + // stable sort by keys, order of values should be preserved + sort.SliceStable(kvs, func(i, j int) bool { + return kvs[i].k < kvs[j].k + }) + pairs := make([]string, 0, len(kvs)) + for i := range kvs { + pairs = append(pairs, fmt.Sprintf("%s:%s", kvs[i].k, kvs[i].v)) + } + return strings.Join(pairs, ",") +} + +// Type implements github.com/spf13/pflag.Value +func (m *ColonSeparatedMultimapStringString) Type() string { + return "colonSeparatedMultimapStringString" +} + +// Empty implements OmitEmpty +func (m *ColonSeparatedMultimapStringString) Empty() bool { + return len(*m.Multimap) == 0 +} diff --git a/vendor/k8s.io/component-base/cli/flag/configuration_map.go b/vendor/k8s.io/component-base/cli/flag/configuration_map.go new file mode 100644 index 0000000000..911b05ec6c --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/configuration_map.go @@ -0,0 +1,53 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "fmt" + "sort" + "strings" +) + +type ConfigurationMap map[string]string + +func (m *ConfigurationMap) String() string { + pairs := []string{} + for k, v := range *m { + pairs = append(pairs, fmt.Sprintf("%s=%s", k, v)) + } + sort.Strings(pairs) + return strings.Join(pairs, ",") +} + +func (m *ConfigurationMap) Set(value string) error { + for _, s := range strings.Split(value, ",") { + if len(s) == 0 { + continue + } + arr := strings.SplitN(s, "=", 2) + if len(arr) == 2 { + (*m)[strings.TrimSpace(arr[0])] = strings.TrimSpace(arr[1]) + } else { + (*m)[strings.TrimSpace(arr[0])] = "" + } + } + return nil +} + +func (*ConfigurationMap) Type() string { + return "mapStringString" +} diff --git a/vendor/k8s.io/component-base/cli/flag/flags.go b/vendor/k8s.io/component-base/cli/flag/flags.go new file mode 100644 index 0000000000..d0fff8db2e --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/flags.go @@ -0,0 +1,54 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + goflag "flag" + "strings" + + "github.com/spf13/pflag" + "k8s.io/klog" +) + +// WordSepNormalizeFunc changes all flags that contain "_" separators +func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + if strings.Contains(name, "_") { + return pflag.NormalizedName(strings.Replace(name, "_", "-", -1)) + } + return pflag.NormalizedName(name) +} + +// WarnWordSepNormalizeFunc changes and warns for flags that contain "_" separators +func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { + if strings.Contains(name, "_") { + nname := strings.Replace(name, "_", "-", -1) + klog.Warningf("%s is DEPRECATED and will be removed in a future version. Use %s instead.", name, nname) + + return pflag.NormalizedName(nname) + } + return pflag.NormalizedName(name) +} + +// InitFlags normalizes, parses, then logs the command line flags +func InitFlags() { + pflag.CommandLine.SetNormalizeFunc(WordSepNormalizeFunc) + pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) + pflag.Parse() + pflag.VisitAll(func(flag *pflag.Flag) { + klog.V(2).Infof("FLAG: --%s=%q", flag.Name, flag.Value) + }) +} diff --git a/vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go b/vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go new file mode 100644 index 0000000000..bf8dbfb9bf --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/langle_separated_map_string_string.go @@ -0,0 +1,82 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "fmt" + "sort" + "strings" +) + +// LangleSeparatedMapStringString can be set from the command line with the format `--flag "string 0 { + s = s + ":" + strings.Join(nkc.Names, ",") + } + return s +} + +func (nkc *NamedCertKey) Set(value string) error { + cs := strings.SplitN(value, ":", 2) + var keycert string + if len(cs) == 2 { + var names string + keycert, names = strings.TrimSpace(cs[0]), strings.TrimSpace(cs[1]) + if names == "" { + return errors.New("empty names list is not allowed") + } + nkc.Names = nil + for _, name := range strings.Split(names, ",") { + nkc.Names = append(nkc.Names, strings.TrimSpace(name)) + } + } else { + nkc.Names = nil + keycert = strings.TrimSpace(cs[0]) + } + cs = strings.Split(keycert, ",") + if len(cs) != 2 { + return errors.New("expected comma separated certificate and key file paths") + } + nkc.CertFile = strings.TrimSpace(cs[0]) + nkc.KeyFile = strings.TrimSpace(cs[1]) + return nil +} + +func (*NamedCertKey) Type() string { + return "namedCertKey" +} + +// NamedCertKeyArray is a flag value parsing NamedCertKeys, each passed with its own +// flag instance (in contrast to comma separated slices). +type NamedCertKeyArray struct { + value *[]NamedCertKey + changed bool +} + +var _ flag.Value = &NamedCertKey{} + +// NewNamedKeyCertArray creates a new NamedCertKeyArray with the internal value +// pointing to p. +func NewNamedCertKeyArray(p *[]NamedCertKey) *NamedCertKeyArray { + return &NamedCertKeyArray{ + value: p, + } +} + +func (a *NamedCertKeyArray) Set(val string) error { + nkc := NamedCertKey{} + err := nkc.Set(val) + if err != nil { + return err + } + if !a.changed { + *a.value = []NamedCertKey{nkc} + a.changed = true + } else { + *a.value = append(*a.value, nkc) + } + return nil +} + +func (a *NamedCertKeyArray) Type() string { + return "namedCertKey" +} + +func (a *NamedCertKeyArray) String() string { + nkcs := make([]string, 0, len(*a.value)) + for i := range *a.value { + nkcs = append(nkcs, (*a.value)[i].String()) + } + return "[" + strings.Join(nkcs, ";") + "]" +} diff --git a/vendor/k8s.io/component-base/cli/flag/noop.go b/vendor/k8s.io/component-base/cli/flag/noop.go new file mode 100644 index 0000000000..03f7f14c0b --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/noop.go @@ -0,0 +1,41 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + goflag "flag" + "github.com/spf13/pflag" +) + +// NoOp implements goflag.Value and plfag.Value, +// but has a noop Set implementation +type NoOp struct{} + +var _ goflag.Value = NoOp{} +var _ pflag.Value = NoOp{} + +func (NoOp) String() string { + return "" +} + +func (NoOp) Set(val string) error { + return nil +} + +func (NoOp) Type() string { + return "NoOp" +} diff --git a/vendor/k8s.io/component-base/cli/flag/omitempty.go b/vendor/k8s.io/component-base/cli/flag/omitempty.go new file mode 100644 index 0000000000..c354754ea7 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/omitempty.go @@ -0,0 +1,24 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +// OmitEmpty is an interface for flags to report whether their underlying value +// is "empty." If a flag implements OmitEmpty and returns true for a call to Empty(), +// it is assumed that flag may be omitted from the command line. +type OmitEmpty interface { + Empty() bool +} diff --git a/vendor/k8s.io/component-base/cli/flag/sectioned.go b/vendor/k8s.io/component-base/cli/flag/sectioned.go new file mode 100644 index 0000000000..493a6c0f0f --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/sectioned.go @@ -0,0 +1,79 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "bytes" + "fmt" + "io" + "strings" + + "github.com/spf13/pflag" +) + +// NamedFlagSets stores named flag sets in the order of calling FlagSet. +type NamedFlagSets struct { + // Order is an ordered list of flag set names. + Order []string + // FlagSets stores the flag sets by name. + FlagSets map[string]*pflag.FlagSet +} + +// FlagSet returns the flag set with the given name and adds it to the +// ordered name list if it is not in there yet. +func (nfs *NamedFlagSets) FlagSet(name string) *pflag.FlagSet { + if nfs.FlagSets == nil { + nfs.FlagSets = map[string]*pflag.FlagSet{} + } + if _, ok := nfs.FlagSets[name]; !ok { + nfs.FlagSets[name] = pflag.NewFlagSet(name, pflag.ExitOnError) + nfs.Order = append(nfs.Order, name) + } + return nfs.FlagSets[name] +} + +// PrintSections prints the given names flag sets in sections, with the maximal given column number. +// If cols is zero, lines are not wrapped. +func PrintSections(w io.Writer, fss NamedFlagSets, cols int) { + for _, name := range fss.Order { + fs := fss.FlagSets[name] + if !fs.HasFlags() { + continue + } + + wideFS := pflag.NewFlagSet("", pflag.ExitOnError) + wideFS.AddFlagSet(fs) + + var zzz string + if cols > 24 { + zzz = strings.Repeat("z", cols-24) + wideFS.Int(zzz, 0, strings.Repeat("z", cols-24)) + } + + var buf bytes.Buffer + fmt.Fprintf(&buf, "\n%s flags:\n\n%s", strings.ToUpper(name[:1])+name[1:], wideFS.FlagUsagesWrapped(cols)) + + if cols > 24 { + i := strings.Index(buf.String(), zzz) + lines := strings.Split(buf.String()[:i], "\n") + fmt.Fprint(w, strings.Join(lines[:len(lines)-1], "\n")) + fmt.Fprintln(w) + } else { + fmt.Fprint(w, buf.String()) + } + } +} diff --git a/vendor/k8s.io/component-base/cli/flag/string_flag.go b/vendor/k8s.io/component-base/cli/flag/string_flag.go new file mode 100644 index 0000000000..331bdb66e2 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/string_flag.go @@ -0,0 +1,56 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +// StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not. +type StringFlag struct { + // If Set has been invoked this value is true + provided bool + // The exact value provided on the flag + value string +} + +func NewStringFlag(defaultVal string) StringFlag { + return StringFlag{value: defaultVal} +} + +func (f *StringFlag) Default(value string) { + f.value = value +} + +func (f StringFlag) String() string { + return f.value +} + +func (f StringFlag) Value() string { + return f.value +} + +func (f *StringFlag) Set(value string) error { + f.value = value + f.provided = true + + return nil +} + +func (f StringFlag) Provided() bool { + return f.provided +} + +func (f *StringFlag) Type() string { + return "string" +} diff --git a/vendor/k8s.io/component-base/cli/flag/tristate.go b/vendor/k8s.io/component-base/cli/flag/tristate.go new file mode 100644 index 0000000000..cf16376bf9 --- /dev/null +++ b/vendor/k8s.io/component-base/cli/flag/tristate.go @@ -0,0 +1,83 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flag + +import ( + "fmt" + "strconv" +) + +// Tristate is a flag compatible with flags and pflags that +// keeps track of whether it had a value supplied or not. +type Tristate int + +const ( + Unset Tristate = iota // 0 + True + False +) + +func (f *Tristate) Default(value bool) { + *f = triFromBool(value) +} + +func (f Tristate) String() string { + b := boolFromTri(f) + return fmt.Sprintf("%t", b) +} + +func (f Tristate) Value() bool { + b := boolFromTri(f) + return b +} + +func (f *Tristate) Set(value string) error { + boolVal, err := strconv.ParseBool(value) + if err != nil { + return err + } + + *f = triFromBool(boolVal) + return nil +} + +func (f Tristate) Provided() bool { + if f != Unset { + return true + } + return false +} + +func (f *Tristate) Type() string { + return "tristate" +} + +func boolFromTri(t Tristate) bool { + if t == True { + return true + } else { + return false + } +} + +func triFromBool(b bool) Tristate { + if b { + return True + } else { + return False + } +} diff --git a/vendor/sigs.k8s.io/cluster-api/Dockerfile b/vendor/sigs.k8s.io/cluster-api/Dockerfile index e89f319d02..bca9820330 100644 --- a/vendor/sigs.k8s.io/cluster-api/Dockerfile +++ b/vendor/sigs.k8s.io/cluster-api/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Build the manager binary -FROM golang:1.11.6 as builder +FROM golang:1.12.3 as builder # Copy in the go src WORKDIR $GOPATH/src/sigs.k8s.io/cluster-api diff --git a/vendor/sigs.k8s.io/cluster-api/Gopkg.lock b/vendor/sigs.k8s.io/cluster-api/Gopkg.lock index 724e64ff24..dad988a854 100644 --- a/vendor/sigs.k8s.io/cluster-api/Gopkg.lock +++ b/vendor/sigs.k8s.io/cluster-api/Gopkg.lock @@ -1079,6 +1079,14 @@ pruneopts = "UT" revision = "3a2206dd6a78497deceb3ae058417fdeb2036c7e" +[[projects]] + branch = "master" + digest = "1:dc54d24e166e75a89145883b6080306f5684db2e8ab7a068625f010dee604c6e" + name = "k8s.io/component-base" + packages = ["cli/flag"] + pruneopts = "UT" + revision = "fd5d14dd6d20b9f3b0c066e2702d877b0b8c049f" + [[projects]] branch = "master" digest = "1:28514fabca4356625720ffb012408790a9d00d31963a9bd9daf7b5ccd894c301" @@ -1096,12 +1104,12 @@ revision = "f8a0810f38afb8478882b3835a615aebfda39afa" [[projects]] - digest = "1:e2999bf1bb6eddc2a6aa03fe5e6629120a53088926520ca3b4765f77d7ff7eab" + digest = "1:c696379ad201c1e86591785579e16bf6cf886c362e9a7534e8eb0d1028b20582" name = "k8s.io/klog" packages = ["."] pruneopts = "UT" - revision = "a5bc97fbc634d635061f3146511332c7e313a55a" - version = "v0.1.0" + revision = "e531227889390a39d9533dde61f590fe9f4b0035" + version = "v0.3.0" [[projects]] branch = "master" @@ -1254,6 +1262,7 @@ "k8s.io/code-generator/cmd/deepcopy-gen", "k8s.io/code-generator/cmd/informer-gen", "k8s.io/code-generator/cmd/lister-gen", + "k8s.io/component-base/cli/flag", "k8s.io/klog", "sigs.k8s.io/controller-runtime/pkg/client", "sigs.k8s.io/controller-runtime/pkg/client/config", diff --git a/vendor/sigs.k8s.io/cluster-api/Makefile b/vendor/sigs.k8s.io/cluster-api/Makefile index 178bc617ee..760743f7e4 100644 --- a/vendor/sigs.k8s.io/cluster-api/Makefile +++ b/vendor/sigs.k8s.io/cluster-api/Makefile @@ -111,7 +111,7 @@ clean: ## Remove all generated files docker-build: generate fmt vet manifests ## Build the docker image for controller-manager docker build . -t ${CONTROLLER_IMG} @echo "updating kustomize image patch file for manager resource" - sed -i.tmp -e 's@image: .*@image: '"${CONTROLLER_IMG}"'@' ./config/default/manager_image_patch.yaml + hack/sed.sh -i.tmp -e 's@image: .*@image: '"${CONTROLLER_IMG}"'@' ./config/default/manager_image_patch.yaml .PHONY: docker-push docker-push: docker-build ## Push the docker image @@ -121,7 +121,7 @@ docker-push: docker-build ## Push the docker image docker-build-ci: generate fmt vet manifests ## Build the docker image for example provider docker build . -f ./pkg/provider/example/container/Dockerfile -t ${EXAMPLE_PROVIDER_IMG} @echo "updating kustomize image patch file for ci" - sed -i.tmp -e 's@image: .*@image: '"${EXAMPLE_PROVIDER_IMG}"'@' ./config/ci/manager_image_patch.yaml + hack/sed.sh -i.tmp -e 's@image: .*@image: '"${EXAMPLE_PROVIDER_IMG}"'@' ./config/ci/manager_image_patch.yaml .PHONY: docker-push-ci docker-push-ci: docker-build-ci ## Build the docker image for ci diff --git a/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES b/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES index d8f6e3cea8..e7059b003e 100644 --- a/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES +++ b/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES @@ -3,16 +3,13 @@ aliases: sig-cluster-lifecycle-leads: - luxas - - roberthbailey + - justinsb - timothysc cluster-api-admins: - justinsb - - kris-nova - - krousey - - luxas - - roberthbailey + - detiber + - davidewatson cluster-api-maintainers: - justinsb - - krousey - - roberthbailey + - detiber - vincepri diff --git a/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS b/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS index 6867576631..7da23c405f 100644 --- a/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS +++ b/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS @@ -10,7 +10,7 @@ # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ -lukemarsden +detiber +justinsb luxas -roberthbailey timothysc diff --git a/vendor/sigs.k8s.io/cluster-api/WORKSPACE b/vendor/sigs.k8s.io/cluster-api/WORKSPACE index 710510fb0e..c442a2afb1 100644 --- a/vendor/sigs.k8s.io/cluster-api/WORKSPACE +++ b/vendor/sigs.k8s.io/cluster-api/WORKSPACE @@ -3,8 +3,8 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") http_archive( name = "io_bazel_rules_go", - sha256 = "77dfd303492f2634de7a660445ee2d3de2960cbd52f97d8c0dffa9362d3ddef9", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.1/rules_go-0.18.1.tar.gz", + sha256 = "86ae934bd4c43b99893fc64be9d9fc684b81461581df7ea8fc291c816f5ee8c5", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.3/rules_go-0.18.3.tar.gz", ) http_archive( @@ -18,7 +18,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe go_rules_dependencies() go_register_toolchains( - go_version = "1.11.6", + go_version = "1.12.3", ) load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") @@ -27,13 +27,13 @@ gazelle_dependencies() go_repository( name = "io_k8s_sigs_kustomize", - commit = "58492e2d83c59ed63881311f46ad6251f77dabc3", importpath = "sigs.k8s.io/kustomize", + tag = "v1.0.11", ) go_repository( name = "com_github_golangci_golangci-lint", build_file_generation = "on", importpath = "github.com/golangci/golangci-lint", - tag = "v1.15.0", + tag = "v1.16.0", ) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md index 33f2baba3e..e9ef1f4372 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md @@ -50,6 +50,9 @@ If you are using minikube, to choose a specific minikube driver, please use the Additional advanced flags can be found via help. +Also, some environment variables are supported: +`CLUSTER_API_MACHINE_READY_TIMEOUT`: set this value to adjust the timeout value in minutes for a machine to become ready, The default timeout is currently 30 minutes, `export CLUSTER_API_MACHINE_READY_TIMEOUT=45` will extend the timeout value to 45 minutes. + ```shell ./clusterctl create cluster --help ``` diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go index 272bb939ec..bb9044a10d 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go @@ -61,7 +61,7 @@ func WithOptionsAndKubeConfigPath(options []string, kubeconfigpath string) *Mini } return true }() { - options = append(options, fmt.Sprintf("p=%s", minikubeClusterName)) + options = append(options, fmt.Sprintf("profile=%s", minikubeClusterName)) } return &Minikube{ diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go index dad6b5f0b9..3511982c82 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go @@ -55,6 +55,10 @@ const ( machineClusterLabelName = "cluster.k8s.io/cluster-name" ) +const ( + TimeoutMachineReady = "CLUSTER_API_MACHINE_READY_TIMEOUT" +) + // Provides interaction with a cluster type Client interface { Apply(string) error @@ -968,7 +972,17 @@ func waitForClusterResourceReady(cs clientset.Interface) error { } func waitForMachineReady(cs clientset.Interface, machine *clusterv1.Machine) error { - err := util.PollImmediate(retryIntervalResourceReady, timeoutMachineReady, func() (bool, error) { + timeout := timeoutMachineReady + if p := os.Getenv(TimeoutMachineReady); p != "" { + t, err := strconv.Atoi(p) + if err == nil { + // only valid value will be used + timeout = time.Duration(t) * time.Minute + klog.V(4).Info("Setting wait for machine timeout value to ", timeout) + } + } + + err := util.PollImmediate(retryIntervalResourceReady, timeout, func() (bool, error) { klog.V(2).Infof("Waiting for Machine %v to become ready...", machine.Name) m, err := cs.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) if err != nil { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel index 3400abec03..fc4d206d85 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel @@ -33,6 +33,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", + "//vendor/k8s.io/component-base/cli/flag:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd:go_default_library", "//vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go index 8266a6030b..b584efb165 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go @@ -22,6 +22,7 @@ import ( "os" "github.com/spf13/cobra" + cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog" ) @@ -54,6 +55,7 @@ func exitWithHelp(cmd *cobra.Command, err string) { func init() { klog.InitFlags(flag.CommandLine) flag.CommandLine.Set("logtostderr", "true") + RootCmd.SetGlobalNormalizationFunc(cliflag.WordSepNormalizeFunc) RootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine) InitLogs() } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go index 2b4cdce6d8..9c6643651b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go @@ -24,7 +24,7 @@ import ( ) func CreateBootstrapCluster(provisioner bootstrap.ClusterProvisioner, cleanupBootstrapCluster bool, clientFactory clusterclient.Factory) (clusterclient.Client, func(), error) { - klog.Info("Creating bootstrap cluster") + klog.Info("Preparing bootstrap cluster") cleanupFn := func() {} if err := provisioner.Create(); err != nil { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden index d1dae5312d..4e89d69d1b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden @@ -19,15 +19,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden index 520a03db65..c3b2f2d266 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden @@ -19,15 +19,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging required flag(s) "cluster", "machines", "provider", "provider-components" not set diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden index c13e2242f3..b6ca97cd1b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl create [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden index 436766ad1e..5369b32f31 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden @@ -12,15 +12,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl create [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden index dc7a15fb36..4c2c40b13d 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden @@ -16,15 +16,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden index 3eaea4c89b..82e0add99b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden @@ -18,13 +18,15 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden index 2641ea0f98..54ed0e0ebc 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl delete [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden index a0f13986cf..86cc1d355e 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden @@ -12,15 +12,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl delete [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden index d96b83c831..cbe4f8e4ef 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden @@ -14,15 +14,17 @@ Flags: --alsologtostderr log to standard error as well as files -h, --help help for clusterctl --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden index 3394e22f28..005a7c359f 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden @@ -15,15 +15,17 @@ Flags: --alsologtostderr log to standard error as well as files -h, --help help for clusterctl --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden index 75243978ba..9ca44dee7c 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden index fe1fd2036a..9435739423 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden @@ -11,15 +11,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl validate [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden index ba24210517..e88396b032 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden +++ b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden @@ -12,15 +12,17 @@ Flags: Global Flags: --alsologtostderr log to standard error as well as files --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-backtrace-at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log-dir string If non-empty, write log files in this directory + --log-file string If non-empty, use this log file + --log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --log_file string If non-empty, use this log file --logtostderr log to standard error instead of files (default true) --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --skip_headers If true, avoid header prefixes in the log messages + --skip-headers If true, avoid header prefixes in the log messages + --skip-log-headers If true, avoid headers when openning log files --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs + -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "clusterctl validate [command] --help" for more information about a command. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go b/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go index e46e7cbde1..f10eb99060 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go +++ b/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go @@ -33,8 +33,14 @@ import ( func main() { flag.Set("logtostderr", "true") klog.InitFlags(nil) - flag.Parse() + watchNamespace := flag.String("namespace", "", + "Namespace that the controller watches to reconcile cluster-api objects. If unspecified, the controller watches for cluster-api objects across all namespaces.") + flag.Parse() + if *watchNamespace != "" { + log.Printf("Watching cluster-api objects only in namespace %q for reconciliation.", *watchNamespace) + } + log.Printf("Registering Components.") // Get a config to talk to the apiserver cfg, err := config.GetConfig() if err != nil { @@ -45,6 +51,7 @@ func main() { syncPeriod := 10 * time.Minute mgr, err := manager.New(cfg, manager.Options{ SyncPeriod: &syncPeriod, + Namespace: *watchNamespace, }) if err != nil { log.Fatal(err) diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml index 8b77b8ffd8..ecc0f00fac 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml @@ -15,6 +15,11 @@ spec: description: Machine status such as Terminating/Pending/Running/Failed etc name: Phase type: string + - JSONPath: .status.nodeRef.name + description: Node name associated with this machine + name: NodeName + priority: 1 + type: string group: cluster.k8s.io names: kind: Machine @@ -61,11 +66,11 @@ spec: could not get registered as Kubernetes nodes. With cluster-api as a generic out-of-tree provider for autoscaler, this field is required by autoscaler to be able to have a provider view of the list of machines. - Another list of nodes is queried from the k8s apiserver and then comparison - is done to find out unregistered machines and are marked for delete. - This field will be set by the actuators and consumed by higher level - entities like autoscaler that will be interfacing with cluster-api - as generic provider. + Another list of nodes is queried from the k8s apiserver and then a + comparison is done to find out unregistered machines and are marked + for delete. This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing with + cluster-api as generic provider. type: string providerSpec: description: ProviderSpec details Provider-specific configuration to @@ -93,9 +98,12 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints to apply - to the corresponding Node. This list will overwrite any modifications - made to the Node on an ongoing basis. + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any other taints + added to the Node on an ongoing basis by other entities. These taints + should be actively reconciled e.g. if you ask the machine controller + to apply a taint and then manually remove the taint the machine controller + will put it back) but not have the machine controller remove any taints items: type: object type: array diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml index 488d76a3d3..8532253447 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -181,9 +181,13 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints - to apply to the corresponding Node. This list will overwrite - any modifications made to the Node on an ongoing basis. + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any taints items: type: object type: array diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml index fb69e27543..73fda8c335 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml @@ -130,9 +130,13 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints - to apply to the corresponding Node. This list will overwrite - any modifications made to the Node on an ongoing basis. + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any taints items: type: object type: array diff --git a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml b/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml index f47b06161c..90cbd805e0 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml +++ b/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml @@ -42,6 +42,7 @@ rules: - cluster.k8s.io resources: - machinedeployments + - machinedeployments/status verbs: - get - list @@ -54,6 +55,7 @@ rules: - cluster.k8s.io resources: - machinesets + - machinesets/status verbs: - get - list diff --git a/vendor/sigs.k8s.io/cluster-api/hack/sed.sh b/vendor/sigs.k8s.io/cluster-api/hack/sed.sh new file mode 100755 index 0000000000..680b184bda --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/hack/sed.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh +# Copyright 2019 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# this script is a drop in wrapper around gnu-sed that will attempt to only +# use gnu sed (as opposed to E.G. the default sed on macOS) + +# darwin is great +SED="sed" +if command -v gsed >/dev/null 2>&1; then + SED="gsed" +fi +if ! (${SED} --version 2>&1 | grep -q GNU); then + echo "!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'." >&2 + exit 1 +fi + +"${SED}" "$@" diff --git a/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh b/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh index b32b850967..a00bd54e3d 100755 --- a/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh +++ b/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh @@ -17,8 +17,9 @@ set -o errexit set -o nounset set -o pipefail -export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +export KUBE_ROOT -cd $KUBE_ROOT -find $KUBE_ROOT/vendor -name 'BUILD' -delete +cd "${KUBE_ROOT}" +find "${KUBE_ROOT}/vendor" -name 'BUILD' -delete bazel run //:gazelle diff --git a/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh b/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh index 939c873481..8554bbac04 100755 --- a/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh +++ b/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh @@ -18,11 +18,12 @@ set -o errexit set -o nounset set -o pipefail -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. DIFFROOT="${SCRIPT_ROOT}/pkg/client" TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" _tmp="${SCRIPT_ROOT}/_tmp" GOPATH=$(go env GOPATH) +export GOPATH cleanup() { rm -rf "${_tmp}" diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go index 427e7a3036..ac5623bad3 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go @@ -40,6 +40,7 @@ const ( // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" +// +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 type Machine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go index 3b657c1c9a..d8fba73f8a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go @@ -163,7 +163,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul } if !r.isDeleteAllowed(m) { - klog.Infof("Skipping reconciling of machine %q", name) + klog.Infof("Deleting machine hosting this controller is not allowed. Skipping reconciliation of machine %q", name) return reconcile.Result{}, nil } @@ -235,7 +235,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul func (r *ReconcileMachine) getCluster(ctx context.Context, machine *clusterv1.Machine) (*clusterv1.Cluster, error) { if machine.Labels[clusterv1.MachineClusterLabelName] == "" { - klog.Infof("Machine %q in namespace %q doesn't specify %q label, assuming nil cluster", machine.Name, clusterv1.MachineClusterLabelName, machine.Namespace) + klog.Infof("Machine %q in namespace %q doesn't specify %q label, assuming nil cluster", machine.Name, machine.Namespace, clusterv1.MachineClusterLabelName) return nil, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go index 939dea58d6..3fa7a4848a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go @@ -92,7 +92,9 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu return err } - // Map MachineSet changes to MachineDeployment. + // Watch for changes to MachineSets using a mapping function to MachineDeployment. + // This watcher is required for use cases like adoption. In case a MachineSet doesn't have + // a controller reference, it'll look for potential matching MachineDeployments to reconcile. err = c.Watch( &source.Kind{Type: &v1alpha1.MachineSet{}}, &handler.EnqueueRequestsFromMapFunc{ToRequests: mapFn}, @@ -160,7 +162,7 @@ func (r *ReconcileMachineDeployment) adoptOrphan(deployment *v1alpha1.MachineDep // Reconcile reads that state of the cluster for a MachineDeployment object and makes changes based on the state read // and what is in the MachineDeployment.Spec -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinedeployments,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinedeployments;machinedeployments/status,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineDeployment instance d := &v1alpha1.MachineDeployment{} @@ -272,7 +274,7 @@ func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1alpha1. func (r *ReconcileMachineDeployment) getCluster(d *v1alpha1.MachineDeployment) (*v1alpha1.Cluster, error) { if d.Spec.Template.Labels[v1alpha1.MachineClusterLabelName] == "" { - klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, v1alpha1.MachineClusterLabelName, d.Namespace) + klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, d.Namespace, v1alpha1.MachineClusterLabelName) return nil, nil } @@ -289,39 +291,6 @@ func (r *ReconcileMachineDeployment) getCluster(d *v1alpha1.MachineDeployment) ( return cluster, nil } -// getMachineDeploymentsForMachineSet returns a list of Deployments that potentially -// match a MachineSet. -func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha1.MachineSet) []*v1alpha1.MachineDeployment { - if len(ms.Labels) == 0 { - klog.Warningf("No machine deployments found for MachineSet %v because it has no labels", ms.Name) - return nil - } - - dList := &v1alpha1.MachineDeploymentList{} - listOptions := &client.ListOptions{Namespace: ms.Namespace} - if err := r.Client.List(context.Background(), listOptions, dList); err != nil { - klog.Warningf("Failed to list machine deployments: %v", err) - return nil - } - - deployments := make([]*v1alpha1.MachineDeployment, 0, len(dList.Items)) - for idx, d := range dList.Items { - selector, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) - if err != nil { - continue - } - - // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. - if selector.Empty() || !selector.Matches(labels.Set(ms.Labels)) { - continue - } - - deployments = append(deployments, &dList.Items[idx]) - } - - return deployments -} - // getMachineMapForDeployment returns the Machines managed by a Deployment. // // It returns a map from MachineSet UID to a list of Machines controlled by that MS, @@ -367,6 +336,39 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach return machineMap, nil } +// getMachineDeploymentsForMachineSet returns a list of Deployments that potentially +// match a MachineSet. +func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha1.MachineSet) []*v1alpha1.MachineDeployment { + if len(ms.Labels) == 0 { + klog.Warningf("No machine deployments found for MachineSet %v because it has no labels", ms.Name) + return nil + } + + dList := &v1alpha1.MachineDeploymentList{} + listOptions := &client.ListOptions{Namespace: ms.Namespace} + if err := r.Client.List(context.Background(), listOptions, dList); err != nil { + klog.Warningf("Failed to list machine deployments: %v", err) + return nil + } + + deployments := make([]*v1alpha1.MachineDeployment, 0, len(dList.Items)) + for idx, d := range dList.Items { + selector, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) + if err != nil { + continue + } + + // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. + if selector.Empty() || !selector.Matches(labels.Set(ms.Labels)) { + continue + } + + deployments = append(deployments, &dList.Items[idx]) + } + + return deployments +} + func (r *ReconcileMachineDeployment) MachineSetToDeployments(o handler.MapObject) []reconcile.Request { result := []reconcile.Request{} @@ -377,6 +379,8 @@ func (r *ReconcileMachineDeployment) MachineSetToDeployments(o handler.MapObject return nil } + // Check if the controller reference is already set and + // return an empty result when one is found. for _, ref := range ms.ObjectMeta.OwnerReferences { if ref.Controller != nil && *ref.Controller { return result diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go index b61030c530..86d0c8cbb5 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go @@ -140,7 +140,7 @@ func (r *ReconcileMachineSet) MachineToMachineSets(o handler.MapObject) []reconc // Reconcile reads that state of the cluster for a MachineSet object and makes changes based on the state read // and what is in the MachineSet.Spec // Automatically generate RBAC rules to allow the Controller to read and write Deployments -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinesets,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinesets;machinesets/status,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=cluster.k8s.io,resources=machines,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineSet instance @@ -251,6 +251,10 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster return reconcile.Result{}, errors.Wrap(err, "failed to update machine set status") } + if syncErr != nil { + return reconcile.Result{}, errors.Wrapf(syncErr, "failed to sync Machineset replicas") + } + var replicas int32 if updatedMS.Spec.Replicas != nil { replicas = *updatedMS.Spec.Replicas @@ -263,7 +267,7 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster // exceeds MinReadySeconds could be incorrect. // To avoid an available replica stuck in the ready state, we force a reconcile after MinReadySeconds, // at which point it should confirm any available replica to be available. - if syncErr == nil && updatedMS.Spec.MinReadySeconds > 0 && + if updatedMS.Spec.MinReadySeconds > 0 && updatedMS.Status.ReadyReplicas == replicas && updatedMS.Status.AvailableReplicas != replicas { @@ -275,7 +279,7 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *cluster func (r *ReconcileMachineSet) getCluster(ms *clusterv1alpha1.MachineSet) (*clusterv1alpha1.Cluster, error) { if ms.Spec.Template.Labels[clusterv1alpha1.MachineClusterLabelName] == "" { - klog.Infof("MachineSet %q in namespace %q doesn't specify %q label, assuming nil cluster", ms.Name, clusterv1alpha1.MachineClusterLabelName, ms.Namespace) + klog.Infof("MachineSet %q in namespace %q doesn't specify %q label, assuming nil cluster", ms.Name, ms.Namespace, clusterv1alpha1.MachineClusterLabelName) return nil, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go index c22b19ffb7..645d0dbb8c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go @@ -112,7 +112,7 @@ func updateMachineSetStatus(c client.Client, ms *v1alpha1.MachineSet, newStatus break } // Update the MachineSet with the latest resource version for the next poll - if getErr = c.Get(context.Background(), client.ObjectKey{Name: ms.Name}, ms); getErr != nil { + if getErr = c.Get(context.Background(), client.ObjectKey{Namespace: ms.Namespace, Name: ms.Name}, ms); getErr != nil { // If the GET fails we can't trust status.Replicas anymore. This error // is bound to be more interesting than the update failure. return nil, getErr diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go index a5bf0b8422..d7dd79b8db 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go @@ -60,7 +60,7 @@ func GetReadyCondition(status *corev1.NodeStatus) *corev1.NodeCondition { // IsNodeReady returns true if a node is ready; false otherwise. func IsNodeReady(node *corev1.Node) bool { - if node == nil || &node.Status == nil { + if node == nil { return false } for _, c := range node.Status.Conditions { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go b/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go index b6bd7d926e..519b2add7f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go @@ -85,16 +85,6 @@ func GetControlPlaneMachines(machines []*clusterv1.Machine) (res []*clusterv1.Ma return } -// MachineP converts a slice of machines into a slice of machine pointers. -func MachineP(machines []clusterv1.Machine) []*clusterv1.Machine { - // Convert to list of pointers - ret := make([]*clusterv1.Machine, 0, len(machines)) - for _, machine := range machines { - ret = append(ret, machine.DeepCopy()) - } - return ret -} - // Home returns the user home directory. func Home() string { home := os.Getenv("HOME") @@ -247,8 +237,7 @@ func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error) { var ( bytes [][]byte machineList clusterv1.MachineList - machine clusterv1.Machine - machines = []clusterv1.Machine{} + machines = []*clusterv1.Machine{} ) // TODO: use the universal decoder instead of doing this. @@ -264,7 +253,8 @@ func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error) { if err := json.Unmarshal(ml, &machineList); err != nil { return nil, err } - for _, machine := range machineList.Items { + for i := range machineList.Items { + machine := &machineList.Items[i] if machine.APIVersion == "" || machine.Kind == "" { return nil, errors.New(MachineListFormatDeprecationMessage) } @@ -282,13 +272,14 @@ func ParseMachinesYaml(file string) ([]*clusterv1.Machine, error) { } for _, m := range bytes { - if err := json.Unmarshal(m, &machine); err != nil { + machine := &clusterv1.Machine{} + if err := json.Unmarshal(m, machine); err != nil { return nil, err } machines = append(machines, machine) } - return MachineP(machines), nil + return machines, nil } // isMissingKind reimplements runtime.IsMissingKind as the YAMLOrJSONDecoder diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh index 132ec82607..fbd9fca082 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh @@ -18,6 +18,6 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT && make manager clusterctl +cd "$REPO_ROOT" && make manager clusterctl diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh index 5d664c3369..2222f2189b 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-integration.sh @@ -21,6 +21,7 @@ set -o pipefail MAKE="make" KUSTOMIZE="kustomize" KUBECTL="kubectl" +KUBECTL_VERSION="v1.13.2" CRD_YAML="crd.yaml" BOOTSTRAP_CLUSTER_NAME="clusterapi-bootstrap" CONTROLLER_REPO="controller-ci" # use arbitrary repo name since we don't need to publish it @@ -32,13 +33,13 @@ install_kustomize() { } install_kubectl() { - wget https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubectl \ + wget https://storage.googleapis.com/kubernetes-release/release/"${KUBECTL_VERSION}"/bin/linux/amd64/kubectl \ --no-verbose -O /usr/local/bin/kubectl chmod +x /usr/local/bin/kubectl } build_containers() { - VERSION=$(git describe --exact-match 2> /dev/null || git describe --match=$(git rev-parse --short=8 HEAD) --always --dirty --abbrev=8) + VERSION="$(git describe --exact-match 2> /dev/null || git describe --match="$(git rev-parse --short=8 HEAD)" --always --dirty --abbrev=8)" CONTROLLER_IMG="${CONTROLLER_REPO}:${VERSION}" EXAMPLE_PROVIDER_IMG="${EXAMPLE_PROVIDER_REPO}:${VERSION}" export CONTROLLER_IMG="${CONTROLLER_IMG}" @@ -58,7 +59,8 @@ prepare_crd_yaml() { create_bootstrap() { go get sigs.k8s.io/kind kind create cluster --name "${BOOTSTRAP_CLUSTER_NAME}" - export KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")" + KUBECONFIG="$(kind get kubeconfig-path --name="${BOOTSTRAP_CLUSTER_NAME}")" + export KUBECONFIG kind load docker-image "${CONTROLLER_IMG}" --name "${BOOTSTRAP_CLUSTER_NAME}" kind load docker-image "${EXAMPLE_PROVIDER_IMG}" --name "${BOOTSTRAP_CLUSTER_NAME}" diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh index 71c11a718a..d4d04d9355 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh @@ -18,8 +18,8 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT +cd "$REPO_ROOT" find vendor -name 'BUILD.bazel' -delete dep check diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh index 7c55a20df6..542f741cb9 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh @@ -18,6 +18,6 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT && make lint-full docker-build +cd "$REPO_ROOT" && make lint-full docker-build diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh b/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh index 909cf60128..a697bc3b86 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh @@ -18,9 +18,9 @@ set -o errexit set -o nounset set -o pipefail -REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. +REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -cd $REPO_ROOT && \ +cd "$REPO_ROOT" && \ source ./scripts/fetch_ext_bins.sh && \ fetch_tools && \ setup_envs && \ diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh b/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh index 7b0f29173e..fcb4aa7e70 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh +++ b/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh @@ -59,11 +59,9 @@ function header_text { echo "$header$*$reset" } -rc=0 tmp_root=/tmp kb_root_dir=$tmp_root/kubebuilder -kb_orig=$(pwd) # Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable # in your environment to any value: