helpers

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsIrsaAuthType = "awsirsa"
	CSRAuthType     = "csr"
)
View Source
const (
	// GcFinalizer is added to the managedCluster for resource cleanup, which maintained by gc controller.
	GcFinalizer = "cluster.open-cluster-management.io/resource-cleanup"
)

Variables

This section is empty.

Functions

func CreateSelfSubjectAccessReviews added in v0.14.0

func CreateSelfSubjectAccessReviews(
	ctx context.Context,
	kubeClient kubernetes.Interface,
	selfSubjectAccessReviews []authorizationv1.SelfSubjectAccessReview) (bool, *authorizationv1.SelfSubjectAccessReview, error)

func FilterClusterAnnotations

func FilterClusterAnnotations(annotations map[string]string) map[string]string

func GetAwsAccountIdAndClusterName added in v0.16.0

func GetAwsAccountIdAndClusterName(clusterArn string) (string, string)

GetAwsAccountIdAndClusterName Parses aws accountId and cluster-name from clusterArn e.g. if clusterArn is arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1 accountId is 123456789012 and clusterName is hub-cluster1

func GetAwsRegion added in v0.16.0

func GetAwsRegion(clusterArn string) string

GetAwsRegion Parses aws accountId and cluster-name from clusterArn e.g. if clusterArn is arn:aws:eks:us-west-2:123456789012:cluster/hub-cluster1 awsRegion is us-west-2

func GetBootstrapSSARs added in v0.14.0

func GetBootstrapSSARs() []authorizationv1.SelfSubjectAccessReview

func GetClusterChanges

func GetClusterChanges(client clusterlister.PlacementDecisionLister, placement *clusterv1beta1.Placement,
	existingClusters sets.Set[string]) (sets.Set[string], sets.Set[string], error)

Get added and deleted clusters names

func GetHubConfigSSARs added in v0.14.0

func GetHubConfigSSARs(clusterName string) []authorizationv1.SelfSubjectAccessReview

func HasFinalizer added in v0.16.0

func HasFinalizer(finalizers []string, finalizer string) bool

func Md5HashSuffix added in v0.16.0

func Md5HashSuffix(hubClusterAccountId string, hubClusterName string, managedClusterAccountId string, managedClusterName string) string

func NewEventRecorder added in v0.14.0

func NewEventRecorder(ctx context.Context, scheme *runtime.Scheme,
	kubeClient kubernetes.Interface, controllerName string) (kevents.EventRecorder, error)

NewEventRecorder creates a new event recorder for the given controller, it will also log the events

Types

type PlacementDecisionGetter

type PlacementDecisionGetter struct {
	Client clusterlister.PlacementDecisionLister
}

func (PlacementDecisionGetter) List

type RequeueError added in v0.13.0

type RequeueError struct {
	RequeueTime time.Duration
	Message     string
}

func NewRequeueError added in v0.13.0

func NewRequeueError(msg string, requeueTime time.Duration) RequeueError

func (RequeueError) Error added in v0.13.0

func (r RequeueError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳