kubernetes

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 rbac provides convenience methods for working with Kubernetes RBAC resources.
Package rbac provides convenience methods for working with Kubernetes RBAC resources.
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