Documentation ¶
Index ¶
- func Apply(data []byte, namespace string, args ...string) (err error)
- func CanI(namespace string, verb string, objectType string, args ...string) (bool, error)
- func CanIAllNamespaces(verb string, objectType string, args ...string) (bool, error)
- func Create(namespace string, resourceAndArgs ...string) (err error)
- func CreateEnv(appName string) error
- func CreateEnvFromFile(name string, path string) (err error)
- func CreateTuberCredentials(path string, namespace string) (err error)
- func CurrentCluster() (string, error)
- func Delete(kind string, name string, namespace string, args ...string) (err error)
- func Exec(name string, namespace string, args ...string) error
- func Exists(kind string, name string, namespace string, args ...string) (bool, error)
- func Get(kind string, name string, namespace string, args ...string) ([]byte, error)
- func GetCollection(kind string, namespace string, args ...string) ([]byte, error)
- func PatchConfigMap(mapName string, namespace string, key string, value string) (err error)
- func PatchSecret(mapName string, namespace string, key string, value string) (err error)
- func PortForward(podName string, namespace string, ports []string, args ...string) error
- func RemoveConfigMapEntry(mapName string, namespace string, key string) (err error)
- func RemoveSecretEntry(mapName string, namespace string, key string) (err error)
- func Restart(resource string, namespace string, args ...string) (err error)
- func RolloutStatus(kind string, name string, namespace string, timeout time.Duration, ...) error
- func RolloutUndo(kind string, name string, namespace string, args ...string) error
- func UseCluster(cluster string) error
- type AlreadyExistsError
- type ClusterConfig
- type ConfigResource
- func GetConfigResource(name string, namespace string, kind string) (config *ConfigResource, err error)
- func GetConfigResourceWithToken(name string, namespace string, kind string, token string) (config *ConfigResource, err error)
- func GetSecret(namespace string, secretName string) (*ConfigResource, error)
- type K8sError
- type List
- type NotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply `kubectl apply` data to a given namespace. Specify output or any other flags as args. Uses a stdin pipe to include the content of the data slice
func CanIAllNamespaces ¶ added in v1.0.9
func Create ¶
Create `kubectl create` a resource. Some resources take multiple args (like secrets), so both the resource type and any flags are the variadic
func CreateEnvFromFile ¶
CreateEnvFromFile replaces an apps env with data in a local file
func CreateTuberCredentials ¶
CreateTuberCredentials creates a secret based on the contents of a file
func CurrentCluster ¶
CurrentCluster the current configured kubectl cluster
func Exists ¶
Exists tells you if a given resource already exists. Errors if a get call fails for any reason other than Not Found
func GetCollection ¶
GetCollection gets for plural resource types break if given even an empty name
func PatchConfigMap ¶
PatchConfigMap gets, patches, and saves a configmap
func PatchSecret ¶
PatchSecret gets, patches, and saves a secret
func PortForward ¶
PortForward forward local requests to a running pod
func RemoveConfigMapEntry ¶
RemoveConfigMapEntry removes an entry, from a configmap
func RemoveSecretEntry ¶
RemoveSecretEntry removes an entry, from a secret
func Restart ¶
Restart runs a rollout restart on a given resource type for a namespace For example, `Restart("deployments", "some-app")` will restart _all_ deployments in that namespace
func RolloutStatus ¶
func RolloutStatus(kind string, name string, namespace string, timeout time.Duration, args ...string) error
RolloutStatus waits and watches a rollout's progress
func RolloutUndo ¶
RolloutUndo runs undo on a rollout
func UseCluster ¶
UseCluster switch current configured kubectl cluster
Types ¶
type AlreadyExistsError ¶
type AlreadyExistsError struct {
K8sError
}
AlreadyExistsError resource already exists on kubernetes
type ClusterConfig ¶
ClusterConfig returns config for a cluster
type ConfigResource ¶
ConfigResource represents the editable portion of a configmap
func GetConfigResource ¶
func GetConfigResource(name string, namespace string, kind string) (config *ConfigResource, err error)
GetConfigResource returns a ConfigResource struct with a Data element containing config map entries
func GetConfigResourceWithToken ¶ added in v1.0.9
func GetConfigResourceWithToken(name string, namespace string, kind string, token string) (config *ConfigResource, err error)
GetConfigResourceWithToken is a step toward a larger refactor
func (*ConfigResource) Save ¶
func (c *ConfigResource) Save(namespace string) (err error)
Save persists updates to a configmap to k8s
type K8sError ¶
type K8sError struct {
// contains filtered or unexported fields
}
K8sError generic kubectl error, which also provides the error interface for AlreadyExistsError and NotFoundError
type NotFoundError ¶
type NotFoundError struct {
K8sError
}
NotFoundError requested kubernetes resource not found