Documentation ¶
Index ¶
- Constants
- Variables
- func KubeConfigPath(configPath string) string
- func ParseKubernetesObjects(r io.Reader, as runtime.Object) ([]runtime.Object, error)
- func ParseUnstructured(r io.Reader) ([]*unstructured.Unstructured, error)
- func ReadOnlyClient(client client.Client, mutators ...func(c *readOnlyClient)) client.Client
- func SerialiseObjects(scheme *runtime.Scheme, w io.Writer, objects ...runtime.Object) error
- func ToClientObject(unstructuredObjects []*unstructured.Unstructured) []client.Object
- func ToUnstructured(scheme *runtime.Scheme, objects ...client.Object) ([]*unstructured.Unstructured, error)
- func WithError() func(c *readOnlyClient)
- func WithErrorBuilder(newError func(string) error) func(c *readOnlyClient)
- func WithNoError() func(c *readOnlyClient)
- type ClientConfigBuilder
- func (b ClientConfigBuilder) Build() (*restclient.Config, error)
- func (b ClientConfigBuilder) WithContext(ctx string) ClientConfigBuilder
- func (b ClientConfigBuilder) WithDefaultServerURL(url string) ClientConfigBuilder
- func (b ClientConfigBuilder) WithImpersonateUserGroups(userGroups ...string) ClientConfigBuilder
- func (b ClientConfigBuilder) WithImpersonateUserName(userName string) ClientConfigBuilder
- func (b ClientConfigBuilder) WithKubeConfigPath(path string) ClientConfigBuilder
- func (b ClientConfigBuilder) WithServerURL(url string) ClientConfigBuilder
- func (b ClientConfigBuilder) WithTokenFile(token string) ClientConfigBuilder
- type KinD
- type KinDCluster
- type KubeCluster
- type ParseError
Constants ¶
const DefaultVersion = "v0.11.1"
Variables ¶
var DefaultKind = KinD{ Dir: "./.kind", Version: DefaultVersion, }
Functions ¶
func KubeConfigPath ¶
func ParseKubernetesObjects ¶
func ParseUnstructured ¶
func ParseUnstructured(r io.Reader) ([]*unstructured.Unstructured, error)
func ReadOnlyClient ¶
func SerialiseObjects ¶
func ToClientObject ¶
func ToClientObject(unstructuredObjects []*unstructured.Unstructured) []client.Object
func ToUnstructured ¶
func ToUnstructured(scheme *runtime.Scheme, objects ...client.Object) ([]*unstructured.Unstructured, error)
func WithErrorBuilder ¶
func WithNoError ¶
func WithNoError() func(c *readOnlyClient)
Types ¶
type ClientConfigBuilder ¶
type ClientConfigBuilder struct { ClientConfigLoadingRules *clientcmd.ClientConfigLoadingRules ConfigOverrides *clientcmd.ConfigOverrides DefaultServerURL string // contains filtered or unexported fields }
func NewClientConfigBuilder ¶
func NewClientConfigBuilder() ClientConfigBuilder
NewClientConfigBuilder allows the creation of a flexible Kubernetes client configuration creator
func (ClientConfigBuilder) Build ¶
func (b ClientConfigBuilder) Build() (*restclient.Config, error)
Build generates a new rest client config for the current builder.
func (ClientConfigBuilder) WithContext ¶
func (b ClientConfigBuilder) WithContext(ctx string) ClientConfigBuilder
WithContext allows to define the kubernetes context to use. Equivalent to `kubectl --context ${ctx}`
func (ClientConfigBuilder) WithDefaultServerURL ¶
func (b ClientConfigBuilder) WithDefaultServerURL(url string) ClientConfigBuilder
WithDefaultServerURL allows to fallback to a given Kubernetes server URL in case no config path exist or server URL is not provided
func (ClientConfigBuilder) WithImpersonateUserGroups ¶
func (b ClientConfigBuilder) WithImpersonateUserGroups(userGroups ...string) ClientConfigBuilder
WithImpersonateUserGroups allows to create a client configuration with impersonation. Equivalent to `kubectl --as my-user --as-group ${group}`
func (ClientConfigBuilder) WithImpersonateUserName ¶
func (b ClientConfigBuilder) WithImpersonateUserName(userName string) ClientConfigBuilder
WithImpersonateUserName allows to create a client configuration with impersonation. Equivalent to `kubectl --as ${user}`
func (ClientConfigBuilder) WithKubeConfigPath ¶
func (b ClientConfigBuilder) WithKubeConfigPath(path string) ClientConfigBuilder
WithKubeConfigPath defines the kubeconfig file path to be loaded. If the filepath is empty or does not exist, the client will fallback to the default kubeconfig paths pointed by the ${KUBECONFIG} environment variable and ${HOME}/.kube/config
func (ClientConfigBuilder) WithServerURL ¶
func (b ClientConfigBuilder) WithServerURL(url string) ClientConfigBuilder
WithServerURL forces the Kubernetes server URL regardless of the kubeconfig content
func (ClientConfigBuilder) WithTokenFile ¶
func (b ClientConfigBuilder) WithTokenFile(token string) ClientConfigBuilder
WithServerURL forces the Kubernetes server URL regardless of the kubeconfig content
type KinD ¶
func KinDForVersion ¶
func (*KinD) Delete ¶
func (k *KinD) Delete(cluster *KinDCluster) error
func (*KinD) ListClusters ¶
type KinDCluster ¶
type KinDCluster struct {
// contains filtered or unexported fields
}
func (*KinDCluster) DownloadKubeConfig ¶
func (k *KinDCluster) DownloadKubeConfig() error
func (*KinDCluster) Exists ¶
func (k *KinDCluster) Exists() bool
func (*KinDCluster) ID ¶
func (k *KinDCluster) ID() string
func (*KinDCluster) KubeConfigPath ¶
func (k *KinDCluster) KubeConfigPath() string
type KubeCluster ¶
type KubeCluster interface {
KubeConfigPath() string
}
type ParseError ¶
func (*ParseError) Error ¶
func (p *ParseError) Error() string