Documentation ¶
Overview ¶
Package admission contains the implementation of the admission webhook.
Index ¶
Constants ¶
View Source
const ( // CloudSQLProxyContainerName is the name of the Cloud SQL proxy container injected in each pod. CloudSQLProxyContainerName = "cloud-sql-proxy" // PghostEnvVarName is the name of the "PGHOST" environment variable injected in each container. PghostEnvVarName = "PGHOST" // PgportEnvVarName is the name of the "PGPORT" environment variable injected in each container. PgportEnvVarName = "PGPORT" // PguserEnvVarName is the name of the "PGUSER" environment variable injected in each container. PguserEnvVarName = "PGUSER" // PgpassfileEnvVarName is the name of the "PGPASSFILE" environment variable injected in each container. PgpassfileEnvVarName = "PGPASSFILE" )
View Source
const ( // PostgresqlInstanceSpecFlagsSeparator is the separator that must be used between "<name>" and "<value>" in each item present in the ".spec.flags" field of a PostgresqlInstance resource. PostgresqlInstanceSpecFlagsSeparator = "=" // PostgresqlInstanceSpecLabelsOwnerName is the name of the "owner" label set injected on the ".spec.labels" field of a PostgresqlInstance resource. PostgresqlInstanceSpecLabelsOwnerName = "owner" )
Variables ¶
View Source
var ( // PostgresqlInstanceSpecAvailabilityTypeDefault is the default value for the ".spec.availability.type" field of a PostgresqlInstance resource. PostgresqlInstanceSpecAvailabilityTypeDefault = v1alpha1.PostgresqlInstanceSpecAvailabilityTypeZonal // PostgresqlInstanceSpecBackupsDailyEnabledDefault is the default value for the ".spec.backups.daily.enabled" field of a PostgresqlInstance resource. PostgresqlInstanceSpecBackupsDailyEnabledDefault = true // PostgresqlInstanceSpecBackupsDailyStartTimeDefault is the default value for the ".spec.backups.daily.startTime" field of a PostgresqlInstance resource. PostgresqlInstanceSpecBackupsDailyStartTimeDefault = "00:00" // PostgresqlInstanceSpecLocationRegionDefault is the default value for the ".spec.location.region" field of a PostgresqlInstance resource. PostgresqlInstanceSpecLocationRegionDefault = "europe-west1" // PostgresqlInstanceSpecLocationZoneDefault is the default value for the ".spec.location.zone" field of a PostgresqlInstance resource. PostgresqlInstanceSpecLocationZoneDefault = v1alpha1.PostgresqlInstanceSpecLocationZoneAny // PostgresqlInstanceSpecMaintenanceDayDefault is the default value for the ".spec.maintenance.day" field of a PostgresqlInstance resource. PostgresqlInstanceSpecMaintenanceDayDefault = v1alpha1.PostgresqlInstanceSpecMaintenanceDayAny // PostgresqlInstanceSpecNetworkingPrivateIPEnabledDefault is the default value for the ".spec.networking.privateIp.enabled" field of a PostgresqlInstance resource. PostgresqlInstanceSpecNetworkingPrivateIPEnabledDefault = false // PostgresqlInstanceSpecNetworkingPrivateIPNetworkDefault is the default value for the ".spec.networking.privateIp.network" field of a PostgresqlInstance resource. PostgresqlInstanceSpecNetworkingPrivateIPNetworkDefault = "" // PostgresqlInstanceSpecNetworkingPublicIPEnabledDefault is the default value for the ".spec.networking.publicIp.enabled" field of a PostgresqlInstance resource. PostgresqlInstanceSpecNetworkingPublicIPEnabledDefault = false // PostgresqlInstanceSpecResourcesDiskSizeMaximumGbDefault is the default value for the ".spec.resources.disk.sizeMaximumGb" field of a PostgresqlInstance resource. PostgresqlInstanceSpecResourcesDiskSizeMaximumGbDefault = int32(0) // PostgresqlInstanceSpecResourcesDiskSizeMinimumGbDefault is the default value for the ".spec.resources.disk.sizeMinimumGb" field of a PostgresqlInstance resource. PostgresqlInstanceSpecResourcesDiskSizeMinimumGbDefault = int32(10) // PostgresqlInstanceSpecResourcesDiskTypeDefault is the default value for the ".spec.resources.disk.type" field of a PostgresqlInstance resource. PostgresqlInstanceSpecResourcesDiskTypeDefault = v1alpha1.PostgresqlInstanceSpecResourceDiskTypeSSD // PostgresqlInstanceSpecResourcesInstanceTypeDefault is the default value for the ".spec.resources.instanceType" field of a PostgresqlInstance resource. PostgresqlInstanceSpecResourcesInstanceTypeDefault = "db-custom-1-3840" // PostgresqlInstanceSpecVersionDefault is the default value for the ".spec.version" field of a PostgresqlInstance resource. PostgresqlInstanceSpecVersionDefault = v1alpha1.PostgresqlInstanceSpecVersion96 )
Functions ¶
func CreateRFC6902Patch ¶
CreateRFC6902Patch creates an RFC6902 patch that captures the difference between the specified objects.
func PostgresqlInstanceSpecMaintenanceHourDefault ¶
func PostgresqlInstanceSpecMaintenanceHourDefault(v v1alpha1.PostgresqlInstanceSpecMaintenanceDay) v1alpha1.PostgresqlInstanceSpecMaintenanceHour
PostgresqlInstanceSpecMaintenanceHourDefault returns the default value for the ".spec.maintenance.hour" field of a PostgresqlInstance resource based on the provided maintenance hour.
Types ¶
type Webhook ¶
type Webhook struct {
// contains filtered or unexported fields
}
Webhook represents an instance of the admission webhook.
func NewWebhook ¶
func NewWebhook(kubeClient kubernetes.Interface, selfClient selfClient.Interface, cloudsqlClient *cloudsqladmin.Service, config configuration.Configuration) (*Webhook, error)
NewWebhook creates a new instance of the admission webhook.
func (*Webhook) Register ¶
func (w *Webhook) Register(kubeClient kubernetes.Interface, cfg configuration.Configuration) error
Register registers the admission webhook by making sure a MutatingWebhookConfiguration resource with the desired configuration exists.
Click to show internal directories.
Click to hide internal directories.