Documentation
¶
Overview ¶
Package utils implements utility functions
Index ¶
- func GetClusterOwner(client client.Client, ctx context.Context, obj metav1.ObjectMeta) *teranodev1alpha1.Cluster
- func GetPrometheusLabels() map[string]string
- func GetScaleStatusFromDeployment(deployment *appsv1.Deployment) (replicas int32, selector string)
- func ReconcileBatch(l logr.Logger, reconcileFunctions ...ReconcileFunc) (bool, error)
- func SetClusterOverrides(client client.Client, dep *appsv1.Deployment, cr v1alpha1.TeranodeService)
- func SetDeploymentOverrides(client client.Client, dep *appsv1.Deployment, cr v1alpha1.TeranodeService)
- func SetDeploymentOverridesWithContext(ctx context.Context, log logr.Logger, client client.Client, ...)
- func UpdateScaleStatus(ctx context.Context, c client.Client, namespace, deploymentName string, ...) error
- type ReconcileFunc
- type ScaleStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClusterOwner ¶
func GetClusterOwner(client client.Client, ctx context.Context, obj metav1.ObjectMeta) *teranodev1alpha1.Cluster
func GetPrometheusLabels ¶
GetPrometheusLabels returns a map of labels used for prometheus scraping
func GetScaleStatusFromDeployment ¶ added in v0.2.1
func GetScaleStatusFromDeployment(deployment *appsv1.Deployment) (replicas int32, selector string)
GetScaleStatusFromDeployment extracts replicas and selector from a deployment
func ReconcileBatch ¶
func ReconcileBatch(l logr.Logger, reconcileFunctions ...ReconcileFunc) (bool, error)
ReconcileBatch will reconcile a batch of functions
func SetClusterOverrides ¶
func SetClusterOverrides(client client.Client, dep *appsv1.Deployment, cr v1alpha1.TeranodeService)
func SetDeploymentOverrides ¶
func SetDeploymentOverrides(client client.Client, dep *appsv1.Deployment, cr v1alpha1.TeranodeService)
func SetDeploymentOverridesWithContext ¶ added in v0.2.1
func UpdateScaleStatus ¶ added in v0.2.1
func UpdateScaleStatus(ctx context.Context, c client.Client, namespace, deploymentName string, status ScaleStatus) error
UpdateScaleStatus updates the scale-related status fields (replicas and selector) for a CR based on the actual deployment state. This is required for the /scale subresource to work properly.
Types ¶
type ReconcileFunc ¶
ReconcileFunc is a reconcile function type
type ScaleStatus ¶ added in v0.2.1
ScaleStatus defines the interface for CRs that support scale subresource
Click to show internal directories.
Click to hide internal directories.