plugin

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package plugin contains the common behaviors of the kubectl-cnpg subcommand

Index

Constants

View Source
const (
	// OutputFormatText means just use a human-readable output
	OutputFormatText = "text"

	// OutputFormatJSON means use machine-readable JSON output
	OutputFormatJSON = "json"

	// OutputFormatYAML means use machine-readable JSON output
	OutputFormatYAML = "yaml"
)

Variables

View Source
var (
	// Namespace to operate in
	Namespace string

	// NamespaceExplicitlyPassed indicates if the namespace was passed manually
	NamespaceExplicitlyPassed bool

	// Config is the Kubernetes configuration used
	Config *rest.Config

	// Client is the controller-runtime client
	Client client.Client

	// ClientInterface contains the interface used i the plugin
	ClientInterface kubernetes.Interface
)

Functions

func CompleteClusters added in v1.21.4

func CompleteClusters(ctx context.Context, args []string, toComplete string) []string

CompleteClusters will complete the cluster name when necessary getting the list from the current namespace

func CreateAndGenerateObjects added in v1.18.1

func CreateAndGenerateObjects(ctx context.Context, k8sObject []client.Object, option bool) error

CreateAndGenerateObjects creates provided k8s object or generate manifest collectively

func GetPGControlData added in v1.21.0

func GetPGControlData(
	ctx context.Context,
	pod corev1.Pod,
) (string, error)

GetPGControlData obtains the PgControldata from the passed pod by doing an exec. This approach should be used only in the plugin commands.

func Print

func Print(o interface{}, format OutputFormat, writer io.Writer) error

Print output an object via an io.Writer in a machine-readable way

func RequiresArguments added in v1.21.4

func RequiresArguments(nArgs int) cobra.PositionalArgs

RequiresArguments will show the help message in case no argument has been provided

func SetupKubernetesClient added in v1.18.0

func SetupKubernetesClient(configFlags *genericclioptions.ConfigFlags) error

SetupKubernetesClient creates a k8s client to be used inside the kubectl-cnpg utility

Types

type OutputFormat

type OutputFormat string

OutputFormat represent the output format supported by this command

Directories

Path Synopsis
Package backup implements a command to request an on-demand backup for a PostgreSQL cluster
Package backup implements a command to request an on-demand backup for a PostgreSQL cluster
Package certificate implement the kubectl-cnpg certificate command
Package certificate implement the kubectl-cnpg certificate command
Package destroy implements a command to destroy an instances of a cluster and its associated PVC
Package destroy implements a command to destroy an instances of a cluster and its associated PVC
Package fence implements a command to fence instances in a cluster
Package fence implements a command to fence instances in a cluster
Package fio implements the fio job creation via deployment
Package fio implements the fio job creation via deployment
Package hibernate implements the hibernation feature
Package hibernate implements the hibernation feature
Package install implements the install plugin command
Package install implements the install plugin command
Package logical contains the common features of the publication/subscription management
Package logical contains the common features of the publication/subscription management
publication
Package publication contains the implementation of the kubectl cnpg publication command
Package publication contains the implementation of the kubectl cnpg publication command
publication/create
Package create contains the implementation of the kubectl cnpg publication create command
Package create contains the implementation of the kubectl cnpg publication create command
publication/drop
Package drop contains the implementation of the kubectl cnpg publication drop command
Package drop contains the implementation of the kubectl cnpg publication drop command
subscription
Package subscription contains the implementation of the kubectl cnpg subscription command
Package subscription contains the implementation of the kubectl cnpg subscription command
subscription/create
Package create contains the implementation of the kubectl cnpg subscription create command
Package create contains the implementation of the kubectl cnpg subscription create command
subscription/drop
Package drop contains the implementatoin of the cnpg subscription drop command
Package drop contains the implementatoin of the cnpg subscription drop command
subscription/syncsequences
Package syncsequences contains the implementation of the kubectl cnpg subscription sync-sequences command
Package syncsequences contains the implementation of the kubectl cnpg subscription sync-sequences command
Package logs implements the kubectl-cnpg logs command
Package logs implements the kubectl-cnpg logs command
Package maintenance implements the kubectl-cnpg maintenance sub-command
Package maintenance implements the kubectl-cnpg maintenance sub-command
Package pgadmin implements the creation of a pgadmin deployment
Package pgadmin implements the creation of a pgadmin deployment
Package pgbench implements the pgbench job creation
Package pgbench implements the pgbench job creation
Package promote implement the kubectl-cnpg promote command
Package promote implement the kubectl-cnpg promote command
Package psql implements the `kubectl cnpg psql` command
Package psql implements the `kubectl cnpg psql` command
Package reload implements a command to trigger a reconciliation loop for a cluster
Package reload implements a command to trigger a reconciliation loop for a cluster
Package report implements the kubectl-cnpg report command
Package report implements the kubectl-cnpg report command
Package restart implements a command to rollout restart a cluster or restart a single instance
Package restart implements a command to rollout restart a cluster or restart a single instance
Package snapshot implements the snapshot feature
Package snapshot implements the snapshot feature
Package status implements the kubectl-cnpg status command
Package status implements the kubectl-cnpg status command

Jump to

Keyboard shortcuts

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