commoncmdoptions

package
v0.0.0-...-33e0119 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Copyright 2026 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LeaseDuration is the default duration for the leader election lease.
	LeaseDuration = metav1.Duration{Duration: 137 * time.Second}
	// RenewDeadline is the default duration for the leader renewal.
	RenewDeadline = metav1.Duration{Duration: 107 * time.Second}
	// RetryPeriod is the default duration for the leader election retrial.
	RetryPeriod = metav1.Duration{Duration: 26 * time.Second}
)

The default durations for the leader election operations.

Functions

func TLSProfileSpecFromClusterConfig

func TLSProfileSpecFromClusterConfig(tlsAdherence configv1.TLSAdherencePolicy, tlsSecurityProfile *configv1.TLSSecurityProfile) (configv1.TLSProfileSpec, error)

TLSProfileSpecFromClusterConfig resolves the TLS profile spec from the cluster's TLS security profile and adherence policy.

Types

type OperatorConfig

type OperatorConfig struct {
	CAPINamespace     *string
	MAPINamespace     *string
	OperatorNamespace *string

	// TLSOptions are the TLS options functions used by the manager.  It
	// defaults to the cluster-wide TLS profile, but can be overridden on the
	// command line. Metrics and webhooks will use these.
	TLSOptions []func(config *tls.Config)
	// contains filtered or unexported fields
}

OperatorConfig contains configuration options common to all CAPI operator managers.

func InitOperatorConfig

func InitOperatorConfig(ctx context.Context, cfg *rest.Config, scheme *runtime.Scheme, managerName, defaultManagerNamespace string, extraFlags *flag.FlagSet) (
	logr.Logger, OperatorConfig, ctrl.Options,
	func(ctx context.Context, cancel context.CancelFunc, mgrOpts ctrl.Options) (ctrl.Manager, error),
	error,
)

InitOperatorConfig configures command line flags for options common to all managers.

func (*OperatorConfig) GetClusterOperatorStatusClient

func (opts *OperatorConfig) GetClusterOperatorStatusClient(mgr ctrl.Manager, platform configv1.PlatformType, controllerName string) operatorstatus.ClusterOperatorStatusClient

GetClusterOperatorStatusClient returns a ClusterOperatorStatusClient struct which has been initialised with values from the command line.

Jump to

Keyboard shortcuts

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