Documentation ¶
Index ¶
- Constants
- func ApplyControlPlaneKubeconfig(mcpConf api.Config, existingFilePath string, ...) error
- func BuildControlPlaneKubeconfig(proxy *url.URL, id string, token string, includePrefix bool) *api.Config
- func Client(config *rest.Config) (*kubernetes.Clientset, error)
- func Config(context string) (*rest.Config, error)
- func ConfigContext(ctx context.Context, config *rest.Config) (*dynamic.DynamicClient, error)
- func Context(ctx context.Context, context string) (*dynamic.DynamicClient, error)
- func Create()
- func DeleteKubeResources(ctx context.Context, p ResourceParams, resourceName string) error
- func DynamicWatch(ctx context.Context, r dynamic.NamespaceableResourceInterface, timeout *int64, ...) (chan error, error)
- func GetKubeConfig(path string) (*rest.Config, error)
- func GetKubeResources(p ResourceParams) ([]unstructured.Unstructured, error)
- type ImagePullApplicator
- type ResourceParams
- type SecretApplicator
Constants ¶
const ( // KubeconfigDir is the default kubeconfig directory. KubeconfigDir = ".kube" // KubeconfigFile is the default kubeconfig file. KubeconfigFile = "config" // UpboundKubeconfigKeyFmt is the format for Upbound control plane entries // in a kubeconfig file. UpboundKubeconfigKeyFmt = "upbound-%s" // UpboundK8sResource is appended to the end of the kubeconfig server path. UpboundK8sResource = "k8s" )
Variables ¶
This section is empty.
Functions ¶
func ApplyControlPlaneKubeconfig ¶
func ApplyControlPlaneKubeconfig(mcpConf api.Config, existingFilePath string, wrapTransport transport.WrapperFunc) error
ApplyControlPlaneKubeconfig applies a control plane kubeconfig to an existing kubeconfig file and sets it as the current context.
func BuildControlPlaneKubeconfig ¶
func BuildControlPlaneKubeconfig(proxy *url.URL, id string, token string, includePrefix bool) *api.Config
BuildControlPlaneKubeconfig builds a kubeconfig entry for a control plane.
func ConfigContext ¶
func DeleteKubeResources ¶
func DeleteKubeResources(ctx context.Context, p ResourceParams, resourceName string) error
func DynamicWatch ¶
func DynamicWatch(ctx context.Context, r dynamic.NamespaceableResourceInterface, timeout *int64, done func(u *unstructured.Unstructured) (bool, error)) (chan error, error)
DynamicWatch starts a watch on the given resource type. The done callback is called on every received event until either timeout or context cancellation.
func GetKubeConfig ¶
GetKubeConfig constructs a Kubernetes REST config from the specified kubeconfig, or falls back to same defaults as kubectl.
func GetKubeResources ¶
func GetKubeResources(p ResourceParams) ([]unstructured.Unstructured, error)
Types ¶
type ImagePullApplicator ¶
type ImagePullApplicator struct {
// contains filtered or unexported fields
}
ImagePullApplicator constructs and creates or updates an image pull Secret.
func NewImagePullApplicator ¶
func NewImagePullApplicator(secret *SecretApplicator) *ImagePullApplicator
NewImagePullApplicator constructs a new ImagePullApplicator with the passed SecretApplicator. TODO(hasheddan): consider moving applicators to a common interface.
type ResourceParams ¶
type SecretApplicator ¶
type SecretApplicator struct {
// contains filtered or unexported fields
}
SecretApplicator creates or updates Secrets. In the event that the Secret exists and must be updated, it is completely replaced, not patched.
func NewSecretApplicator ¶
func NewSecretApplicator(client kubernetes.Interface) *SecretApplicator
NewSecretApplicator constructs a SecretApplicator with the passed Kubernetes client.