engines

package
v0.0.0-...-56f2d6c Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

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.

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helm2EngineRunner

type Helm2EngineRunner struct {
	Log logr.Logger
}

func NewHelm2EngineRunner

func NewHelm2EngineRunner(log logr.Logger) *Helm2EngineRunner

func (*Helm2EngineRunner) CreateConfig

When a behavior executes, the resource engine is configured by the object which triggered the behavior. This method encapsulates the logic to create the resource engine configuration from the object's fields. TODO it seems as though a lot of the transformation logic is probably reusable

func (*Helm2EngineRunner) RunEngine

TODO we could potentially have a method create the job, and a higher-level one execute it.

type ResourceEngineRunner

type ResourceEngineRunner interface {
	CreateConfig(claim *unstructured.Unstructured, hc *v1alpha1.HookConfiguration) (*corev1.ConfigMap, error)

	RunEngine(
		ctx context.Context,
		client client.Client,
		claim *unstructured.Unstructured,
		config *corev1.ConfigMap,
		stackSource string,
		hc *v1alpha1.HookConfiguration,
	) (*unstructured.Unstructured, error)
}

A ResourceEngineRunner is responsible for creating resources for a template stack when a hook is executed.

The inputs are: - A hook configuration - The object which triggered this hook - The source files to create resources from

The outputs should be: - Created resources

This interface is still fairly new; in the future we'll want to be able to represent the status of the resources which are being created. For example, if the resources are created asynchronously (say by running a Job), the output the first time the engine is run may be the status of the Job. The next time, if the job is finished, it may be some sort of reference to the objects which have been created.

Jump to

Keyboard shortcuts

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