apiserver

package
v3.5.5-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const APPLY_POLICY_PERM = "ApplyPolicy"

MISC

View Source
const AffinityTemplatePath = "/pgo-config/affinity.json"
View Source
const CREATE_BACKUP_PERM = "CreateBackup"

CREATE

View Source
const CREATE_BENCHMARK_PERM = "CreateBenchmark"
View Source
const CREATE_CLUSTER_PERM = "CreateCluster"
View Source
const CREATE_DUMP_PERM = "CreateDump"
View Source
const CREATE_FAILOVER_PERM = "CreateFailover"
View Source
const CREATE_INGEST_PERM = "CreateIngest"
View Source
const CREATE_PGBOUNCER_PERM = "CreatePgbouncer"
View Source
const CREATE_PGPOOL_PERM = "CreatePgpool"
View Source
const CREATE_POLICY_PERM = "CreatePolicy"
View Source
const CREATE_SCHEDULE_PERM = "CreateSchedule"
View Source
const CREATE_UPGRADE_PERM = "CreateUpgrade"
View Source
const CREATE_USER_PERM = "CreateUser"
View Source
const DELETE_BACKUP_PERM = "DeleteBackup"

DELETE

View Source
const DELETE_BENCHMARK_PERM = "DeleteBenchmark"
View Source
const DELETE_CLUSTER_PERM = "DeleteCluster"
View Source
const DELETE_INGEST_PERM = "DeleteIngest"
View Source
const DELETE_PGBOUNCER_PERM = "DeletePgbouncer"
View Source
const DELETE_PGPOOL_PERM = "DeletePgpool"
View Source
const DELETE_POLICY_PERM = "DeletePolicy"
View Source
const DELETE_SCHEDULE_PERM = "DeleteSchedule"
View Source
const DELETE_UPGRADE_PERM = "DeleteUpgrade"
View Source
const DELETE_USER_PERM = "DeleteUser"
View Source
const DF_CLUSTER_PERM = "DfCluster"
View Source
const LABEL_PERM = "Label"
View Source
const LOAD_PERM = "Load"
View Source
const RELOAD_PERM = "Reload"
View Source
const RESTORE_DUMP_PERM = "RestoreDump"

RESTORE

View Source
const RESTORE_PERM = "Restore"
View Source
const SCALE_CLUSTER_PERM = "ScaleCluster"

SCALE

View Source
const SHOW_BACKUP_PERM = "ShowBackup"

SHOW

View Source
const SHOW_BENCHMARK_PERM = "ShowBenchmark"
View Source
const SHOW_CLUSTER_PERM = "ShowCluster"
View Source
const SHOW_CONFIG_PERM = "ShowConfig"
View Source
const SHOW_INGEST_PERM = "ShowIngest"
View Source
const SHOW_POLICY_PERM = "ShowPolicy"
View Source
const SHOW_PVC_PERM = "ShowPVC"
View Source
const SHOW_SCHEDULE_PERM = "ShowSchedule"
View Source
const SHOW_SECRETS_PERM = "ShowSecrets"
View Source
const SHOW_UPGRADE_PERM = "ShowUpgrade"
View Source
const SHOW_WORKFLOW_PERM = "ShowWorkflow"
View Source
const STATUS_PERM = "Status"
View Source
const TEST_CLUSTER_PERM = "TestCluster"
View Source
const TreeBranch = "├── "

TreeBranch is for debugging only in this context

View Source
const TreeTrunk = "└── "

TreeTrunk is for debugging only in this context

View Source
const UPDATE_CLUSTER_PERM = "UpdateCluster"

UPDATE

View Source
const USER_PERM = "User"
View Source
const VERSION_MISMATCH_ERROR = "pgo client and server version mismatch"
View Source
const VERSION_PERM = "Version"

Variables

View Source
var AffinityTemplate *template.Template
View Source
var AuditFlag bool

AuditFlag if set to true will cause auditing to occur in the logs

View Source
var BasicAuth bool

BasicAuth comes from the apiserver config

View Source
var CRUNCHY_DEBUG bool

Clientset ...

View Source
var ContainerResourcesTemplate *template.Template
View Source
var Credentials map[string]CredentialDetail

Credentials holds the BasicAuth credentials found in the config

View Source
var DebugFlag bool

DebugFlag is the debug flag value

View Source
var JobTemplate *template.Template
View Source
var LoadTemplate *template.Template
View Source
var LspvcTemplate *template.Template
View Source
var MetricsFlag, BadgerFlag bool

MetricsFlag if set to true will cause crunchy-collect to be added into new clusters

View Source
var Namespace string

Namespace comes from the apiserver config in this version

View Source
var PermMap map[string]string
View Source
var RESTClient *rest.RESTClient

RESTClient ...

View Source
var RESTConfig *rest.Config
View Source
var RoleMap map[string]map[string]string

Functions

func Authn

func Authn(perm string, w http.ResponseWriter, r *http.Request) (string, error)

func BasicAuthCheck

func BasicAuthCheck(username, password string) bool

func BasicAuthzCheck

func BasicAuthzCheck(username, perm string) bool

func ConnectToKube

func ConnectToKube()

ConnectToKube ...

func CreateRMDataTask

func CreateRMDataTask(storageSpec crv1.PgStorageSpec, clusterName, pvcName string, dataRoots []string, taskName, ns string) error

func GetContainerResourcesJSON

func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string

GetContainerResources ...

func GetNamespace

func GetNamespace(username, requestedNS string) (string, error)

GetNamespace determines if a user has permission for a namespace they are requesting as well as looks up a default namespace if the requestedNS is empty

func GetPVCName

func GetPVCName(pod *v1.Pod) map[string]string

func GetPodStatus

func GetPodStatus(deployName string) (string, string)

func GetSecrets

func GetSecrets(cluster *crv1.Pgcluster) ([]msgs.ShowUserSecret, error)

TODO remove and replace with util.GetSecrets

func HasPerm

func HasPerm(role string, perm string) bool

func Initialize

func Initialize()

func InitializePerms

func InitializePerms()

func IsValidContainerResource

func IsValidContainerResource(name string) bool

func IsValidContainerResourceValues

func IsValidContainerResourceValues() bool

func IsValidNodeLabel

func IsValidNodeLabel(key, value string) (bool, bool, error)

IsValidNodeLabel returns bool for key validity returns bool for value validity returns error

func IsValidStorageName

func IsValidStorageName(name string) bool

func ValidateNodeLabel

func ValidateNodeLabel(nodeLabel string) error

ValidateNodeLabel returns error if node label is invalid

Types

type CredentialDetail

type CredentialDetail struct {
	Username string
	Password string
	Role     string
}

Jump to

Keyboard shortcuts

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