package clusterflag
import "gvisor.dev/gvisor/tools/gvisor_k8s_tool/provider/clusterflag"
Package clusterflag implements a flag.Value which can be used in commands to represent a Kubernetes cluster.
Index ¶
- type Flag
- func (f *Flag) Cluster(ctx context.Context) (*cluster.Cluster, error)
- func (f *Flag) Get() any
- func (f *Flag) Set(s string) error
- func (f *Flag) String() string
- func (f *Flag) Valid() error
- type Provider
Types ¶
type Flag ¶
Flag contains the necessary information to connect to a Kubernetes cluster. Flag implements flag.Value.
func (*Flag) Cluster ¶
Cluster creates a cluster client.
func (*Flag) Get ¶
Get implements flag.Value.Get.
func (*Flag) Set ¶
Set implements flag.Value.Set. Set(String()) should be idempotent.
func (*Flag) String ¶
String implements flag.Value.String.
func (*Flag) Valid ¶
Valid checks if the flag values are valid.
type Provider ¶
type Provider string
Provider is a cluster provider.
const ( // Kubectl is a provider using a local kubectl config. Kubectl Provider = "kube" // GKE is a provider using GKE. GKE Provider = "gke" )
func (Provider) String ¶
String returns the provider name.
func (Provider) Valid ¶
Valid returns whether the Provider is valid.
func (Provider) ValidInfo ¶
ValidInfo validates whether the given info is valid for this provider.
Source Files ¶
clusterflag.go
- Version
- v0.0.0-20250605235530-a6711d1e1dc6 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 4 hours ago –
Tools for package owners.