webhook

package
v0.0.0-...-81337d3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const ExclusivesConfigPath = "/etc/config/validation/exclusives"

ExclusivesConfigPath is path where the ConfigMap is mounted for the mutual exclusive specifiction fields

View Source
const IBMCloudCatalogURI = "https://globalcatalog.cloud.ibm.com/api/v1"

IBMCloudCatalogURI is the uri for IBM cloud service catalog. It is used by validator to verify if a service plan is updateable.

View Source
const ImmutablesConfigPath = "/etc/config/validation/immutables"

ImmutablesConfigPath is path where the ConfigMap is mounted for the immutable specifiction fields

View Source
const LabelsConfigPath = "/etc/config/validation/labels"

LabelsConfigPath is path where the ConfigMap is mounted for the required labels

View Source
const MutateWhConfigPath = "/etc/config/mutate-wh/config"

MutateWhConfigPath is path where the ConfigMap is mounted for the validating webhook config data

View Source
const ValidateWhConfigPath = "/etc/config/validate-wh/config"

ValidateWhConfigPath is path where the ConfigMap is mounted for the validating webhook config data

Variables

View Source
var AddToManagerFuncs []func(manager.Manager) error

AddToManagerFuncs is a list of functions to add all Controllers to the Manager

Functions

func AddToManager

func AddToManager(m manager.Manager) error

AddToManager adds all Controllers to the Manager +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=mutatingwebhookconfigurations;validatingwebhookconfigurations,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups="",resources="",verbs=get;list +kubebuilder:rbac:groups="ibmcloud.ibm.com",resources="*",verbs=get;list

func Parse

func Parse(key string, value interface{}) (map[string]interface{}, error)

Parse parses a json map and returns a flat map[string] with all keys in lowercase

Types

type AdmissionMutator

type AdmissionMutator struct {
	// contains filtered or unexported fields
}

AdmissionMutator - Mutating webhook for seed resources

func (*AdmissionMutator) Handle

Handle - handle mutating admission control requests

func (*AdmissionMutator) InjectClient

func (m *AdmissionMutator) InjectClient(c client.Client) error

InjectClient injects the client into the AdmissionMutator

type AdmissionObj

type AdmissionObj struct {
	TypeMeta   metav1.TypeMeta   `json:",inline"`
	ObjectMeta metav1.ObjectMeta `json:"metadata"`
}

AdmissionObj a general struct for kube request object

type AdmissionValidator

type AdmissionValidator struct {
	// contains filtered or unexported fields
}

AdmissionValidator - Validating webhook for seed resources

func (*AdmissionValidator) Handle

Handle handles admission validation

func (*AdmissionValidator) InjectClient

func (v *AdmissionValidator) InjectClient(c client.Client) error

InjectClient injects the client into the AdmissionValidator

type AdmissionWhConfig

type AdmissionWhConfig struct {
	Name  string                                            `json:"name"`
	Rules []admissionregistrationv1beta1.RuleWithOperations `json:",inline" protobuf:"bytes,2,opt,name=rule"`
}

AdmissionWhConfig - a struct for admission webhook registration data

type CloudCatalog

type CloudCatalog struct {
	Count     float64     `json:"count"`
	Next      string      `json:"next"`
	Resources []ResourceC `json:"resources"`
}

CloudCatalog represents the calalog listing as defined in ibmcloud catalog api

type Dependent

type Dependent struct {
	Kind string
	Name string
}

Dependent identifies a dependent resource in cluster

type EnglishC

type EnglishC struct {
	DisplayName string `json:"display_name"`
}

EnglishC represents the resource overview_ui.en as defined in ibmcloud catalog api

type ExclusivesConfig

type ExclusivesConfig struct {
	Kind       string     `json:"kind"`
	Group      string     `json:"group"`
	Version    string     `json:"version,omitempty"`
	Exclusives [][]string `json:"exclusives,omitempty"`
}

ExclusivesConfig - a struct for mutual exclusion rules

type ImmutablesConfig

type ImmutablesConfig struct {
	Kind       string   `json:"kind"`
	Immutables []string `json:"immutables,omitempty"`
}

ImmutablesConfig - a struct for immutable rules

type LabelsConfig

type LabelsConfig struct {
	Kind   string   `json:"kind"`
	Labels []string `json:"labels,omitempty"`
}

LabelsConfig - a struct for required labels per resource type

type MetadataC

type MetadataC struct {
	Service  ServiceC `json:"service"`
	Original string   `json:"original_name"`
}

MetadataC represents the resource metadata as defined in ibmcloud catalog api

type OverviewC

type OverviewC struct {
	Engish EnglishC `json:"en"`
}

OverviewC represents the resource overview_ui as defined in ibmcloud catalog api

type ResourceC

type ResourceC struct {
	Metadata MetadataC `json:"metadata"`
	Overview OverviewC `json:"overview_ui"`
	Kind     string    `json:"kind"`
	ID       string    `json:"id"`
	Name     string    `json:"name"`
}

ResourceC represents the resource as defined in ibmcloud catalog api

type RestResult

type RestResult struct {
	StatusCode int
	Body       string
	ErrorType  string
}

RestResult is a struct for REST call result

type ServiceC

type ServiceC struct {
	PlanUpdateable bool `json:"plan_updateable"`
}

ServiceC represents the service as defined in ibmcloud catalog api

type UpdateableService

type UpdateableService struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	ID          string `json:"id"`
}

UpdateableService represents a cloud service that can be upgraded dynamically

Jump to

Keyboard shortcuts

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