Documentation ¶
Index ¶
- Variables
- func DeleteSecret(ctx context.Context, kube *Kube, name types.NamespacedName) error
- func EnsureOpenShiftProject(ctx context.Context, logger *slog.Logger, kube *Kube, projectName string) error
- func GetOpenShiftIngressDomain(ctx context.Context, kube *Kube) (string, error)
- func GetSecret(ctx context.Context, kube *Kube, name types.NamespacedName) (*corev1.Secret, error)
- func SecretExists(ctx context.Context, kube *Kube, name types.NamespacedName) (bool, error)
- type FakeKube
- func (f *FakeKube) ClientSet(string) (kubernetes.Interface, error)
- func (f *FakeKube) Connected() error
- func (f *FakeKube) CoreV1ClientSet(namespace string) (corev1client.CoreV1Interface, error)
- func (f *FakeKube) DiscoveryClient(namespace string) (discovery.DiscoveryInterface, error)
- func (f *FakeKube) DynamicClient(namespace string) (dynamic.Interface, error)
- func (f *FakeKube) GetDynamicClientForObjectRef(objectRef *corev1.ObjectReference) (dynamic.ResourceInterface, error)
- func (f *FakeKube) RESTClientGetter(_ string) genericclioptions.RESTClientGetter
- type Interface
- type Kube
- func (k *Kube) ClientSet(namespace string) (kubernetes.Interface, error)
- func (k *Kube) Connected() error
- func (k *Kube) CoreV1ClientSet(namespace string) (corev1client.CoreV1Interface, error)
- func (k *Kube) DiscoveryClient(namespace string) (discovery.DiscoveryInterface, error)
- func (k *Kube) DynamicClient(namespace string) (dynamic.Interface, error)
- func (k *Kube) GetDynamicClientForObjectRef(objectRef *corev1.ObjectReference) (dynamic.ResourceInterface, error)
- func (k *Kube) RESTClientGetter(namespace string) genericclioptions.RESTClientGetter
Constants ¶
This section is empty.
Variables ¶
var ErrClientNotConnected = errors.New("kubernetes client not connected")
ErrClientNotConnected kubernetes clients is not able to access the API.
var ErrIngressDomainNotFound = fmt.Errorf("ingress domain not found")
ErrIngressDomainNotFound returned when the OpenShift ingress domain is empty.
Functions ¶
func DeleteSecret ¶
DeleteSecret deletes a Kubernetes secret.
func EnsureOpenShiftProject ¶
func EnsureOpenShiftProject( ctx context.Context, logger *slog.Logger, kube *Kube, projectName string, ) error
EnsureOpenShiftProject ensures the OpenShift project exists.
func GetOpenShiftIngressDomain ¶
GetOpenShiftIngressDomain returns the OpenShift Ingress domain.
func GetSecret ¶
func GetSecret( ctx context.Context, kube *Kube, name types.NamespacedName, ) (*corev1.Secret, error)
GetSecret retrieves a Kubernetes secret by full name.
func SecretExists ¶
SecretExists checks if a Kubernetes secret exists.
Types ¶
type FakeKube ¶
type FakeKube struct {
// contains filtered or unexported fields
}
func NewFakeKube ¶
func (*FakeKube) CoreV1ClientSet ¶
func (f *FakeKube) CoreV1ClientSet( namespace string, ) (corev1client.CoreV1Interface, error)
func (*FakeKube) DiscoveryClient ¶
func (f *FakeKube) DiscoveryClient( namespace string, ) (discovery.DiscoveryInterface, error)
func (*FakeKube) DynamicClient ¶
func (*FakeKube) GetDynamicClientForObjectRef ¶
func (f *FakeKube) GetDynamicClientForObjectRef( objectRef *corev1.ObjectReference, ) (dynamic.ResourceInterface, error)
func (*FakeKube) RESTClientGetter ¶
func (f *FakeKube) RESTClientGetter(_ string) genericclioptions.RESTClientGetter
type Interface ¶
type Interface interface { ClientSet(string) (kubernetes.Interface, error) Connected() error CoreV1ClientSet(string) (corev1client.CoreV1Interface, error) DiscoveryClient(string) (discovery.DiscoveryInterface, error) DynamicClient(string) (dynamic.Interface, error) GetDynamicClientForObjectRef(*corev1.ObjectReference) (dynamic.ResourceInterface, error) RESTClientGetter(string) genericclioptions.RESTClientGetter }
type Kube ¶
type Kube struct {
// contains filtered or unexported fields
}
Kube represents the Kubernetes client helper.
func (*Kube) ClientSet ¶
func (k *Kube) ClientSet(namespace string) (kubernetes.Interface, error)
ClientSet returns a "corev1" Kubernetes Clientset.
func (*Kube) Connected ¶
Connected reads the cluster's version, to assert if the client is working. For this purpose it assumes namespace "default".
func (*Kube) CoreV1ClientSet ¶
func (k *Kube) CoreV1ClientSet( namespace string, ) (corev1client.CoreV1Interface, error)
CoreV1ClientSet returns a "corev1" Kubernetes Clientset.
func (*Kube) DiscoveryClient ¶
func (k *Kube) DiscoveryClient(namespace string) (discovery.DiscoveryInterface, error)
DiscoveryClient instantiates a discovery client for the given namespace.
func (*Kube) DynamicClient ¶
DynamicClient instantiates a dynamic client for the given namespace.
func (*Kube) GetDynamicClientForObjectRef ¶
func (k *Kube) GetDynamicClientForObjectRef( objectRef *corev1.ObjectReference, ) (dynamic.ResourceInterface, error)
GetDynamicClientForObjectRef returns a dynamic client for the object reference.
func (*Kube) RESTClientGetter ¶
func (k *Kube) RESTClientGetter(namespace string) genericclioptions.RESTClientGetter
RESTClientGetter returns a REST client getter for the given namespace.