Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package k0sctl for openSUSE:Factory checked in at 2026-05-11 16:55:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/k0sctl (Old) and /work/SRC/openSUSE:Factory/.k0sctl.new.1966 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "k0sctl" Mon May 11 16:55:49 2026 rev:21 rq:1352290 version:0.30.1 Changes: -------- --- /work/SRC/openSUSE:Factory/k0sctl/k0sctl.changes 2026-04-30 20:29:32.164693210 +0200 +++ /work/SRC/openSUSE:Factory/.k0sctl.new.1966/k0sctl.changes 2026-05-11 17:06:19.378967254 +0200 @@ -1,0 +2,13 @@ +Sun May 10 14:41:50 UTC 2026 - Johannes Kastl <[email protected]> + +- Update to version 0.30.1: + * Consistently write dry-run output to manager.Writer by @kke in + #1079 + * Bump github.com/k0sproject/rig from 0.21.4 to 0.21.6 by + @dependabot[bot] in #1081 + - Fix Windows sudo detection to use IsInRole for effective + elevation check by @kke in k0sproject/rig#338 + - Add fix for uutils for newer ubuntu by @a1994sc in + k0sproject/rig#329 + +------------------------------------------------------------------- Old: ---- k0sctl-0.30.0.obscpio New: ---- k0sctl-0.30.1.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ k0sctl.spec ++++++ --- /var/tmp/diff_new_pack.byyTQ5/_old 2026-05-11 17:06:20.174999800 +0200 +++ /var/tmp/diff_new_pack.byyTQ5/_new 2026-05-11 17:06:20.178999964 +0200 @@ -18,7 +18,7 @@ Name: k0sctl -Version: 0.30.0 +Version: 0.30.1 Release: 0 Summary: A bootstrapping and management tool for k0s clusters License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.byyTQ5/_old 2026-05-11 17:06:20.219001599 +0200 +++ /var/tmp/diff_new_pack.byyTQ5/_new 2026-05-11 17:06:20.227001927 +0200 @@ -2,7 +2,7 @@ <service name="obs_scm" mode="manual"> <param name="url">https://github.com/k0sproject/k0sctl.git</param> <param name="scm">git</param> - <param name="revision">v0.30.0</param> + <param name="revision">v0.30.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.byyTQ5/_old 2026-05-11 17:06:20.251002908 +0200 +++ /var/tmp/diff_new_pack.byyTQ5/_new 2026-05-11 17:06:20.255003071 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/k0sproject/k0sctl.git</param> - <param name="changesrevision">82afeb597ef397a7dea2a444b837ece0a6794c48</param></service></servicedata> + <param name="changesrevision">4afdb2b1bf3f10f57beddf00a85b72a0a0000927</param></service></servicedata> (No newline at EOF) ++++++ k0sctl-0.30.0.obscpio -> k0sctl-0.30.1.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/k0sctl-0.30.0/go.mod new/k0sctl-0.30.1/go.mod --- old/k0sctl-0.30.0/go.mod 2026-04-29 13:57:59.000000000 +0200 +++ new/k0sctl-0.30.1/go.mod 2026-05-08 13:16:19.000000000 +0200 @@ -14,7 +14,7 @@ github.com/creasty/defaults v1.8.0 github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/k0sproject/dig v0.4.0 - github.com/k0sproject/rig v0.21.4 + github.com/k0sproject/rig v0.21.6 github.com/logrusorgru/aurora v2.0.3+incompatible github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect github.com/masterzen/winrm v0.0.0-20250927112105-5f8e6c707321 // indirect diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/k0sctl-0.30.0/go.sum new/k0sctl-0.30.1/go.sum --- old/k0sctl-0.30.0/go.sum 2026-04-29 13:57:59.000000000 +0200 +++ new/k0sctl-0.30.1/go.sum 2026-05-08 13:16:19.000000000 +0200 @@ -104,8 +104,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/k0sproject/dig v0.4.0 h1:yBxFUUxNXAMGBg6b7c6ypxdx/o3RmhoI5v5ABOw5tn0= github.com/k0sproject/dig v0.4.0/go.mod h1:rlZ7N7ZEcB4Fi96TPXkZ4dqyAiDWOGLapyL9YpZ7Qz4= -github.com/k0sproject/rig v0.21.4 h1:FnBZNEzE+ND7o1P8bmTGawDIqtc33xuaclGHiP76kug= -github.com/k0sproject/rig v0.21.4/go.mod h1:bdRDs2dJngbYAEWd6+irYlzUqqBeVXVBcSelpaIvuCw= +github.com/k0sproject/rig v0.21.6 h1:9RqeA02FwAktHQpfKfftl69a3bjpyEKDqkiUxXtETtc= +github.com/k0sproject/rig v0.21.6/go.mod h1:bdRDs2dJngbYAEWd6+irYlzUqqBeVXVBcSelpaIvuCw= github.com/k0sproject/version v0.8.0 h1:Yh1SFDeBqQ7etrGwffY8bWKdbAUjeBOhiZ6oQuuz4sM= github.com/k0sproject/version v0.8.0/go.mod h1:iNV3O8blndsQhxZ8zACfpQhrLDlrTvDlCzx+vgCFtSI= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/k0sctl-0.30.0/phase/manager.go new/k0sctl-0.30.1/phase/manager.go --- old/k0sctl-0.30.0/phase/manager.go 2026-04-29 13:57:59.000000000 +0200 +++ new/k0sctl-0.30.1/phase/manager.go 2026-05-08 13:16:19.000000000 +0200 @@ -213,7 +213,7 @@ for host, msgs := range m.dryMessages { fmt.Fprintln(m.Writer, Colorize.BrightRed("dry-run:"), Colorize.Bold(fmt.Sprintf("* %s :", host))) for _, msg := range msgs { - fmt.Println(Colorize.BrightRed("dry-run:"), Colorize.Red(" -"), msg) + fmt.Fprintln(m.Writer, Colorize.BrightRed("dry-run:"), Colorize.Red(" -"), msg) } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/k0sctl-0.30.0/phase/manager_test.go new/k0sctl-0.30.1/phase/manager_test.go --- old/k0sctl-0.30.0/phase/manager_test.go 2026-04-29 13:57:59.000000000 +0200 +++ new/k0sctl-0.30.1/phase/manager_test.go 2026-05-08 13:16:19.000000000 +0200 @@ -1,8 +1,11 @@ package phase import ( + "bytes" "context" "fmt" + "io" + "os" "testing" "github.com/k0sproject/k0sctl/pkg/apis/k0sctl.k0sproject.io/v1beta1" @@ -64,11 +67,11 @@ } type hookedPhase struct { - fn func() error - beforeCalled bool - afterCalled bool - cleanupCalled bool - runCalled bool + fn func() error + beforeCalled bool + afterCalled bool + cleanupCalled bool + runCalled bool } func (p *hookedPhase) Title() string { @@ -76,13 +79,13 @@ } func (p *hookedPhase) Before() error { - p.beforeCalled = true - return nil + p.beforeCalled = true + return nil } func (p *hookedPhase) After() error { - p.afterCalled = true - return nil + p.afterCalled = true + return nil } func (p *hookedPhase) CleanUp() { @@ -98,12 +101,39 @@ } func TestHookedPhase(t *testing.T) { - m := Manager{Config: &v1beta1.Cluster{Spec: &cluster.Spec{}}} - p := &hookedPhase{} - m.AddPhase(p) - require.Error(t, m.Run(context.Background())) - require.True(t, p.beforeCalled, "before hook was not called") - require.False(t, p.afterCalled, "after hook should not run on failure") + m := Manager{Config: &v1beta1.Cluster{Spec: &cluster.Spec{}}} + p := &hookedPhase{} + m.AddPhase(p) + require.Error(t, m.Run(context.Background())) + require.True(t, p.beforeCalled, "before hook was not called") + require.False(t, p.afterCalled, "after hook should not run on failure") +} + +func TestDryRunOutputUsesManagerWriter(t *testing.T) { + oldStdout := os.Stdout + readPipe, writePipe, err := os.Pipe() + require.NoError(t, err) + t.Cleanup(func() { + os.Stdout = oldStdout + }) + os.Stdout = writePipe + + var writer bytes.Buffer + m := Manager{ + Config: &v1beta1.Cluster{Spec: &cluster.Spec{}}, + DryRun: true, + Writer: &writer, + } + m.DryMsg(nil, "custom dry-run message") + + require.NoError(t, m.Run(context.Background())) + require.NoError(t, writePipe.Close()) + stdout, err := io.ReadAll(readPipe) + require.NoError(t, err) + require.NoError(t, readPipe.Close()) + + require.Contains(t, writer.String(), "custom dry-run message") + require.NotContains(t, string(stdout), "custom dry-run message") } func TestContextCancel(t *testing.T) { ++++++ k0sctl.obsinfo ++++++ --- /var/tmp/diff_new_pack.byyTQ5/_old 2026-05-11 17:06:20.643018936 +0200 +++ /var/tmp/diff_new_pack.byyTQ5/_new 2026-05-11 17:06:20.647019099 +0200 @@ -1,5 +1,5 @@ name: k0sctl -version: 0.30.0 -mtime: 1777463879 -commit: 82afeb597ef397a7dea2a444b837ece0a6794c48 +version: 0.30.1 +mtime: 1778238979 +commit: 4afdb2b1bf3f10f57beddf00a85b72a0a0000927 ++++++ vendor.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/k0sproject/rig/connection.go new/vendor/github.com/k0sproject/rig/connection.go --- old/vendor/github.com/k0sproject/rig/connection.go 2026-04-29 13:57:59.000000000 +0200 +++ new/vendor/github.com/k0sproject/rig/connection.go 2026-05-08 13:16:19.000000000 +0200 @@ -16,6 +16,7 @@ "github.com/k0sproject/rig/exec" "github.com/k0sproject/rig/log" rigos "github.com/k0sproject/rig/os" + ps "github.com/k0sproject/rig/pkg/powershell" "github.com/k0sproject/rig/pkg/rigfs" "github.com/mattn/go-shellwords" ) @@ -289,9 +290,7 @@ return `doas -n -- "${SHELL-sh}" -c ` + shellescape.Quote(cmd) } -// sudoWindows is a no-op on windows - the user must already be an admin or UAC must be disabled -// and the user must belong to Administrators. if that is the case, the user should be able to -// do anything. +// sudoWindows is a no-op: the session already has effective administrator privileges. func sudoWindows(cmd string) string { return cmd } @@ -315,30 +314,13 @@ return } - out, err := c.ExecOutput(`whoami`) - if err != nil { - return - } - parts := strings.Split(out, `\`) - if strings.ToLower(parts[len(parts)-1]) == "administrator" { - // user is already the administrator - c.sudofunc = sudoWindows - return - } - - if c.Exec(`net user "%USERNAME%" | findstr /B /C:"Local Group Memberships" | findstr /C:"*Administrators"`) != nil { - // user is not in the Administrators group - return - } - - out, err = c.ExecOutput(`reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA"`) - if err != nil { - return - } - if strings.Contains(out, "0x0") { - // UAC is disabled and the user is in the Administrators group - expect sudo to work - c.sudofunc = sudoWindows - return + // IsInRole uses CheckTokenMembership: returns true only when the Administrators SID is + // present and not deny-only, which correctly identifies an effectively elevated session. + // SSH sessions always give Administrators group members a full elevated token regardless + // of UAC; WinRM does too for domain accounts or when LocalAccountTokenFilterPolicy=1. + isAdmin := ps.Cmd(`if (-not (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { exit 1 }`) + if c.Exec(isAdmin) == nil { + c.SetSudofn(sudoWindows) } } @@ -346,7 +328,7 @@ func (c Connection) Sudo(cmd string) (string, error) { if c.sudofunc == nil { if c.IsWindows() { - return "", fmt.Errorf("%w: UAC is enabled and user is not 'Administrator'", ErrSudoRequired) + return "", fmt.Errorf("%w: current session does not have administrator privileges", ErrSudoRequired) } return "", fmt.Errorf("%w: user is not root and passwordless access elevation (sudo, doas) has not been configured", ErrSudoRequired) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/k0sproject/rig/pkg/rigfs/posixfsys.go new/vendor/github.com/k0sproject/rig/pkg/rigfs/posixfsys.go --- old/vendor/github.com/k0sproject/rig/pkg/rigfs/posixfsys.go 2026-04-29 13:57:59.000000000 +0200 +++ new/vendor/github.com/k0sproject/rig/pkg/rigfs/posixfsys.go 2026-05-08 13:16:19.000000000 +0200 @@ -287,7 +287,7 @@ if err != nil { return fmt.Errorf("can't access stat command: %w", err) } - if strings.Contains(out, "BusyBox") || strings.Contains(out, "--format=") { + if strings.Contains(out, "BusyBox") || strings.Contains(out, "--format") { fsys.statCmd = &statCmdGNU } else { fsys.statCmd = &statCmdBSD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt --- old/vendor/modules.txt 2026-04-29 13:57:59.000000000 +0200 +++ new/vendor/modules.txt 2026-05-08 13:16:19.000000000 +0200 @@ -168,7 +168,7 @@ # github.com/k0sproject/dig v0.4.0 ## explicit; go 1.21 github.com/k0sproject/dig -# github.com/k0sproject/rig v0.21.4 +# github.com/k0sproject/rig v0.21.6 ## explicit; go 1.26 github.com/k0sproject/rig github.com/k0sproject/rig/exec
