Documentation ¶
Index ¶
- Constants
- Variables
- func Authn(perm string, w http.ResponseWriter, r *http.Request) (string, error)
- func BasicAuthCheck(username, password string) bool
- func BasicAuthzCheck(username, perm string) bool
- func ConnectToKube()
- func CreateRMDataTask(storageSpec crv1.PgStorageSpec, clusterName, pvcName string, ...) error
- func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string
- func GetNamespace(username, requestedNS string) (string, error)
- func GetPVCName(pod *v1.Pod) map[string]string
- func GetPodStatus(deployName string) (string, string)
- func GetSecrets(cluster *crv1.Pgcluster) ([]msgs.ShowUserSecret, error)
- func HasPerm(role string, perm string) bool
- func Initialize()
- func InitializePerms()
- func IsValidContainerResource(name string) bool
- func IsValidContainerResourceValues() bool
- func IsValidNodeLabel(key, value string) (bool, bool, error)
- func IsValidStorageName(name string) bool
- func ValidateNodeLabel(nodeLabel string) error
- type CredentialDetail
Constants ¶
const APPLY_POLICY_PERM = "ApplyPolicy"
MISC
const AffinityTemplatePath = "/pgo-config/affinity.json"
const CREATE_BACKUP_PERM = "CreateBackup"
CREATE
const CREATE_BENCHMARK_PERM = "CreateBenchmark"
const CREATE_CLUSTER_PERM = "CreateCluster"
const CREATE_DUMP_PERM = "CreateDump"
const CREATE_FAILOVER_PERM = "CreateFailover"
const CREATE_INGEST_PERM = "CreateIngest"
const CREATE_PGBOUNCER_PERM = "CreatePgbouncer"
const CREATE_PGPOOL_PERM = "CreatePgpool"
const CREATE_POLICY_PERM = "CreatePolicy"
const CREATE_SCHEDULE_PERM = "CreateSchedule"
const CREATE_UPGRADE_PERM = "CreateUpgrade"
const CREATE_USER_PERM = "CreateUser"
const DELETE_BACKUP_PERM = "DeleteBackup"
DELETE
const DELETE_BENCHMARK_PERM = "DeleteBenchmark"
const DELETE_CLUSTER_PERM = "DeleteCluster"
const DELETE_INGEST_PERM = "DeleteIngest"
const DELETE_PGBOUNCER_PERM = "DeletePgbouncer"
const DELETE_PGPOOL_PERM = "DeletePgpool"
const DELETE_POLICY_PERM = "DeletePolicy"
const DELETE_SCHEDULE_PERM = "DeleteSchedule"
const DELETE_UPGRADE_PERM = "DeleteUpgrade"
const DELETE_USER_PERM = "DeleteUser"
const DF_CLUSTER_PERM = "DfCluster"
const LABEL_PERM = "Label"
const LOAD_PERM = "Load"
const RELOAD_PERM = "Reload"
const RESTORE_DUMP_PERM = "RestoreDump"
RESTORE
const RESTORE_PERM = "Restore"
const SCALE_CLUSTER_PERM = "ScaleCluster"
SCALE
const SHOW_BACKUP_PERM = "ShowBackup"
SHOW
const SHOW_BENCHMARK_PERM = "ShowBenchmark"
const SHOW_CLUSTER_PERM = "ShowCluster"
const SHOW_CONFIG_PERM = "ShowConfig"
const SHOW_INGEST_PERM = "ShowIngest"
const SHOW_POLICY_PERM = "ShowPolicy"
const SHOW_PVC_PERM = "ShowPVC"
const SHOW_SCHEDULE_PERM = "ShowSchedule"
const SHOW_SECRETS_PERM = "ShowSecrets"
const SHOW_UPGRADE_PERM = "ShowUpgrade"
const SHOW_WORKFLOW_PERM = "ShowWorkflow"
const STATUS_PERM = "Status"
const TEST_CLUSTER_PERM = "TestCluster"
const TreeBranch = "├── "
TreeBranch is for debugging only in this context
const TreeTrunk = "└── "
TreeTrunk is for debugging only in this context
const UPDATE_CLUSTER_PERM = "UpdateCluster"
UPDATE
const USER_PERM = "User"
const VERSION_MISMATCH_ERROR = "pgo client and server version mismatch"
const VERSION_PERM = "Version"
Variables ¶
var AffinityTemplate *template.Template
var AuditFlag bool
AuditFlag if set to true will cause auditing to occur in the logs
var BasicAuth bool
BasicAuth comes from the apiserver config
var CRUNCHY_DEBUG bool
var Clientset *kubernetes.Clientset
Clientset ...
var ContainerResourcesTemplate *template.Template
var Credentials map[string]CredentialDetail
Credentials holds the BasicAuth credentials found in the config
var DebugFlag bool
DebugFlag is the debug flag value
var JobTemplate *template.Template
var LoadTemplate *template.Template
var LspvcTemplate *template.Template
var MetricsFlag, BadgerFlag bool
MetricsFlag if set to true will cause crunchy-collect to be added into new clusters
var Namespace string
Namespace comes from the apiserver config in this version
var PermMap map[string]string
var Pgo config.PgoConfig
var RESTClient *rest.RESTClient
RESTClient ...
var RESTConfig *rest.Config
var RoleMap map[string]map[string]string
Functions ¶
func BasicAuthCheck ¶
func BasicAuthzCheck ¶
func CreateRMDataTask ¶
func GetContainerResourcesJSON ¶
func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string
GetContainerResources ...
func GetNamespace ¶
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 GetPodStatus ¶
func GetSecrets ¶
func GetSecrets(cluster *crv1.Pgcluster) ([]msgs.ShowUserSecret, error)
TODO remove and replace with util.GetSecrets
func Initialize ¶
func Initialize()
func InitializePerms ¶
func InitializePerms()
func IsValidContainerResourceValues ¶
func IsValidContainerResourceValues() bool
func IsValidNodeLabel ¶
IsValidNodeLabel returns bool for key validity returns bool for value validity returns error
func IsValidStorageName ¶
func ValidateNodeLabel ¶
ValidateNodeLabel returns error if node label is invalid