bitnami / bitnami/sealed-secrets

Kubeseal to use cobra library

Open
#717 10 comments 2 reactions 1 assignee Claimed by @juan131 View on GitHub
backlog enhancement
Dominant language
Go
Stars
9.3k
Forks
776
Avg merge
1d 13h
Merged PRs (30d)
30

Description

**Which component**:

- kubeseal

**Is your feature request related to a problem? Please describe.**

The current CLI, kubeseal, is quite complex since every action this CLI can perform depends on a series of flags. In other words, there are no subcommands to help simplifying the CLI usage for certain use cases.

You can simply run the command below to realize there are **47 supported flags**!!

```console
$ kubeseal --help
Usage of kubeseal:
(...)
```

This result in a poor UX that makes it quite difficult to new potential users to adopt the project.

**Describe the solution you'd like**

Use [cobra library](https://github.com/spf13/cobra) to split the current supported use cases on several subcommands. For instance:

- `kubeseal fetch` in replacement of `--fetch-cert` flag.
- `kubeseal merge` in replacement of `--merge-into` flag.
- `kubeseal re-encrypt` in replacement of `--re-encrypt` flag.
- `kubeseal recovery` in replacement of `--recovery-unseal` flag.
- `kubeseal raw` in replacement of `--raw` flag.
- `kubeseal validate` in replacement of `--validate` flag.

Cobra also makes it very simple to create/manage a local config file for kubeseal (`~/.kubeseal/config`) and create a `kubeseal config` subcommand to allow users to configure locally settings such as the controller name and the controller namespace. This can also help to reduce the number of required flags to use the CLI.

**Describe alternatives you've considered**

N/A

**Additional context**

Adopting the cobra interface is an important code refactoring that will require adapting all the docs and it'll require bumping the major version. That said, we should prioritize not introducing incompatibilities in the controller side with kubeseal `0.x` series.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.