k8s: Silence download utilities 00/92100/1
authorPawel Wieczorek <p.wieczorek2@samsung.com>
Fri, 26 Jul 2019 11:29:50 +0000 (13:29 +0200)
committerPawel Wieczorek <p.wieczorek2@samsung.com>
Fri, 26 Jul 2019 11:47:46 +0000 (13:47 +0200)
This patch intends to make virtual environment creation logs more
readable. Parameters were chosen in a way errors will still be shown the
operator.

This patch might also prove itself useful in other virtual environment
creation tools such as 'devtool' [1] (unless maintainers insist on
having full logs).

[1] https://git.onap.org/integration/devtool

Issue-ID: SECCOM-235
Change-Id: I5e07b1b1ed37d36470c18ba0cfe653e40eff300b
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
test/security/k8s/tools/config/dot_curlrc [new file with mode: 0644]
test/security/k8s/tools/config/dot_wgetrc [new file with mode: 0644]
test/security/k8s/vagrant/dublin/Vagrantfile

diff --git a/test/security/k8s/tools/config/dot_curlrc b/test/security/k8s/tools/config/dot_curlrc
new file mode 100644 (file)
index 0000000..ecf9792
--- /dev/null
@@ -0,0 +1,8 @@
+# Disable progress meter
+--silent
+# Show error messages
+--show-error
+# Fail silently on server errors
+--fail
+# Follow redirections
+--location
diff --git a/test/security/k8s/tools/config/dot_wgetrc b/test/security/k8s/tools/config/dot_wgetrc
new file mode 100644 (file)
index 0000000..ac472b7
--- /dev/null
@@ -0,0 +1,2 @@
+# Turn off output
+quiet = on
index abef9f8..e7fe6b1 100644 (file)
@@ -16,6 +16,12 @@ cluster = [
 
 all = cluster.dup << operation
 
+$link_dotfiles = <<-SCRIPT
+  for rc in /vagrant/dot_*; do
+    ln -sf "$rc" "${HOME}/.${rc##*dot_}"
+  done
+SCRIPT
+
 Vagrant.configure('2') do |config|
   all.each do |machine|
     config.vm.define machine[:name] do |config|
@@ -50,6 +56,11 @@ Vagrant.configure('2') do |config|
       end
 
       if machine[:name] == 'operator'
+        config.vm.synced_folder "../../tools/config", "/vagrant", type: "rsync"
+
+        config.vm.provision :shell, run: "always", inline: $link_dotfiles
+        config.vm.provision :shell, run: "always", privileged: false, inline: $link_dotfiles
+
         config.vm.provision :shell, path: "../../tools/dublin/get_rke.sh"
 
         config.vm.provision :shell, inline: <<-SHELL