utils

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationClusterLabel   = "app.fybrik.io/app-cluster"
	ApplicationNamespaceLabel = "app.fybrik.io/app-namespace"
	ApplicationNameLabel      = "app.fybrik.io/app-name"
	BlueprintNamespaceLabel   = "app.fybrik.io/blueprint-namespace"
	BlueprintNameLabel        = "app.fybrik.io/blueprint-name"
	FybrikAppUUID             = "app.fybrik.io/app-uuid"
)

Variables

This section is empty.

Functions

func CreateStepName

func CreateStepName(moduleName, assetID string) string

Create a name for a step in a blueprint. Since this is part of the name of a release, this should be done in a central location to make testing easier

func CreateUnstructured

func CreateUnstructured(group, version, kind, name, namespace string) *unstructured.Unstructured

CreateUnstructured creates a new Unstructured runtime object

func GetApplicationClusterFromLabels added in v1.0.1

func GetApplicationClusterFromLabels(labels map[string]string) string

func GetApplicationNameFromLabels added in v1.0.1

func GetApplicationNameFromLabels(labels map[string]string) string

func GetApplicationNamespaceFromLabels added in v1.0.1

func GetApplicationNamespaceFromLabels(labels map[string]string) string

func GetBlueprintNameFromLabels added in v1.0.1

func GetBlueprintNameFromLabels(labels map[string]string) string

func GetBlueprintNamespaceFromLabels added in v1.0.1

func GetBlueprintNamespaceFromLabels(labels map[string]string) string

func GetFybrikApplicationUUID added in v0.6.0

func GetFybrikApplicationUUID(fapp *api.FybrikApplication) string

GetFybrikApplicationUUID returns a globally unique ID for the FybrikApplication instance. It must be unique over time and across clusters, even after the instance has been deleted, because this ID will be used for logging purposes.

func GetFybrikApplicationUUIDfromAnnotations added in v0.6.0

func GetFybrikApplicationUUIDfromAnnotations(annotations map[string]string) string

GetFybrikApplicationUUIDfromAnnotations returns the UUID passed to the resource in its annotations

func GetReleaseName

func GetReleaseName(applicationName, uuid, instanceName string) string

Generating a release name based on the blueprint module and application name/uuid

func IsDenied

func IsDenied(actionName taxonomy.ActionName) bool

IsDenied returns true if the data access is denied

func NewScheme

func NewScheme(g *gomega.WithT) *runtime.Scheme

Creates a scheme that can be used in unit tests The scheme will have the core and batch apis from K8s registered as well as the app api from Fybrik. This function can be tested with a gomega environment if passed or otherwise (if nil is passed) it will ignore tests.

func UpdateStatus added in v0.6.5

func UpdateStatus(ctx context.Context, cl client.Client, obj client.Object, previousStatus interface{}) error

UpdateStatus updates the resource status

Types

type UnstructuredAsLabels

type UnstructuredAsLabels struct {
	Data *unstructured.Unstructured
}

UnstructuredAsLabels is an implementation of labels.Labels interface which allows us to take advantage of k8s labels library for the purposes of evaluating fail and success conditions

func (UnstructuredAsLabels) Get

func (c UnstructuredAsLabels) Get(label string) string

Get returns the value for the provided label.

func (UnstructuredAsLabels) Has

func (c UnstructuredAsLabels) Has(label string) bool

Has returns whether the provided label exists.

Jump to

Keyboard shortcuts

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