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 ¶
ReplaceOption creates an Option that performs string replacement on resource files.
func SkipFilesOption ¶
SkipFilesOption creates an Option that excludes the named files (by base name) from being applied during bootstrap.
type TransformFileFunc ¶
TransformFileFunc transforms a resource file before being applied to the cluster.