Documentation
¶
Overview ¶
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const (
MutateWebhookCfgName = "controller.devfile.io"
)
const (
ValidateWebhookCfgName = "controller.devfile.io"
)
Variables ¶
This section is empty.
Functions ¶
func BuildMutateWebhookCfg ¶
func BuildMutateWebhookCfg(namespace string) *admregv1.MutatingWebhookConfiguration
BuildMutateWebhookCfg creates the mutating webhook configuration for the controller
Types ¶
type ResourcesMutator ¶
type ResourcesMutator struct {
*handler.WebhookHandler
}
ResourcesMutator 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
func NewResourcesMutator ¶
func NewResourcesMutator(controllerUID, controllerSAName string) *ResourcesMutator
func (*ResourcesMutator) Handle ¶
ResourcesMutator verify if operation is a valid from Workspace controller perspective
func (*ResourcesMutator) InjectClient ¶
func (m *ResourcesMutator) InjectClient(c client.Client) error
InjectClient injects the client.
func (*ResourcesMutator) InjectDecoder ¶
func (m *ResourcesMutator) InjectDecoder(d *admission.Decoder) error
InjectDecoder injects the decoder.
type ResourcesValidator ¶
type ResourcesValidator struct {
*handler.WebhookHandler
}
ResourcesValidator 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
func NewResourcesValidator ¶
func NewResourcesValidator(controllerUID, controllerSAName string) *ResourcesValidator
func (*ResourcesValidator) InjectClient ¶
func (v *ResourcesValidator) InjectClient(c client.Client) error
InjectClient injects the client.
func (*ResourcesValidator) InjectDecoder ¶
func (v *ResourcesValidator) InjectDecoder(d *admission.Decoder) error
InjectDecoder injects the decoder.