Skip to content

Add --kubeconfig flag and create ~/.kube when missing - #465

Open
alexellis wants to merge 4 commits into
masterfrom
local-file-alias
Open

alexellis wants to merge 4 commits into
masterfrom
local-file-alias

Conversation

@alexellis

@alexellis alexellis commented Aug 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Expose --kubeconfig (with -k) as the flag for the kubeconfig file path on install, get-config, and plan, matching the name every k8s tool and our own ready command use.
  • Keep --local-path as a hidden compatibility alias.
  • Create ~/.kube and touch the config file when missing in install and get-config, matching k3sup-pro so a fresh machine no longer fails with "no such file or directory".
  • Fix k3s-channel help ("or i.e. v1.19") and datastore help ("connection-string").

Testing

Verified live in a Slicer VM with a wiped ~/.kube: --kubeconfig, -k, and the hidden --local-path all create the file. plan emits --kubeconfig in its generated install script. Full go test ./... green, gofmt clean.

LLMs reach for --local-file far more often than --local-path, so
expose the former and keep the latter as a hidden alias. Applied to
install, get-config and plan so help text is consistent.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@reviewfn

This comment has been minimized.

Expose --kubeconfig (with -k) as the flag for the kubeconfig
file path on install, get-config, and plan, matching the name
every k8s tool and our own ready command use. Keep --local-file
and --local-path as hidden aliases so existing scripts keep
working.

Also create ~/.kube and touch the config file when missing in
install and get-config, matching k3sup-pro so a fresh machine
no longer fails with "no such file or directory".

Fix k3s-channel help ("or i.e. v1.19") and datastore help
("connection-string").

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@reviewfn

This comment has been minimized.

--local-file was added in this PR and never released, and is
superseded by --kubeconfig, so remove it from install,
get-config and plan. Keep --kubeconfig visible and --local-path
as the hidden compatibility alias.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@reviewfn

This comment has been minimized.

@alexellis alexellis changed the title Add --local-file alias and hide --local-path Add --kubeconfig flag and create ~/.kube when missing Aug 18, 2026
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@reviewfn

reviewfn Bot commented Aug 19, 2026

Copy link
Copy Markdown

AI Pull Request Overview

Disclaimer: This review was generated by automated AI and may contain errors. Do not trust its outputs without human verification.

Summary

  • Adds --kubeconfig and -k to install, get-config, and plan while keeping --local-path hidden as a compatibility alias.
  • Updates generated plan output and examples to prefer --kubeconfig.
  • Creates missing kubeconfig parent directories before writing or merging kubeconfig output.
  • Touches missing kubeconfig files before invoking kubectl config view --merge --flatten.
  • Adjusts several help strings.
  • Updates GitHub Actions workflow dependency versions.
  • Main merge-safety risk is the workflow action version bump.

Approval rating (1-10)

6/10. The CLI changes look reasonable, but the workflow action refs appear to break both build and release automation.

Summary per file

Summary per file
File path Summary
.github/workflows/build.yaml Updates checkout, setup-go, and Go versions for build CI.
.github/workflows/publish.yaml Updates checkout, setup-go, Go, and upload-assets versions for releases.
cmd/get-config.go Adds --kubeconfig/-k, hides --local-path, and updates examples/help.
cmd/install.go Adds --kubeconfig/-k, prepares kubeconfig paths, and updates help text.
cmd/join.go Rewords k3s-channel help text.
cmd/plan.go Adds --kubeconfig/-k and emits --kubeconfig in generated scripts.

Overall Assessment

The Go changes are narrowly scoped and mostly align with the PR goal: the new flag name is exposed consistently, the old flag remains available as a hidden alias, and missing kubeconfig directories are handled before writes and merges. The blocking concern is the workflow update to actions/checkout@v7 and actions/setup-go@v7, which appears likely to make CI and release workflows fail before any repository code runs.

Detailed Review

Detailed Review

Findings

High: GitHub Actions refs appear to point at non-existent major versions

Files: .github/workflows/build.yaml:19, .github/workflows/build.yaml:23, .github/workflows/publish.yaml:12, .github/workflows/publish.yaml:16

Both workflows now reference actions/checkout@v7 and actions/setup-go@v7. Those refs need to exist as tags or branches in the upstream action repositories; otherwise GitHub Actions fails during workflow setup with an unresolved action reference before make all can run. This affects pull-request CI through build.yaml and tag publishing through publish.yaml.

Use published action major versions instead, for example:

- uses: actions/checkout@v4

- name: Install Go
  uses: actions/setup-go@v5

If the repository intentionally depends on newer major versions, pin to confirmed existing tags rather than speculative version numbers.

Other Reviewed Changes

No blocking findings in the scoped Go command changes. The shared localPath binding preserves the hidden --local-path alias while making --kubeconfig and -k the visible interface, and the kubeconfig path preparation is applied before both direct writes and merge operations.

AI agent details.

Agent processing time: 1m44.395s
Environment preparation time: 3.342s
Total time from webhook: 1m51.456s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant