mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-10 00:27:05 +02:00
Bonus to `talosctl config merge`. Got that idea after using talosctl for a weekend. I feel that can be a good addition to have a command that can list existing contexts in a table view, which is similar to what `kubectl config get-contexts` does. To avoid going through the file which has all the certs and such. Called it just `contexts` to align with whatever we have now (to switch context you need to use `talosctl config context`). Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
34 lines
788 B
Go
34 lines
788 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
// +build integration_cli
|
|
|
|
package cli
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/talos-systems/talos/internal/integration/base"
|
|
)
|
|
|
|
// TalosconfigSuite verifies dmesg command.
|
|
type TalosconfigSuite struct {
|
|
base.CLISuite
|
|
}
|
|
|
|
// SuiteName ...
|
|
func (suite *TalosconfigSuite) SuiteName() string {
|
|
return "cli.TalosconfigSuite"
|
|
}
|
|
|
|
// TestList checks how talosctl config merge.
|
|
func (suite *TalosconfigSuite) TestList() {
|
|
suite.RunCLI([]string{"config", "contexts"},
|
|
base.StdoutShouldMatch(regexp.MustCompile(`CURRENT`)))
|
|
}
|
|
|
|
func init() {
|
|
allSuites = append(allSuites, new(TalosconfigSuite))
|
|
}
|