Documentation ¶
Index ¶
- func AddLabelToDeployment(clientset kubernetes.Interface, origDeployment *v1.Deployment, ...) error
- func AddLabelToPod(clientset kubernetes.Interface, origPod *v1.Pod, key, value, namespace string) error
- func Createpgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, namespace string) error
- func Createpgpolicy(client *rest.RESTClient, policy *crv1.Pgpolicy, namespace string) error
- func Createpgtask(client *rest.RESTClient, task *crv1.Pgtask, namespace string) error
- func Deletepgcluster(client *rest.RESTClient, name, namespace string) error
- func Deletepgpolicy(client *rest.RESTClient, name, namespace string) error
- func Deletepgreplica(client *rest.RESTClient, name, namespace string) error
- func Deletepgtask(client *rest.RESTClient, name, namespace string) error
- func ExecToPodThroughAPI(config *rest.Config, clientset kubernetes.Interface, command []string, ...) (string, string, error)
- func Getpgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, name, namespace string) (bool, error)
- func Getpgclusters(client *rest.RESTClient, clusterList *crv1.PgclusterList, namespace string) error
- func GetpgclustersBySelector(client *rest.RESTClient, clusterList *crv1.PgclusterList, ...) error
- func Getpgpolicies(client *rest.RESTClient, policyList *crv1.PgpolicyList, namespace string) error
- func Getpgpolicy(client *rest.RESTClient, policy *crv1.Pgpolicy, name, namespace string) (bool, error)
- func Getpgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, name, namespace string) (bool, error)
- func Getpgreplicas(client *rest.RESTClient, replicaList *crv1.PgreplicaList, namespace string) error
- func GetpgreplicasBySelector(client *rest.RESTClient, replicaList *crv1.PgreplicaList, ...) error
- func Getpgtask(client *rest.RESTClient, task *crv1.Pgtask, name, namespace string) (bool, error)
- func GetpgtasksBySelector(client *rest.RESTClient, taskList *crv1.PgtaskList, selector, namespace string) error
- func Int32(i int32) *int32
- func IsAlreadyExists(err error) bool
- func IsNotFound(err error) bool
- func NewKubeClient() (*rest.Config, *kubernetes.Clientset, error)
- func NewPGOClient() (*rest.Config, *rest.RESTClient, *clientset.Clientset, error)
- func PatchpgclusterStatus(restclient *rest.RESTClient, state crv1.PgclusterState, message string, ...) error
- func PatchpgpolicyStatus(restclient *rest.RESTClient, state crv1.PgpolicyState, message string, ...) error
- func PatchpgreplicaStatus(restclient *rest.RESTClient, state crv1.PgreplicaState, message string, ...) error
- func PatchpgtaskStatus(restclient *rest.RESTClient, state crv1.PgtaskState, message string, ...) error
- func PatchpgtaskWorkflowStatus(restclient *rest.RESTClient, oldCrd *crv1.Pgtask, namespace string) error
- func Updatepgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, name, namespace string) error
- func Updatepgpolicy(client *rest.RESTClient, task *crv1.Pgpolicy, name, namespace string) error
- func Updatepgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, name, namespace string) error
- func Updatepgtask(client *rest.RESTClient, task *crv1.Pgtask, name, namespace string) error
- type ControllerClients
- type GetEndpointRequest
- type GetEndpointResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLabelToDeployment ¶
func AddLabelToDeployment(clientset kubernetes.Interface, origDeployment *v1.Deployment, key, value, namespace string) error
func AddLabelToPod ¶
func Createpgcluster ¶
Createpgcluster creates a pgcluster
func Createpgpolicy ¶
Createpgpolicy creates a pgpolicy
func Createpgtask ¶
Createpgtask creates a pgtask
func Deletepgcluster ¶
func Deletepgcluster(client *rest.RESTClient, name, namespace string) error
Deletepgcluster deletes pgcluster by name
func Deletepgpolicy ¶
func Deletepgpolicy(client *rest.RESTClient, name, namespace string) error
Deletepgpolicy deletes pgpolicy by name
func Deletepgreplica ¶
func Deletepgreplica(client *rest.RESTClient, name, namespace string) error
Deletepgreplica deletes pgreplica by name
func Deletepgtask ¶
func Deletepgtask(client *rest.RESTClient, name, namespace string) error
Deletepgtask deletes pgtask by name
func ExecToPodThroughAPI ¶
func ExecToPodThroughAPI(config *rest.Config, clientset kubernetes.Interface, command []string, containerName, podName, namespace string, stdin io.Reader) (string, string, error)
ExecToPodThroughAPI uninterractively exec to the pod with the command specified. :param string command: list of the str which specify the command. :param string pod_name: Pod name :param string namespace: namespace of the Pod. :param io.Reader stdin: Standerd Input if necessary, otherwise `nil` :return: string: Output of the command. (STDOUT)
string: Errors. (STDERR) error: If any error has occurred otherwise `nil`
func Getpgcluster ¶
func Getpgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, name, namespace string) (bool, error)
Getpgcluster gets a pgcluster by name
func Getpgclusters ¶
func Getpgclusters(client *rest.RESTClient, clusterList *crv1.PgclusterList, namespace string) error
Getpgclusters gets a list of pgclusters
func GetpgclustersBySelector ¶
func GetpgclustersBySelector(client *rest.RESTClient, clusterList *crv1.PgclusterList, selector, namespace string) error
GetpgclustersBySelector gets a list of pgclusters by selector
func Getpgpolicies ¶
func Getpgpolicies(client *rest.RESTClient, policyList *crv1.PgpolicyList, namespace string) error
Getpgpolicies gets a list of pgpolicies
func Getpgpolicy ¶
func Getpgpolicy(client *rest.RESTClient, policy *crv1.Pgpolicy, name, namespace string) (bool, error)
Getpgpolicy gets a pgpolicies by name
func Getpgreplica ¶
func Getpgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, name, namespace string) (bool, error)
Getpgreplica gets a pgreplica by name
func Getpgreplicas ¶
func Getpgreplicas(client *rest.RESTClient, replicaList *crv1.PgreplicaList, namespace string) error
Getpgreplicas gets a list of pgreplicas
func GetpgreplicasBySelector ¶
func GetpgreplicasBySelector(client *rest.RESTClient, replicaList *crv1.PgreplicaList, selector, namespace string) error
GetpgreplicasBySelector gets a list of pgreplicas by selector
func GetpgtasksBySelector ¶
func GetpgtasksBySelector(client *rest.RESTClient, taskList *crv1.PgtaskList, selector, namespace string) error
GetpgtasksBySelector gets a list of pgtasks by selector
func IsAlreadyExists ¶
IsAlreadyExists returns true if the err indicates that a resource already exists.
func IsNotFound ¶
IsNotFound returns true if err indicates that a resource was not found.
func NewKubeClient ¶
func NewKubeClient() (*rest.Config, *kubernetes.Clientset, error)
NewKubeClient returns a Clientset for interacting with Kubernetes resources, along with the REST config used to create the client
func NewPGOClient ¶
NewPGOClient returns a Clientset and a REST client for interacting with PostgreSQL Operator resources, along with the REST config used to create the clients
func PatchpgclusterStatus ¶
func PatchpgclusterStatus(restclient *rest.RESTClient, state crv1.PgclusterState, message string, oldCrd *crv1.Pgcluster, namespace string) error
func PatchpgpolicyStatus ¶
func PatchpgpolicyStatus(restclient *rest.RESTClient, state crv1.PgpolicyState, message string, oldCrd *crv1.Pgpolicy, namespace string) error
func PatchpgreplicaStatus ¶
func PatchpgreplicaStatus(restclient *rest.RESTClient, state crv1.PgreplicaState, message string, oldCrd *crv1.Pgreplica, namespace string) error
func PatchpgtaskStatus ¶
func PatchpgtaskStatus(restclient *rest.RESTClient, state crv1.PgtaskState, message string, oldCrd *crv1.Pgtask, namespace string) error
func Updatepgcluster ¶
func Updatepgcluster(client *rest.RESTClient, cluster *crv1.Pgcluster, name, namespace string) error
Updatepgcluster updates a pgcluster
func Updatepgpolicy ¶
Updatepgpolicy
func Updatepgreplica ¶
func Updatepgreplica(client *rest.RESTClient, replica *crv1.Pgreplica, name, namespace string) error
Updatepgreplica updates a pgreplica
func Updatepgtask ¶
Updatepgtask updates a pgtask
Types ¶
type ControllerClients ¶
type ControllerClients struct { Config *rest.Config Kubeclientset *kubernetes.Clientset PGOClientset *clientset.Clientset PGORestclient *rest.RESTClient }
ControllerClients stores the various clients needed by a controller
func NewControllerClients ¶
func NewControllerClients() (*ControllerClients, error)
NewControllerClients returns a ControllerClients struct containing the various clients needed for a controller. This includes a Kubernetes Clientset, along with a PGO Clientset with its associated RESTClient and its underlying configuration. The Clientset is configured with a higher than normal QPS and Burst limit.
type GetEndpointRequest ¶
type GetEndpointRequest struct { Clientset kubernetes.Interface // Kubernetes Clientset that interfaces with the Kubernetes cluster Name string // Name of the endpoint that is being queried Namespace string // Namespace the endpoint being queried resides in }
GetEndpointRequest is used for the GetEndpoint function, which includes the current Kubernetes request context, as well as the namespace / endpoint name being requested
type GetEndpointResponse ¶
type GetEndpointResponse struct { Endpoint *v1.Endpoints // Kubernetes Endpoint object that specifics about the endpoint Name string // Name of the endpoint Namespace string // Namespace that the endpoint is in }
GetEndpointResponse contains the results from a successful request to the endpoint API, including the Kubernetes Endpoint as well as the original request data
func GetEndpoint ¶
func GetEndpoint(request *GetEndpointRequest) (*GetEndpointResponse, error)
GetEndpoint tries to find an individual endpoint in a namespace. Returns the endpoint object if it can be IsNotFound If no endpoint can be found, then an error is returned