Documentation
¶
Overview ¶
Package operator provides functions to handle and manage the operator
Package operator provide functions to handle operator install/uninstall process
Index ¶
- func Architectures(operatorPod *corev1.Pod) ([]string, error)
- func CreateConfigMap(ctx context.Context, crudClient client.Client, ...)
- func Dump(ctx context.Context, crudClient client.Client, namespace, filename string)
- func GetAvailableReleases(releasesPath string) ([]*semver.Version, error)
- func GetDeployment(ctx context.Context, crudClient client.Client) (appsv1.Deployment, error)
- func GetLeaderInfoFromLease(ctx context.Context, kubeInterface kubernetes.Interface, ...) (string, error)
- func GetMostRecentReleaseTag(releasesPath string) (string, error)
- func GetMutatingWebhookByName(ctx context.Context, crudClient client.Client, name string) (*admissionregistrationv1.MutatingWebhookConfiguration, int, error)
- func GetPod(ctx context.Context, crudClient client.Client) (corev1.Pod, error)
- func GetPodName(ctx context.Context, crudClient client.Client) (string, error)
- func GetValidatingWebhookByName(ctx context.Context, crudClient client.Client, name string) (*admissionregistrationv1.ValidatingWebhookConfiguration, int, error)
- func HasBeenUpgraded(ctx context.Context, crudClient client.Client) bool
- func InstallLatest(crudClient client.Client, releaseTag string)
- func IsReady(ctx context.Context, crudClient client.Client, checkWebhook bool) (bool, error)
- func NamespaceName(ctx context.Context, crudClient client.Client) (string, error)
- func PodRenamed(operatorPod corev1.Pod, expectedOperatorPodName string) bool
- func PodRestarted(operatorPod corev1.Pod) bool
- func ReloadDeployment(ctx context.Context, crudClient client.Client, timeoutSeconds uint) error
- func ScaleOperatorDeployment(ctx context.Context, crudClient client.Client, replicas int32) error
- func UpdateMutatingWebhookConf(ctx context.Context, kubeInterface kubernetes.Interface, ...) error
- func UpdateValidatingWebhookConf(ctx context.Context, kubeInterface kubernetes.Interface, ...) error
- func Version(namespace, podName string) (string, error)
- func WaitForReady(ctx context.Context, crudClient client.Client, timeoutSeconds uint, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Architectures ¶
Architectures returns all the supported operator architectures
func CreateConfigMap ¶
func CreateConfigMap( ctx context.Context, crudClient client.Client, pgOperatorNamespace, configName string, isOnline bool, )
CreateConfigMap creates the operator namespace and enables/disable the online upgrade for the instance manager
func GetAvailableReleases ¶
GetAvailableReleases retrieves all the available releases from the list of YAML files in the top-level `releases/` directory.
func GetDeployment ¶
GetDeployment returns the operator Deployment if there is a single one running, error otherwise
func GetLeaderInfoFromLease ¶
func GetLeaderInfoFromLease( ctx context.Context, kubeInterface kubernetes.Interface, operatorNamespace string, ) (string, error)
GetLeaderInfoFromLease gathers leader holderIdentity from the lease
func GetMostRecentReleaseTag ¶
GetMostRecentReleaseTag retrieves the most recent release tag from the list of YAML files in the top-level `releases/` directory. Used for testing upgrades, so: if we're in a release branch, the MostRecent should be the next-to-last release
func GetMutatingWebhookByName ¶
func GetMutatingWebhookByName( ctx context.Context, crudClient client.Client, name string, ) ( *admissionregistrationv1.MutatingWebhookConfiguration, int, error, )
GetMutatingWebhookByName get the MutatingWebhook filtered by the name of one of the webhooks
func GetPodName ¶
GetPodName returns the name of the current operator pod NOTE: will return an error if the pod is being deleted
func GetValidatingWebhookByName ¶
func GetValidatingWebhookByName( ctx context.Context, crudClient client.Client, name string, ) ( *admissionregistrationv1.ValidatingWebhookConfiguration, int, error, )
GetValidatingWebhookByName get ValidatingWebhook by the name of one of the webhooks
func HasBeenUpgraded ¶
HasBeenUpgraded determines if the operator has been upgraded by checking if there is a deletion timestamp. If there isn't, it returns true
func InstallLatest ¶
InstallLatest installs an operator version with the most recent release tag
func NamespaceName ¶
NamespaceName returns the namespace the operator Deployment is running in
func PodRenamed ¶
PodRenamed checks if the operator pod was renamed
func PodRestarted ¶
PodRestarted checks if the operator pod was restarted
func ReloadDeployment ¶
ReloadDeployment finds and deletes the operator pod. Returns error if the new pod is not ready within a defined timeout
func ScaleOperatorDeployment ¶
func ScaleOperatorDeployment( ctx context.Context, crudClient client.Client, replicas int32, ) error
ScaleOperatorDeployment will scale the operator to n replicas and return an error in case of failure
func UpdateMutatingWebhookConf ¶
func UpdateMutatingWebhookConf( ctx context.Context, kubeInterface kubernetes.Interface, wh *admissionregistrationv1.MutatingWebhookConfiguration, ) error
UpdateMutatingWebhookConf update MutatingWebhookConfiguration object
func UpdateValidatingWebhookConf ¶
func UpdateValidatingWebhookConf( ctx context.Context, kubeInterface kubernetes.Interface, wh *admissionregistrationv1.ValidatingWebhookConfiguration, ) error
UpdateValidatingWebhookConf update the ValidatingWebhook object
Types ¶
This section is empty.