Documentation ¶
Index ¶
- Constants
- func Abort(raw string) bool
- func CloseWithError(c *BaseCommand)
- func Diff(a, b map[string]interface{}) (string, error)
- func IsDanglingResourceError(err error) bool
- func IsValidLabel(label string) bool
- func MergeMaps(a, b map[string]interface{}) map[string]interface{}
- func Usage(txt string, flags *flag.FlagSet) string
- type BaseCommand
- type DanglingResourceError
- type PortForward
- type PortForwarder
- type Usager
Constants ¶
const ( DefaultReleaseName = "consul" DefaultReleaseNamespace = "consul" ConsulDemoAppReleaseName = "consul-demo" TopLevelChartDirName = "consul" ReleaseTypeConsul = "Consul" ReleaseTypeConsulDemo = "Consul demo application" // CLILabelKey and CLILabelValue are added to each secret on creation so the CLI knows // which key to delete on an uninstall. CLILabelKey = "managed-by" CLILabelValue = "consul-k8s" )
Variables ¶
This section is empty.
Functions ¶
func CloseWithError ¶
func CloseWithError(c *BaseCommand)
CloseWithError terminates a command and cleans up its resources. If termination fails, the error is logged and the process exits with an exit code of 1.
func Diff ¶
Diff returns a string representation of the difference between two maps as YAML. The returned string is sorted alphabetically by key. If the maps are identical, the returned string is empty.
func IsDanglingResourceError ¶
IsDanglingResourceError returns true if the error passed in is of type DanglingResourceError.
func IsValidLabel ¶
IsValidLabel checks if a given label conforms to RFC 1123 https://datatracker.ietf.org/doc/html/rfc1123. This standard requires that the label begins and ends with an alphanumeric character, does not exceed 63 characters, and contains only alphanumeric characters and '-'.
func MergeMaps ¶
MergeMaps merges two maps giving b precedent. @source: https://github.com/helm/helm/blob/main/pkg/cli/values/options.go
Types ¶
type BaseCommand ¶
type BaseCommand struct { // Ctx is the base context for the command. It is up to commands to // utilize this context so that cancellation works in a timely manner. Ctx context.Context // Log is the logger to use. Log hclog.Logger // UI is used to write to the CLI. UI terminal.UI }
BaseCommand is embedded in all commands to provide common logic and data.
func (*BaseCommand) Close ¶
func (c *BaseCommand) Close() error
Close cleans up any resources that the command created. This should be defered by any CLI command that embeds baseCommand in the Run command.
type DanglingResourceError ¶
type DanglingResourceError struct {
// contains filtered or unexported fields
}
DanglingResourceError should be used when a request was made to remove a resource and the resource still remains after enough time has elapsed that it should have been removed by Kubernetes.
func NewDanglingResourceError ¶
func NewDanglingResourceError(message string) *DanglingResourceError
NewDanglingResourceError returns a new instance of DanglingResourceError with the given message.
func (*DanglingResourceError) Error ¶
func (d *DanglingResourceError) Error() string
Error returns a string representation of the dangling resource error.
type PortForward ¶
type PortForward struct { // Namespace is the Kubernetes Namespace where the Pod can be found. Namespace string // PodName is the name of the Pod to port forward. PodName string // RemotePort is the port on the Pod to forward to. RemotePort int // KubeClient is the Kubernetes Client to use for port forwarding. KubeClient kubernetes.Interface // RestConfig is the REST client configuration to use for port forwarding. RestConfig *rest.Config // contains filtered or unexported fields }
PortForward represents a Kubernetes Pod port forwarding session which can be run as a background process.
func (*PortForward) Close ¶
func (pf *PortForward) Close()
Close closes the port forward connection.
func (*PortForward) GetLocalPort ¶
func (pf *PortForward) GetLocalPort() int
type PortForwarder ¶
PortForwarder enables a user to open and close a connection to a remote server.
Directories ¶
Path | Synopsis |
---|---|
Package flag is a thin layer over the stdlib flag package that provides some minimal features such as aliasing, autocompletion handling, improved defaults, etc.
|
Package flag is a thin layer over the stdlib flag package that provides some minimal features such as aliasing, autocompletion handling, improved defaults, etc. |
Package terminal is a modified version of https://github.com/hashicorp/waypoint-plugin-sdk/tree/74d9328929293551499078da388b8d057f3b2341/terminal.
|
Package terminal is a modified version of https://github.com/hashicorp/waypoint-plugin-sdk/tree/74d9328929293551499078da388b8d057f3b2341/terminal. |