kubernetes

package
v0.6.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package kubernetes provides utilities for working with Kubernetes resources.

This package provides a unified Client that composes domain-specific clients for different Kubernetes resource types. Each sub-client handles operations for its specific resource type.

Sub-packages:

  • secrets: Operations for Kubernetes Secrets (Get, GetValue, Upsert)
  • configmaps: Operations for Kubernetes ConfigMaps (Get, GetValue, Upsert)

Example usage:

import "github.com/stacklok/toolhive/cmd/thv-operator/pkg/kubernetes"

// Create the unified client
kubeClient := kubernetes.NewClient(ctrlClient, scheme)

// Access secrets operations via the Secrets field
value, err := kubeClient.Secrets.GetValue(ctx, "default", secretKeySelector)

// Upsert a secret with owner reference
result, err := kubeClient.Secrets.UpsertWithOwnerReference(ctx, secret, ownerObject)

// Access configmaps operations via the ConfigMaps field
value, err := kubeClient.ConfigMaps.GetValue(ctx, "default", configMapKeySelector)

// Upsert a configmap with owner reference
result, err := kubeClient.ConfigMaps.UpsertWithOwnerReference(ctx, configMap, ownerObject)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Secrets provides operations for Kubernetes Secrets.
	Secrets *secrets.Client
	// ConfigMaps provides operations for Kubernetes ConfigMaps.
	ConfigMaps *configmaps.Client
}

Client provides a unified interface for Kubernetes resource operations. It composes domain-specific clients for different resource types.

func NewClient

func NewClient(c client.Client, scheme *runtime.Scheme) *Client

NewClient creates a new Kubernetes Client with all sub-clients initialized.

Directories

Path Synopsis
Package configmaps provides convenience methods for working with Kubernetes ConfigMaps.
Package configmaps provides convenience methods for working with Kubernetes ConfigMaps.
Package secrets provides utilities for working with Kubernetes Secrets.
Package secrets provides utilities for working with Kubernetes Secrets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL