confighelpers

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package confighelpers provides bootstrap helpers inspired by github.com/kcp-dev/kcp/config/helpers. We maintain a local copy to avoid pulling in the full kcp server module which has dependency conflicts with our k8s versions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(ctx context.Context, discoveryClient discovery.DiscoveryInterface, dynamicClient dynamic.Interface, embedFS embed.FS, opts ...Option) error

Bootstrap reads all YAML files from an embed.FS and applies them to the cluster using a discovery-based REST mapper. It retries continuously until all resources are successfully applied or the context is cancelled. Files are applied in dependency order: APIResourceSchemas before APIExports.

Types

type Option

type Option struct {
	// TransformFile is a function that transforms a resource file before being applied to the cluster.
	TransformFile TransformFileFunc
	// SkipFiles lists base file names in the embed.FS that must NOT be applied,
	// even though they are embedded. Used for files that are embedded for other
	// reasons (e.g. consumed by a code generator) but whose objects should not
	// exist in the running cluster.
	SkipFiles []string
}

Option allows to customize the bootstrap process.

func ReplaceOption

func ReplaceOption(pairs ...string) Option

ReplaceOption creates an Option that performs string replacement on resource files.

func SkipFilesOption

func SkipFilesOption(names ...string) Option

SkipFilesOption creates an Option that excludes the named files (by base name) from being applied during bootstrap.

type TransformFileFunc

type TransformFileFunc func(bs []byte) ([]byte, error)

TransformFileFunc transforms a resource file before being applied to the cluster.

Jump to

Keyboard shortcuts

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