Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package k3sup for openSUSE:Factory checked 
in at 2022-01-10 23:53:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/k3sup (Old)
 and      /work/SRC/openSUSE:Factory/.k3sup.new.1892 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "k3sup"

Mon Jan 10 23:53:17 2022 rev:2 rq:945267 version:0.11.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/k3sup/k3sup.changes      2021-05-19 
17:49:49.589422329 +0200
+++ /work/SRC/openSUSE:Factory/.k3sup.new.1892/k3sup.changes    2022-01-10 
23:53:41.236808752 +0100
@@ -1,0 +2,41 @@
+Tue Jan 04 13:47:21 UTC 2022 - [email protected]
+
+- Update to version 0.11.2:
+  * Upgrade for K3s HA and fix for merging config on Windows
+    PR #360 Expand --local-path string for Windows by @alexellis
+    PR #359 Added instructions for using --server-user by @cbrachem
+    PR #355 Add --token to HA external datastore command by @Waterdrips
+    PR #354 Build badge with Github CI link by @rashedkvm
+    PR #353 Added GitHub Actions build status using workflow name by @rashedkvm
+    PR #340 Add a blog post to the README by @adyanth
+  * Commits
+    - b3b7106 Expand --local-path string for Windows by @sralloza
+    - 73b7f03 Added instructions for using --server-user by @cbrachem
+    - 080b9cf Add --token to HA external datastore command by @Waterdrips
+    - 38c1dc5 Update README.md by @alexellis
+    - 99811f1 Update README.md by @alexellis
+    - 57e86ae Update README.md by @alexellis
+    - cdcebfb Build badge with Github CI link by @rashedkvm
+    - 40f3ff6 Added build badge using workflow name by @rashedkvm
+    - 2a52d3c Update README.md by @alexellis
+    - 9b6964f Update README.md by @alexellis
+    - b53a140 Update README.md by @alexellis
+    - 9717ee3 Add a blog post to the README by @adyanth
+    - 4c0bbd5 Update pre-reqs in ToC by @alexellis
+    - 89d15f2 Update README with note on passwordless sudo by @alexellis
+    - 2d28f9e Update README.md by @alexellis
+    - 75b863e Update ISSUE_TEMPLATE.md by @alexellis
+    - 26db404 Update .DEREK.yml by @alexellis
+
+-------------------------------------------------------------------
+Tue Jan 04 13:44:57 UTC 2022 - [email protected]
+
+- Update to version 0.11.1:
+  * Set the k3s version to stable
+  * Commits:
+    - 95cf0b1 Set the k3s version to stable by @alexellis
+    - 3315af5 Update README.md by @alexellis
+    - 6fde5ef Fix two ToC links by @alexellis
+    - 337fef3 Update headings and add 2fa note by @alexellis
+
+-------------------------------------------------------------------

Old:
----
  k3sup-0.11.0.tar.gz

New:
----
  k3sup-0.11.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ k3sup.spec ++++++
--- /var/tmp/diff_new_pack.PtEiZU/_old  2022-01-10 23:53:42.272809660 +0100
+++ /var/tmp/diff_new_pack.PtEiZU/_new  2022-01-10 23:53:42.276809663 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package k3sup
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
 
 Name:           k3sup
-Version:        0.11.0
+Version:        0.11.2
 Release:        0
 Summary:        Bootstrap Kubernetes with k3s over SSH < 1 min
 License:        MIT

++++++ _service ++++++
--- /var/tmp/diff_new_pack.PtEiZU/_old  2022-01-10 23:53:42.304809688 +0100
+++ /var/tmp/diff_new_pack.PtEiZU/_new  2022-01-10 23:53:42.304809688 +0100
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/alexellis/k3sup</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">0.11.0</param>
+    <param name="revision">0.11.2</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
     <param name="versionrewrite-pattern">(.*)</param>
@@ -16,7 +16,7 @@
     <param name="compression">gz</param>
   </service>
   <service name="go_modules" mode="disabled">
-    <param name="archive">k3sup-0.11.0.tar.gz</param>
+    <param name="archive">k3sup-0.11.2.tar.gz</param>
   </service>
 </services>
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.PtEiZU/_old  2022-01-10 23:53:42.320809702 +0100
+++ /var/tmp/diff_new_pack.PtEiZU/_new  2022-01-10 23:53:42.324809706 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/alexellis/k3sup</param>
-              <param 
name="changesrevision">3315af5ac39b140849890d8b7bde6f38827f3e6c</param></service></servicedata>
+              <param 
name="changesrevision">b3b7106d00515db78160674cbdb143026c0bbece</param></service></servicedata>
 (No newline at EOF)
 

++++++ k3sup-0.11.0.tar.gz -> k3sup-0.11.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/.DEREK.yml new/k3sup-0.11.2/.DEREK.yml
--- old/k3sup-0.11.0/.DEREK.yml 2021-05-13 23:00:07.000000000 +0200
+++ new/k3sup-0.11.2/.DEREK.yml 2021-12-09 14:31:35.000000000 +0100
@@ -11,6 +11,14 @@
 # - hacktoberfest
 # - no_newbies
 
+required_in_issues:
+  - "## Are you a GitHub Sponsor (Yes/No?)"
+  - "## Expected Behaviour"
+  - "## Current Behaviour"
+  - "## Possible Solution"
+  - "## Steps to Reproduce"
+  - "## Your Environment"
+
 custom_messages:
   - name: k3s
     value: |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/.github/ISSUE_TEMPLATE.md 
new/k3sup-0.11.2/.github/ISSUE_TEMPLATE.md
--- old/k3sup-0.11.0/.github/ISSUE_TEMPLATE.md  2021-05-13 23:00:07.000000000 
+0200
+++ new/k3sup-0.11.2/.github/ISSUE_TEMPLATE.md  2021-12-09 14:31:35.000000000 
+0100
@@ -8,11 +8,19 @@
 <!--- If describing a bug, tell us what happens instead of the expected 
behavior -->
 <!--- If suggesting a change/improvement, explain the difference from current 
behavior -->
 
+## Are you a GitHub Sponsor (Yes/No?)
+
+<!--- Check at https://github.com/sponsors/alexellis -->
+
+- [ ] Yes
+- [ ] No
+
 ## Possible Solution
 <!--- Not obligatory, but suggest a fix/reason for the bug, -->
 <!--- or ideas how to implement the addition or change -->
 
-## Steps to Reproduce (for bugs)
+
+## Steps to Reproduce
 <!--- Provide a link to a live example, or an unambiguous set of steps to -->
 <!--- reproduce this bug. Include code to reproduce, if relevant -->
 1.
@@ -46,8 +54,5 @@
 
 Subject to approval, are you willing to work on a Pull Request for this issue 
or feature request?
 
-Yes/No
-
-## Are you a GitHub Sponsor (Yes/No?)
-
-https://github.com/sponsors/alexellis
+- [ ] Yes
+- [ ] No
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/.gitignore new/k3sup-0.11.2/.gitignore
--- old/k3sup-0.11.0/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/k3sup-0.11.2/.gitignore 2021-12-09 14:31:35.000000000 +0100
@@ -0,0 +1,6 @@
+k3sup
+bin/**
+kubeconfig
+.DS_Store
+.idea/
+mc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/README.md new/k3sup-0.11.2/README.md
--- old/k3sup-0.11.0/README.md  2021-05-13 23:00:07.000000000 +0200
+++ new/k3sup-0.11.2/README.md  2021-12-09 14:31:35.000000000 +0100
@@ -4,16 +4,15 @@
 
 k3sup is a light-weight utility to get from zero to KUBECONFIG with 
[k3s](https://k3s.io/) on any local or remote VM. All you need is `ssh` access 
and the `k3sup` binary to get `kubectl` access immediately.
 
-
 The tool is written in Go and is cross-compiled for Linux, Windows, MacOS and 
even on Raspberry Pi.
 
 How do you say it? Ketchup, as in tomato.
 
-[![Build
-Status](https://travis-ci.com/alexellis/k3sup.svg?branch=master)](https://travis-ci.com/alexellis/k3sup)
+[![Sponsor 
this](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/alexellis)](https://github.com/sponsors/alexellis)
+[![build](https://github.com/alexellis/k3sup/actions/workflows/build.yaml/badge.svg)](https://github.com/alexellis/k3sup/actions/workflows/build.yaml)
 [![Go Report 
Card](https://goreportcard.com/badge/github.com/alexellis/k3sup)](https://goreportcard.com/report/github.com/alexellis/k3sup)
 
[![GoDoc](https://godoc.org/github.com/alexellis/k3sup?status.svg)](https://godoc.org/github.com/alexellis/k3sup)
 [![License: 
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
-![GitHub All 
Releases](https://img.shields.io/github/downloads/alexellis/k3sup/total)
+![Downloads](https://img.shields.io/github/downloads/alexellis/k3sup/total)
 
 ## Contents:
 - [k3sup ???? (said 'ketchup')](#k3sup--said-ketchup)
@@ -25,6 +24,7 @@
   - [Demo ????](#demo-)
   - [Who is the author? ????](#who-is-the-author-)
   - [Usage ???](#usage-)
+    - [Pre-requisites for k3sup agents and 
servers](#pre-requisites-for-k3sup-servers-and-agents)
     - [???? Setup a Kubernetes *server* with 
`k3sup`](#-setup-a-kubernetes-server-with-k3sup)
     - [Advanced KUBECONFIG options](#merging-clusters-into-your-kubeconfig)
     - [???? Join some agents to your Kubernetes 
server](#-join-some-agents-to-your-kubernetes-server)
@@ -108,6 +108,22 @@
 
 The `k3sup` tool is a client application which you can run on your own 
computer. It uses SSH to connect to remote servers and creates a local 
KUBECONFIG file on your disk. Binaries are provided for MacOS, Windows, and 
Linux (including ARM).
 
+## Pre-requisites for k3sup servers and agents
+
+Some Linux hosts are configured to allow `sudo` to run without having to 
repeat your password. For those which are not already configured that way, 
you'll nee to make the following changes if you wish to use `k3sup`:
+
+```bash
+# sudo visudo
+
+# Then add to the bottom of the file
+# replace "alex" with your username i.e. "ubuntu"
+alex ALL=(ALL) NOPASSWD: ALL
+```
+
+In most circumstances, cloud images for Ubuntu and other distributions will 
not require this step.
+
+As an alternative, if you only need a single server you can log in 
interactively and run `k3sup install --local` instead of using SSH.
+
 ### ???? Setup a Kubernetes *server* with `k3sup`
 
 You can setup a server and stop here, or go on to use the `join` command to 
add some "agents" aka `nodes` or `workers` into the cluster to expand its 
compute capacity.
@@ -132,7 +148,7 @@
 
 Other options for `install`:
 
-* `--cluster` - start this server in clustering mode using embdeed etcd 
(embedded HA)
+* `--cluster` - start this server in clustering mode using embedded etcd 
(embedded HA)
 * `--skip-install` - if you already have k3s installed, you can just run this 
command to get the `kubeconfig`
 * `--ssh-key` - specify a specific path for the SSH key for remote login
 * `--local-path` - default is `./kubeconfig` - set the file where you want to 
save your cluster's `kubeconfig`.  By default this file will be overwritten.
@@ -197,6 +213,8 @@
 k3sup join --ip $AGENT_IP --server-ip $SERVER_IP --user $USER
 ```
 
+Please note that if you are using different usernames for SSH'ing to the agent 
and the server that you must provide the username for the server via the 
`--server-user` parameter.
+
 That's all, so with the above command you can have a two-node cluster up and 
running, whether that's using VMs on-premises, using Raspberry Pis, 64-bit ARM 
or even cloud VMs on EC2.
 
 ### Create a multi-master (HA) setup with external SQL
@@ -224,6 +242,12 @@
 
 You can prefix this command with `  ` two spaces, to prevent it being cached 
in your bash history.
 
+Generate a token used to encrypt data (If you already have a running node this 
can be retrieved by logging into a running node and looking in 
`/var/lib/rancher/k3s/server/token`)
+```bash 
+export TOKEN=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 64)
+```
+
+
 * Create three VMs
 
 Imagine we have the following three VMs, two will be servers, and one will be 
an agent.
@@ -237,13 +261,13 @@
 * Install the first server
 
 ```bash
-k3sup install --user root --ip $SERVER1 --datastore="${DATASTORE}"
+k3sup install --user root --ip $SERVER1 --datastore="${DATASTORE}" 
--token=${TOKEN}
 ```
 
 * Install the second server
 
 ```bash
-k3sup install --user root --ip $SERVER2 --datastore="${DATASTORE}"
+k3sup install --user root --ip $SERVER2 --datastore="${DATASTORE}" 
--token=${TOKEN}
 ```
 
 * Join the first agent
@@ -254,6 +278,8 @@
 k3sup join --user root --server-ip $SERVER1 --ip $AGENT1
 ```
 
+Please note that if you are using different usernames for SSH'ing to the agent 
and the server that you must provide the username for the server via the 
`--server-user` parameter.
+
 * Additional steps
 
 If you run `kubectl get node`, you'll now see two masters/servers and one 
agent, however, we joined the agent to the first server. If the first server 
goes down, the agent will effectively also go offline.
@@ -262,9 +288,9 @@
 kubectl get node
 
 NAME              STATUS                        ROLES    AGE     VERSION
-k3sup-1           Ready                         master   73s     v1.18.6+k3s1
-k3sup-2           Ready                         master   2m31s   v1.18.6+k3s1
-k3sup-3           Ready                         <none>   14s     v1.18.6+k3s1
+k3sup-1           Ready                         master   73s     v1.19.6+k3s1
+k3sup-2           Ready                         master   2m31s   v1.19.6+k3s1
+k3sup-3           Ready                         <none>   14s     v1.19.6+k3s1
 ```
 
 There are two ways to prevent a dependency on the IP address of any one host. 
The first is to create a TCP load-balancer in the cloud of your choice, the 
second is for you to create a DNS round-robbin record, which contains all of 
the IPs of your servers.
@@ -327,9 +353,9 @@
 kubectl get node -o wide
 
 NAME              STATUS                        ROLES    AGE   VERSION
-k3sup-1           NotReady                      master   23m   v1.18.6+k3s1
-k3sup-2           Ready                         master   25m   v1.18.6+k3s1
-k3sup-3           Ready                         <none>   22m   v1.18.6+k3s1
+k3sup-1           NotReady                      master   23m   v1.19.6+k3s1
+k3sup-2           Ready                         master   25m   v1.19.6+k3s1
+k3sup-3           Ready                         <none>   22m   v1.19.6+k3s1
 ```
 
 You've just simulated a failure of one of your masters/servers, and you can 
still access kubectl. Congratulations on building a resilient k3s cluster.
@@ -397,7 +423,7 @@
 
 * Find the RPi IP with `ping -c raspberrypi.local`, then set `export 
SERVER_IP=""` with the IP
 
-* Enable container features in the kernel, by editing `/boot/cmdline.txt`
+* Enable container features in the kernel, by editing `/boot/cmdline.txt` (or 
`/boot/firmware/cmdline.txt` on Ubuntu)
 
 * Add the following to the end of the line: ` cgroup_enable=cpuset 
cgroup_memory=1 cgroup_enable=memory`
 
@@ -567,6 +593,8 @@
 
 * [Creating a K3S Raspberry PI Cluster with K3Sup to fire up nightscout with 
MongoDB](https://h3rmanns.medium.com/creating-a-k3s-raspberry-pi-cluster-with-k3sup-to-fire-up-a-nightscout-backend-service-based-on-a-27c1f5727e5b)
 
+* [Kubernetes Cluster with Rancher on Windows using 
K3s](https://adyanth.site/posts/kubernetes-cluster-on-windows/) by Adyanth H
+
 Checkout the [Announcement 
tweet](https://twitter.com/alexellisuk/status/1162272786250735618?s=20)
 
 ## Similar tools & glossary
@@ -593,11 +621,20 @@
 
 Common issues:
 
-* Raspberry Pi - you haven't updated cmdline.txt to enable cgroups for CPU and 
memory
-* K3s server didn't start. Log in and run `sudo systemctl -u k3s`
-* The K3s agent didn't start. Log in and run `sudo systemctl -u k3s-agent`
+The most common problem is that you missed a step, fortunately it's relatively 
easy to get the logs from the K3s service and it should tell you what's wrong.
+
+* For the Raspberry Pi you probably haven't updated `cmdline.txt` to enable 
cgroups for CPU and memory. Update it as per the instructions in this file.
+* You ran `kubectl` on a node. Don't do this. k3sup copies the file to your 
local workstation. Don't log into agents or servers other than to check logs / 
upgrade the system.
+* `sudo: a terminal is required to read the password` - see the 
[Pre-requisites for k3sup agents and 
servers](#pre-requisites-for-k3sup-servers-and-agents)
+
+* K3s server didn't start. Log in and run `sudo systemctl status k3s` or `sudo 
journalctl -u k3s` to see the logs for the service.
+* The K3s agent didn't start. Log in and run `sudo systemctl status k3s-agent`
 * You tried to remove and re-add a server in an etcd cluster and it failed. 
This is a known issue, see the [K3s issue 
tracker](https://github.com/k3s-io/k3s/issues).
 * You tried to use an unsupported version of a database for HA. See [this list 
from Rancher](https://rancher.com/docs/k3s/latest/en/installation/datastore/)
+* Your tried to join a node to the cluster and got an error "ssh: handshake 
failed". This is probably one of three possibilities:
+  - You did not run `ssh-copy-id`. Try to run it and check if you can log in 
to the server and the new node without a password prompt using regular `ssh`.
+  - You have an RSA public key. There is an [underlying issue in a Go 
library](https://github.com/golang/go/issues/39885) which is [referred 
here](https://github.com/alexellis/k3sup/issues/63). Please provide the 
additional parameter `--ssh-key ~/.ssh/id_rsa` (or wherever your private key 
lives) until the issue is resolved.
+  - You are using different usernames for SSH'ing to the server and the node 
to be added. In that case, playe provide the username for the server via the 
`--server-user` parameter.
 
 Finally, if everything points to an issue that you can clearly reproduce with 
k3sup, feel free to open an issue here. To make sure you get a response, fill 
out the whole template and answer all the questions.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/cmd/install.go 
new/k3sup-0.11.2/cmd/install.go
--- old/k3sup-0.11.0/cmd/install.go     2021-05-13 23:00:07.000000000 +0200
+++ new/k3sup-0.11.2/cmd/install.go     2021-12-09 14:31:35.000000000 +0100
@@ -26,15 +26,19 @@
 
 type k3sExecOptions struct {
        Datastore    string
+       Token        string
        ExtraArgs    string
        FlannelIPSec bool
        NoExtras     bool
 }
 
-// PinnedK3sChannel is a predictable K8s version for use
-// with the examples in the README. You can override this via
-// a flag, or give a specific version, see the command help message.
-const PinnedK3sChannel = "v1.19"
+// PinnedK3sChannel will track the stable channel of the K3s API,
+// so for production use, you should pin to a specific version
+// such as v1.19
+// Channels API available at:
+// https://update.k3s.io/v1-release/channels
+const PinnedK3sChannel = "stable"
+
 const getScript = "curl -sfL https://get.k3s.io";
 
 // MakeInstall creates the install command
@@ -52,6 +56,7 @@
   k3sup install --ip IP --cluster
 
   k3sup install --ip IP --k3s-channel latest
+  k3sup install --host HOST --k3s-channel stable
 
   k3sup install --host HOST \
     --ssh-key $HOME/ec2-key.pem --user ubuntu`,
@@ -82,12 +87,13 @@
 
        command.Flags().Bool("print-command", false, "Print a command that you 
can use with SSH to manually recover from an error")
        command.Flags().String("datastore", "", "connection-string for the k3s 
datastore to enable HA - i.e. 
\"mysql://username:password@tcp(hostname:3306)/database-name\"")
+       command.Flags().String("token", "", "the token used to encrypt the 
datastore, must be the same token for all nodes")
 
        command.Flags().String("k3s-version", "", "Set a version to install, 
overrides k3s-channel")
        command.Flags().String("k3s-extra-args", "", "Additional arguments to 
pass to k3s installer, wrapped in quotes (e.g. --k3s-extra-args '--no-deploy 
servicelb')")
-       command.Flags().String("k3s-channel", PinnedK3sChannel, "Release 
channel: stable, latest, or i.e. v1.19")
+       command.Flags().String("k3s-channel", PinnedK3sChannel, "Release 
channel: stable, latest, or pinned v1.19")
 
-       command.Flags().String("tls-san", "", "Create a certificate for an 
additional IP or hostname")
+       command.Flags().String("tls-san", "", "Use an additional IP or hostname 
for the API server")
 
        command.PreRunE = func(command *cobra.Command, args []string) error {
                _, err := command.Flags().GetIP("ip")
@@ -179,6 +185,10 @@
                        return err
                }
 
+               token, err := command.Flags().GetString("token")
+               if err != nil {
+                       return err
+               }
                if len(datastore) > 0 {
                        if strings.Index(datastore, "ssl-mode=REQUIRED") > -1 {
                                return fmt.Errorf("remove ssl-mode=REQUIRED 
from your datastore string, it is not supported by the k3s syntax")
@@ -186,11 +196,16 @@
                        if strings.Index(datastore, "mysql") > -1 && 
strings.Index(datastore, "tcp") == -1 {
                                return fmt.Errorf("you must specify the mysql 
host as tcp(host:port) or tcp(ip:port), see the k3s docs for more: 
https://rancher.com/docs/k3s/latest/en/installation/ha";)
                        }
+
+                       if token == "" {
+                               return fmt.Errorf("you must provide the token 
when using an external datastore. Make sure to use the same token as other 
nodes")
+                       }
                }
 
                installk3sExec := makeInstallExec(cluster, host, tlsSAN,
                        k3sExecOptions{
                                Datastore:    datastore,
+                               Token:        token,
                                FlannelIPSec: flannelIPSec,
                                NoExtras:     k3sNoExtras,
                                ExtraArgs:    k3sExtraArgs,
@@ -348,7 +363,7 @@
                fmt.Printf("Result: %s %s\n", string(res.StdOut), 
string(res.StdErr))
        }
 
-       absPath, _ := filepath.Abs(localKubeconfig)
+       absPath, _ := filepath.Abs(expandPath(localKubeconfig))
 
        kubeconfig := rewriteKubeconfig(string(res.StdOut), host, context)
 
@@ -395,31 +410,46 @@
        // Create a temporary kubeconfig to store the config of the newly 
create k3s cluster
        file, err := ioutil.TempFile(os.TempDir(), "k3s-temp-*")
        if err != nil {
-               return nil, fmt.Errorf("Could not generate a temporary file to 
store the kuebeconfig: %s", err)
+               return nil, fmt.Errorf("could not generate a temporary file to 
store the kubeconfig: %w", err)
        }
-       defer file.Close()
 
        if err := writeConfig(file.Name(), []byte(k3sconfig), context, true); 
err != nil {
                return nil, err
        }
 
-       fmt.Printf("Merging with existing kubeconfig at %s\n", 
localKubeconfigPath)
+       fmt.Printf("Merging config into file: %s\n", localKubeconfigPath)
+
+       // Pick between ; or : for path concatenation
+       var joinChar string
+       if runtime.GOOS == "windows" {
+               joinChar = ";"
+       } else {
+               joinChar = ":"
+       }
 
-       // Append KUBECONFIGS in ENV Vars
-       appendKubeConfigENV := fmt.Sprintf("KUBECONFIG=%s:%s", 
localKubeconfigPath, file.Name())
+       appendKubeConfigENV := fmt.Sprintf("KUBECONFIG=%s%s%s",
+               localKubeconfigPath,
+               joinChar,
+               file.Name())
 
        // Merge the two kubeconfigs and read the output into 'data'
        cmd := exec.Command("kubectl", "config", "view", "--merge", "--flatten")
        cmd.Env = append(os.Environ(), appendKubeConfigENV)
        data, err := cmd.Output()
        if err != nil {
-               return nil, fmt.Errorf("Could not merge kubeconfigs: %s", err)
+               return nil, fmt.Errorf("could not merge kubeconfig: %w", err)
+       }
+
+       if err := file.Close(); err != nil {
+               return nil, fmt.Errorf("could not close temporary kubeconfig 
file: %s %w",
+                       file.Name(), err)
        }
 
        // Remove the temporarily generated file
        err = os.Remove(file.Name())
        if err != nil {
-               return nil, errors.Wrapf(err, "Could not remove temporary 
kubeconfig file: %s", file.Name())
+               return nil, fmt.Errorf("could not remove temporary kubeconfig 
file: %s %w",
+                       file.Name(), err)
        }
 
        return data, nil
@@ -520,6 +550,7 @@
        extraArgs := []string{}
        if len(options.Datastore) > 0 {
                extraArgs = append(extraArgs, fmt.Sprintf("--datastore-endpoint 
%s", options.Datastore))
+               extraArgs = append(extraArgs, fmt.Sprintf("--token %s", 
options.Token))
        }
        if options.FlannelIPSec {
                extraArgs = append(extraArgs, "--flannel-backend ipsec")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/cmd/install_test.go 
new/k3sup-0.11.2/cmd/install_test.go
--- old/k3sup-0.11.0/cmd/install_test.go        2021-05-13 23:00:07.000000000 
+0200
+++ new/k3sup-0.11.2/cmd/install_test.go        2021-12-09 14:31:35.000000000 
+0100
@@ -231,16 +231,18 @@
        flannelIPSec := false
        k3sNoExtras := false
        k3sExtraArgs := ""
+       token := "this-token"
        ip := "127.0.0.1"
        tlsSAN := "192.168.0.1"
        got := makeInstallExec(cluster, ip, tlsSAN,
                k3sExecOptions{
                        Datastore:    datastore,
+                       Token:        token,
                        FlannelIPSec: flannelIPSec,
                        NoExtras:     k3sNoExtras,
                        ExtraArgs:    k3sExtraArgs,
                })
-       want := "INSTALL_K3S_EXEC='server --tls-san 192.168.0.1 
--datastore-endpoint 
mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb'"
+       want := "INSTALL_K3S_EXEC='server --tls-san 192.168.0.1 
--datastore-endpoint 
mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb
 --token this-token'"
        if got != want {
                t.Errorf("want: %q, got: %q", want, got)
        }
@@ -251,17 +253,19 @@
        datastore := 
"mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb"
        flannelIPSec := false
        k3sNoExtras := true
+       token := "this-token"
        k3sExtraArgs := ""
        ip := "raspberrypi.local"
        tlsSAN := "192.168.0.1"
        got := makeInstallExec(cluster, ip, tlsSAN,
                k3sExecOptions{
                        Datastore:    datastore,
+                       Token:        token,
                        FlannelIPSec: flannelIPSec,
                        NoExtras:     k3sNoExtras,
                        ExtraArgs:    k3sExtraArgs,
                })
-       want := "INSTALL_K3S_EXEC='server --tls-san 192.168.0.1 
--datastore-endpoint 
mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb
 --no-deploy servicelb --no-deploy traefik'"
+       want := "INSTALL_K3S_EXEC='server --tls-san 192.168.0.1 
--datastore-endpoint 
mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb
 --token this-token --no-deploy servicelb --no-deploy traefik'"
        if got != want {
                t.Errorf("want: %q, got: %q", want, got)
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/cmd/join.go new/k3sup-0.11.2/cmd/join.go
--- old/k3sup-0.11.0/cmd/join.go        2021-05-13 23:00:07.000000000 +0200
+++ new/k3sup-0.11.2/cmd/join.go        2021-12-09 14:31:35.000000000 +0100
@@ -56,7 +56,7 @@
 
        command.Flags().String("k3s-extra-args", "", "Additional arguments to 
pass to k3s installer, wrapped in quotes (e.g. --k3s-extra-args '--node-taint 
key=value:NoExecute')")
        command.Flags().String("k3s-version", "", "Set a version to install, 
overrides k3s-channel")
-       command.Flags().String("k3s-channel", PinnedK3sChannel, "Release 
channel: stable, latest, or i.e. v1.18")
+       command.Flags().String("k3s-channel", PinnedK3sChannel, "Release 
channel: stable, latest, or i.e. v1.19")
 
        command.RunE = func(command *cobra.Command, args []string) error {
                fmt.Printf("Running: k3sup join\n")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/vendor/github.com/pkg/errors/.gitignore 
new/k3sup-0.11.2/vendor/github.com/pkg/errors/.gitignore
--- old/k3sup-0.11.0/vendor/github.com/pkg/errors/.gitignore    1970-01-01 
01:00:00.000000000 +0100
+++ new/k3sup-0.11.2/vendor/github.com/pkg/errors/.gitignore    2021-12-09 
14:31:35.000000000 +0100
@@ -0,0 +1,24 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+*.test
+*.prof
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/k3sup-0.11.0/vendor/github.com/spf13/cobra/.gitignore 
new/k3sup-0.11.2/vendor/github.com/spf13/cobra/.gitignore
--- old/k3sup-0.11.0/vendor/github.com/spf13/cobra/.gitignore   1970-01-01 
01:00:00.000000000 +0100
+++ new/k3sup-0.11.2/vendor/github.com/spf13/cobra/.gitignore   2021-12-09 
14:31:35.000000000 +0100
@@ -0,0 +1,39 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+# Vim files 
https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
+# swap
+[._]*.s[a-w][a-z]
+[._]s[a-w][a-z]
+# session
+Session.vim
+# temporary
+.netrwhist
+*~
+# auto-generated tag files
+tags
+
+*.exe
+cobra.test
+bin
+
+.idea/
+*.iml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/k3sup-0.11.0/vendor/github.com/spf13/pflag/.gitignore 
new/k3sup-0.11.2/vendor/github.com/spf13/pflag/.gitignore
--- old/k3sup-0.11.0/vendor/github.com/spf13/pflag/.gitignore   1970-01-01 
01:00:00.000000000 +0100
+++ new/k3sup-0.11.2/vendor/github.com/spf13/pflag/.gitignore   2021-12-09 
14:31:35.000000000 +0100
@@ -0,0 +1,2 @@
+.idea/*
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/k3sup-0.11.0/vendor/golang.org/x/sys/unix/.gitignore 
new/k3sup-0.11.2/vendor/golang.org/x/sys/unix/.gitignore
--- old/k3sup-0.11.0/vendor/golang.org/x/sys/unix/.gitignore    1970-01-01 
01:00:00.000000000 +0100
+++ new/k3sup-0.11.2/vendor/golang.org/x/sys/unix/.gitignore    2021-12-09 
14:31:35.000000000 +0100
@@ -0,0 +1,2 @@
+_obj/
+unix.test

++++++ vendor.tar.gz ++++++

Reply via email to