Documentation
¶
Index ¶
- Variables
- func CreatePersistentVolumeClaim(ctx context.Context, name, namespaceOverride string, labels map[string]string, ...) (err error)
- func DeletePersistentVolumeClaims(ctx context.Context, namespaceOverride string, listOptions metav1.ListOptions) (err error)
- func DeleteSecrets(ctx context.Context, namespaceOverride string, listOptions metav1.ListOptions) (err error)
- func EnsureDockerRegistrySecretExist(ctx context.Context, name, namespaceOverride string, labels map[string]string, ...) (err error)
- func EnsureSecretExist(ctx context.Context, secret corev1.Secret, namespaceOverride string) (err error)
- func GetClientConfig() clientcmd.ClientConfig
- func GetConfigMap(ctx context.Context, name, namespaceOverride string) (*corev1.ConfigMap, error)
- func GetDefaultNamespace() (namespace string, err error)
- func GetDefaultOpenShiftRegistry() string
- func GetManifestivalClient() (manifestival.Client, error)
- func GetOpenShiftDockerCredentialLoaders() []creds.CredentialsCallback
- func GetOpenShiftServiceCA(ctx context.Context) (*x509.Certificate, error)
- func GetPersistentVolumeClaim(ctx context.Context, name, namespaceOverride string) (*corev1.PersistentVolumeClaim, error)
- func GetPodLogs(ctx context.Context, namespace, podName, containerName string) (string, error)
- func GetSecret(ctx context.Context, name, namespaceOverride string) (*corev1.Secret, error)
- func GetServiceAccount(ctx context.Context, referencedServiceAccount, namespace string) error
- func HandleDockerCfgJSONContent(username, password, email, server string) ([]byte, error)
- func IsOpenShift() bool
- func ListConfigMapsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
- func ListPersistentVolumeClaimsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
- func ListSecretsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
- func NewClientAndResolvedNamespace(ns string) (*kubernetes.Clientset, string, error)
- func NewDynamicClient() (dynamic.Interface, error)
- func NewInClusterDialer(ctx context.Context, clientConfig clientcmd.ClientConfig) (*contextDialer, error)
- func NewKubernetesClientset() (*kubernetes.Clientset, error)
- func NewLazyInitInClusterDialer(clientConfig clientcmd.ClientConfig) *lazyInitInClusterDialer
- func UploadToVolume(ctx context.Context, content io.Reader, claimName, namespace string) error
- type OpenshiftMetadataDecorator
Constants ¶
This section is empty.
Variables ¶
var SocatImage = "ghcr.io/knative/func-utils:latest"
var TarImage = "ghcr.io/knative/func-utils:latest"
Functions ¶
func DeleteSecrets ¶
func EnsureSecretExist ¶
func GetClientConfig ¶
func GetClientConfig() clientcmd.ClientConfig
func GetConfigMap ¶
func GetDefaultNamespace ¶ added in v0.41.0
GetDefaultNamespace returns default namespace
func GetDefaultOpenShiftRegistry ¶ added in v0.38.1
func GetDefaultOpenShiftRegistry() string
func GetManifestivalClient ¶ added in v0.38.0
func GetManifestivalClient() (manifestival.Client, error)
func GetOpenShiftDockerCredentialLoaders ¶ added in v0.38.1
func GetOpenShiftDockerCredentialLoaders() []creds.CredentialsCallback
func GetOpenShiftServiceCA ¶ added in v0.38.1
func GetOpenShiftServiceCA(ctx context.Context) (*x509.Certificate, error)
func GetPodLogs ¶
GetPodLogs returns logs from a specified Container in a Pod, if container is empty string, then the first container in the pod is selected.
func GetServiceAccount ¶ added in v0.38.0
func IsOpenShift ¶ added in v0.38.1
func IsOpenShift() bool
func ListConfigMapsNamesIfConnected ¶
func ListConfigMapsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
ListConfigMapsNamesIfConnected lists names of ConfigMaps present and the current k8s context returns empty list, if not connected to any cluster
func ListPersistentVolumeClaimsNamesIfConnected ¶ added in v0.38.0
func ListPersistentVolumeClaimsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
ListPersistentVolumeClaimsNamesIfConnected lists names of PersistentVolumeClaims present and the current k8s context returns empty list, if not connected to any cluster
func ListSecretsNamesIfConnected ¶
func ListSecretsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
ListSecretsNamesIfConnected lists names of Secrets present and the current k8s context returns empty list, if not connected to any cluster
func NewClientAndResolvedNamespace ¶
func NewClientAndResolvedNamespace(ns string) (*kubernetes.Clientset, string, error)
func NewDynamicClient ¶
func NewInClusterDialer ¶
func NewInClusterDialer(ctx context.Context, clientConfig clientcmd.ClientConfig) (*contextDialer, error)
NewInClusterDialer creates context dialer that will dial TCP connections via POD running in k8s cluster. This is useful when accessing k8s services that are not exposed outside cluster (e.g. openshift image registry).
Usage:
dialer, err := k8s.NewInClusterDialer(ctx) if err != nil { return err } defer dialer.Close() transport := &http.Transport{ DialContext: dialer.DialContext, } var client = http.Client{ Transport: transport, }
func NewKubernetesClientset ¶
func NewKubernetesClientset() (*kubernetes.Clientset, error)
func NewLazyInitInClusterDialer ¶
func NewLazyInitInClusterDialer(clientConfig clientcmd.ClientConfig) *lazyInitInClusterDialer
Types ¶
type OpenshiftMetadataDecorator ¶ added in v0.38.1
type OpenshiftMetadataDecorator struct{}