talos/internal/integration/base/cli.go
Andrey Smirnov 399aeda0b9 feat: rename confusing target options, --endpoints, etc.
Fixes #1610

1. In `talosconfig`, deprecate `Target` in favor of `Endpoints`
(client-side LB to come next).

2. In `osctl`, use `--nodes` in place of `--target`.

3. In `osctl` add option `--endpoints` to override `Endpoints` for the
call.

Other changes are just updates to catch up with the changes. Most
probably I missed something... And CAPI provider needs update.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-12-10 02:23:54 +03:00

31 lines
774 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 base
import (
"os/exec"
"github.com/stretchr/testify/suite"
)
// CLISuite is a base suite for CLI tests
type CLISuite struct {
suite.Suite
TalosSuite
}
// RunOsctl runs osctl binary with the options provided
func (cliSuite *CLISuite) RunOsctl(args []string, options ...RunOption) {
// TODO: add support for calling `osctl config endpoint` before running osctl
args = append([]string{"--talosconfig", cliSuite.TalosConfig}, args...)
cmd := exec.Command(cliSuite.OsctlPath, args...)
Run(&cliSuite.Suite, cmd, options...)
}