Documentation ¶
Index ¶
Constants ¶
View Source
const (
EnvPrefix = "KUBECTL_COST"
)
Variables ¶
This section is empty.
Functions ¶
func AddKubeOptionsFlags ¶
func AddKubeOptionsFlags(cmd *cobra.Command, ko *KubeOptions)
AddKubeOptionsFlags sets up the cobra command with the flags from KubeOptions' configFlags so that a kube client can be built to a user's specification. Its one modification is to change the name of the namespace flag to kubecost-namespace because we want to "behave as expected", i.e. --namespace affects the request to the kubecost API, not the request to the k8s API.
Types ¶
type KubeOptions ¶
type KubeOptions struct { RestConfig *rest.Config // Namespace should be the currently-configured defaultNamespace of the client. // This allows e.g. predict to fill in the defaultNamespace if one is not provided // in the workload spec. DefaultNamespace string genericclioptions.IOStreams // contains filtered or unexported fields }
KubeOptions provides information required to communicate with the Kubernetes API
func NewKubeOptions ¶
func NewKubeOptions(streams genericclioptions.IOStreams) *KubeOptions
NewCommonCostOptions creates the default set of cost options
func (*KubeOptions) Complete ¶
func (o *KubeOptions) Complete(cmd *cobra.Command, args []string) error
Complete sets all information required for getting cost information
func (*KubeOptions) Validate ¶
func (o *KubeOptions) Validate() error
Validate ensures that all required arguments and flag values are provided
Click to show internal directories.
Click to hide internal directories.