From 8f7c7e6b413876220c7bbe536aa6e6126c58ba6a Mon Sep 17 00:00:00 2001 From: Roman Mohr Date: Thu, 4 Jan 2018 18:03:26 +0100 Subject: [PATCH] Add support for provider config Give providers a place where they can write their default config values, while still giving people the chance to use hack/cluster-local.sh to override any defaults or provider defaults. Signed-off-by: Roman Mohr --- .gitignore | 2 ++ Vagrantfile | 8 ++++++++ cluster/deploy.sh | 4 ---- cluster/kubectl.sh | 23 ++++------------------- cluster/local/provider.sh | 11 ++++++----- cluster/vagrant/provider.sh | 13 ++++++++----- cluster/vm-isolation-check.sh | 0 hack/build-go.sh | 5 ++++- hack/config-default.sh | 1 + hack/config.sh | 11 ++++++++--- tests/README.md | 6 ++++-- 11 files changed, 45 insertions(+), 39 deletions(-) delete mode 100755 cluster/vm-isolation-check.sh diff --git a/.gitignore b/.gitignore index 5abdb95bfc1f..879421e26659 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,8 @@ tags hack/gen-swagger-doc/*.adoc hack/gen-swagger-doc/*.md hack/gen-swagger-doc/html5 +hack/config-provider-local.sh +hack/config-provider-vagrant.sh cluster/local/certs **.swp **.pem diff --git a/Vagrantfile b/Vagrantfile index 829a927dcc8e..a2c4b929ed6d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,6 +1,14 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +if ARGV.first == "up" && ENV['USING_KUBE_SCRIPTS'] != 'true' + raise Vagrant::Errors::VagrantError.new, <hack/config-local.sh <hack/config-provider-local.sh <${KUBEVIRT_PATH}cluster/vagrant/.kubeconfig + + # Make sure that local config is correct + prepare_config } function prepare_config() { - cat >hack/config-local.sh <hack/config-provider-vagrant.sh <