Hello community, here is the log from the commit of package kubic-control for openSUSE:Factory checked in at 2019-04-19 18:38:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kubic-control (Old) and /work/SRC/openSUSE:Factory/.kubic-control.new.5536 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kubic-control" Fri Apr 19 18:38:59 2019 rev:2 rq:695675 version:0.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/kubic-control/kubic-control.changes 2019-04-18 13:58:32.975997711 +0200 +++ /work/SRC/openSUSE:Factory/.kubic-control.new.5536/kubic-control.changes 2019-04-19 18:39:24.503262848 +0200 @@ -1,0 +2,7 @@ +Thu Apr 18 14:40:20 CEST 2019 - [email protected] + +- Release version 0.2.1 + - kubicctl: use admin certificates if there are no root user + certificates + +------------------------------------------------------------------- Old: ---- kubic-control-0.2.0.tar.xz New: ---- kubic-control-0.2.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kubic-control.spec ++++++ --- /var/tmp/diff_new_pack.iiwZo6/_old 2019-04-19 18:39:26.479265358 +0200 +++ /var/tmp/diff_new_pack.iiwZo6/_new 2019-04-19 18:39:26.515265404 +0200 @@ -17,15 +17,15 @@ Name: kubic-control -Version: 0.2.0 +Version: 0.2.1 Release: 0 Summary: Simple setup tool for kubernetes License: Apache-2.0 Group: System/Management URL: https://github.com/thkukuk/kubic-control Source: %{name}-%{version}.tar.xz -BuildRequires: golang(API) >= 1.12 BuildRequires: golang-packaging +BuildRequires: golang(API) >= 1.12 ExcludeArch: s390 %{go_nostrip} @@ -34,6 +34,7 @@ %package -n kubicd Summary: Daemon to setup a kubernetes cluster +Group: System/Management Requires: kubicctl Requires: salt-master @@ -42,6 +43,7 @@ %package -n kubicctl Summary: Cli for kubicd to setup and manage kubernetes +Group: System/Management Requires: certstrap %description -n kubicctl ++++++ kubic-control-0.2.0.tar.xz -> kubic-control-0.2.1.tar.xz ++++++ Binary files old/kubic-control-0.2.0/.git/index and new/kubic-control-0.2.1/.git/index differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/.git/logs/HEAD new/kubic-control-0.2.1/.git/logs/HEAD --- old/kubic-control-0.2.0/.git/logs/HEAD 2019-04-16 15:50:21.801801459 +0200 +++ new/kubic-control-0.2.1/.git/logs/HEAD 2019-04-18 14:39:41.592935299 +0200 @@ -1 +1 @@ -0000000000000000000000000000000000000000 02cfb06685013a9b6a38b31ab421c3b37f3ae3cb Thorsten Kukuk <[email protected]> 1555422621 +0200 clone: from https://github.com/thkukuk/kubic-control +0000000000000000000000000000000000000000 6665a06488a12d17faf5d0e0d47295d6e96b8b3e Thorsten Kukuk <[email protected]> 1555591181 +0200 clone: from https://github.com/thkukuk/kubic-control diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/.git/logs/refs/heads/master new/kubic-control-0.2.1/.git/logs/refs/heads/master --- old/kubic-control-0.2.0/.git/logs/refs/heads/master 2019-04-16 15:50:21.801801459 +0200 +++ new/kubic-control-0.2.1/.git/logs/refs/heads/master 2019-04-18 14:39:41.592935299 +0200 @@ -1 +1 @@ -0000000000000000000000000000000000000000 02cfb06685013a9b6a38b31ab421c3b37f3ae3cb Thorsten Kukuk <[email protected]> 1555422621 +0200 clone: from https://github.com/thkukuk/kubic-control +0000000000000000000000000000000000000000 6665a06488a12d17faf5d0e0d47295d6e96b8b3e Thorsten Kukuk <[email protected]> 1555591181 +0200 clone: from https://github.com/thkukuk/kubic-control diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/.git/logs/refs/remotes/origin/HEAD new/kubic-control-0.2.1/.git/logs/refs/remotes/origin/HEAD --- old/kubic-control-0.2.0/.git/logs/refs/remotes/origin/HEAD 2019-04-16 15:50:21.801801459 +0200 +++ new/kubic-control-0.2.1/.git/logs/refs/remotes/origin/HEAD 2019-04-18 14:39:41.592935299 +0200 @@ -1 +1 @@ -0000000000000000000000000000000000000000 02cfb06685013a9b6a38b31ab421c3b37f3ae3cb Thorsten Kukuk <[email protected]> 1555422621 +0200 clone: from https://github.com/thkukuk/kubic-control +0000000000000000000000000000000000000000 6665a06488a12d17faf5d0e0d47295d6e96b8b3e Thorsten Kukuk <[email protected]> 1555591181 +0200 clone: from https://github.com/thkukuk/kubic-control Binary files old/kubic-control-0.2.0/.git/objects/pack/pack-0f1ac7fd4fb3681a0ce1774b3b8c14294d45959a.idx and new/kubic-control-0.2.1/.git/objects/pack/pack-0f1ac7fd4fb3681a0ce1774b3b8c14294d45959a.idx differ Binary files old/kubic-control-0.2.0/.git/objects/pack/pack-0f1ac7fd4fb3681a0ce1774b3b8c14294d45959a.pack and new/kubic-control-0.2.1/.git/objects/pack/pack-0f1ac7fd4fb3681a0ce1774b3b8c14294d45959a.pack differ Binary files old/kubic-control-0.2.0/.git/objects/pack/pack-a6007c132993c72fc484c0cc5ad73cab05f65a68.idx and new/kubic-control-0.2.1/.git/objects/pack/pack-a6007c132993c72fc484c0cc5ad73cab05f65a68.idx differ Binary files old/kubic-control-0.2.0/.git/objects/pack/pack-a6007c132993c72fc484c0cc5ad73cab05f65a68.pack and new/kubic-control-0.2.1/.git/objects/pack/pack-a6007c132993c72fc484c0cc5ad73cab05f65a68.pack differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/.git/packed-refs new/kubic-control-0.2.1/.git/packed-refs --- old/kubic-control-0.2.0/.git/packed-refs 2019-04-16 15:50:21.801801459 +0200 +++ new/kubic-control-0.2.1/.git/packed-refs 2019-04-18 14:39:41.592935299 +0200 @@ -1,4 +1,5 @@ # pack-refs with: peeled fully-peeled sorted -02cfb06685013a9b6a38b31ab421c3b37f3ae3cb refs/remotes/origin/master +6665a06488a12d17faf5d0e0d47295d6e96b8b3e refs/remotes/origin/master 11f0daf7e39c6c8ca826819b9fa230952c167fc4 refs/tags/v0.1.0 02cfb06685013a9b6a38b31ab421c3b37f3ae3cb refs/tags/v0.2.0 +6665a06488a12d17faf5d0e0d47295d6e96b8b3e refs/tags/v0.2.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/.git/refs/heads/master new/kubic-control-0.2.1/.git/refs/heads/master --- old/kubic-control-0.2.0/.git/refs/heads/master 2019-04-16 15:50:21.801801459 +0200 +++ new/kubic-control-0.2.1/.git/refs/heads/master 2019-04-18 14:39:41.592935299 +0200 @@ -1 +1 @@ -02cfb06685013a9b6a38b31ab421c3b37f3ae3cb +6665a06488a12d17faf5d0e0d47295d6e96b8b3e diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/VERSION new/kubic-control-0.2.1/VERSION --- old/kubic-control-0.2.0/VERSION 2019-04-16 15:50:21.805801473 +0200 +++ new/kubic-control-0.2.1/VERSION 2019-04-18 14:39:41.596935314 +0200 @@ -1 +1 @@ -0.2.0 +0.2.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kubic-control-0.2.0/pkg/kubicctl/root.go new/kubic-control-0.2.1/pkg/kubicctl/root.go --- old/kubic-control-0.2.0/pkg/kubicctl/root.go 2019-04-16 15:50:21.805801473 +0200 +++ new/kubic-control-0.2.1/pkg/kubicctl/root.go 2019-04-18 14:39:41.596935314 +0200 @@ -18,6 +18,7 @@ "crypto/tls" "crypto/x509" "io/ioutil" + "os" log "github.com/sirupsen/logrus" "google.golang.org/grpc" @@ -27,6 +28,12 @@ "github.com/thkukuk/kubic-control/pkg/certificates" ) +const ( + root_crtFile = "/etc/kubicd/pki/admin.crt" + root_keyFile = "/etc/kubicd/pki/admin.key" + root_caFile = "/etc/kubicd/pki/Kubic-Control-CA.crt" +) + var ( Version = "unreleased" servername = "localhost" @@ -38,7 +45,30 @@ caFile = "~/.config/kubicctl/Kubic-Control-CA.crt" ) +// exists returns whether the given file or directory exists +func exists(path string) (bool, error) { + _, err := os.Stat(path) + if err == nil { return true, nil } + if os.IsNotExist(err) { return false, nil } + return true, err +} + func Execute() error { + + // if called as root, use admin certificates as default if local + // ones don't exit + if os.Getuid() == 0 { + crt, err := homedir.Expand(crtFile) + if err == nil { + found, _ := exists (crt) + if found == false { + crtFile = root_crtFile + keyFile = root_keyFile + caFile = root_caFile + } + } + } + rootCmd := &cobra.Command{ Use: "kubicctl", Short: "Kubic Control Daemon Interface"}
