Skip to content

Generating the shell autocompletion files reqires a valid kubeconfig #353

@kastl-ars

Description

@kastl-ars

Dear maintainers,

I found kubectl-rook-ceph and wanted to package it for openSUSE. Unfortunately creating the shell completion using the kubectl-rook-ceph completion xyz commands errors out due to a missing kubeconfig:

[   30s] Executing(%install): /usr/bin/bash -e /var/tmp/rpm-tmp.iKAS6L
[   30s] + umask 022
[   30s] + cd /home/abuild/rpmbuild/BUILD
[   30s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/kubectl-rook-ceph-0.9.3-0.x86_64
[   30s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[   30s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/kubectl-rook-ceph-0.9.3-0.x86_64
[   30s] + cd kubectl-rook-ceph-0.9.3
[   30s] + install -D -m 0755 bin/kubectl-rook_ceph /home/abuild/rpmbuild/BUILDROOT/kubectl-rook-ceph-0.9.3-0.x86_64//usr/bin/kubectl-rook_ceph
[   30s] + mkdir -p /home/abuild/rpmbuild/BUILDROOT/kubectl-rook-ceph-0.9.3-0.x86_64/usr/share/bash-completion/completions/
[   30s] + /home/abuild/rpmbuild/BUILDROOT/kubectl-rook-ceph-0.9.3-0.x86_64//usr/bin/kubectl-rook_ceph completion bash
[   30s] Error: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
[   30s] error: Bad exit status from /var/tmp/rpm-tmp.iKAS6L (%install)

Creating an empyt ~/.kube/config file does not work.

Most of the tools that provide generation of shell completions do not require a kubeconfig for that, similar to being able to call -help or help or --help subcommands without requiring a configuration file.

Could this be changed in kubectl-rook-ceph, too?

Thanks in advance,
Johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions