{"modulePath":"github.com/devfile/devworkspace-operator","version":"v1.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package workspace\n\n## Constants\n\n```go\nconst (\n\tMutateWebhookCfgName = \"controller.devfile.io\"\n)\n```\n\n```go\nconst (\n\tValidateWebhookCfgName = \"controller.devfile.io\"\n)\n```\n\n## Functions\n\n```go\nfunc BuildMutateWebhookCfg(namespace string) *admregv1.MutatingWebhookConfiguration\n```\nBuildMutateWebhookCfg creates the mutating webhook configuration for the controller\n\n```go\nfunc Configure(ctx context.Context, mgr manager.Manager) error\n```\nConfigure configures mutate/validating webhooks that provides exec access into workspace for creator only\n\n## Types\n\n```go\ntype ResourcesMutator struct {\n\t*handler.WebhookHandler\n}\n```\nResourcesMutator checks that every: - workspace has creator label specified and it's not modified - workspace-related deployment, pod has unmodified workspace-id label and creator label\n\n```go\nfunc NewResourcesMutator(controllerUID, controllerSAName string, mgr manager.Manager) *ResourcesMutator\n```\n\n```go\nfunc (m *ResourcesMutator) Handle(ctx context.Context, req admission.Request) admission.Response\n```\nResourcesMutator verify if operation is a valid from Workspace controller perspective\n\n```go\ntype ResourcesValidator struct {\n\t*handler.WebhookHandler\n}\n```\nResourcesValidator validates execs process all exec requests and: if related pod DOES NOT have workspace\\_id label - just skip it if related pod DOES have workspace\\_id label - make sure that exec is requested by workspace creator\n\n```go\nfunc NewResourcesValidator(controllerUID, controllerSAName string, mgr manager.Manager) *ResourcesValidator\n```\n\n```go\nfunc (v *ResourcesValidator) Handle(ctx context.Context, req admission.Request) admission.Response\n```\n\n","path":"github.com/devfile/devworkspace-operator/webhook/workspace","name":"workspace","synopsis":"","isRedistributable":true}
