Skip to content

fleet apply CLI does not honour --kubeconfig flag #5170

@apoorvajagtap

Description

@apoorvajagtap

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Fleet CLI doens´t honour the --kubeconfig flag for apply and cleanup subcommands.

Expected Behavior

Fleet CLI should use the specified value when --kubeconfig is passed instead of falling back to the default location.

Steps To Reproduce

  1. Install fleet CLI.
  2. Follow the documented steps to clone the repository & execute fleet apply.
  3. Launch fleet apply following the example. The execution fails:
$ fleet apply --debug --debug-level 10 -n fleet-local  testbundle01 simple-chart/  -o
foo.yaml --kubeconfig /etc/rancher/rke2/rke2.yaml
$ echo $?
1
  1. Relaunch the execution
strace -f -e trace=openat,exit_group fleet apply -n fleet-local testbundle01 simple-chart/ -o foo.yaml --kubeconfig /etc/rancher/rke2/rke2.yaml 2>&1 | grep -v SIGURG 
  1. The execution fails because it looks for "default" config path, ignoring the --kubeconfig flag
openat(AT_FDCWD, "/root/.kube/config", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 

Environment

- Architecture: arm64 & amd64
- Fleet Version: fleet version v0.15.1 (190f2815a2f6bb208d7ffd3b7da1c9f942716cc0)

Logs

Anything else?

SURE-11634

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions