conversion

package
v0.1.86 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAnnotation = errors.New("a required annotation was missing")
)

Functions

func ConvertStatusCondition

func ConvertStatusCondition(in *unikornv1.Condition) openapi.ResourceProvisioningStatus

ConvertStatusCondition translates from Kubernetes status conditions to API ones.

func ConvertTag added in v0.1.84

func ConvertTag(in unikornv1.Tag) openapi.Tag

func ConvertTags added in v0.1.84

func ConvertTags(in unikornv1.TagList) openapi.TagList

func GenerateTag added in v0.1.84

func GenerateTag(in openapi.Tag) unikornv1.Tag

func GenerateTagList added in v0.1.84

func GenerateTagList(in *openapi.TagList) unikornv1.TagList

func OrganizationScopedResourceReadMetadata

func OrganizationScopedResourceReadMetadata(in metav1.Object, tags unikornv1.TagList, status openapi.ResourceProvisioningStatus) openapi.OrganizationScopedResourceReadMetadata

OrganizationScopedResourceReadMetadata extracts organization scoped metdata from a resource for GET APIS.

func ProjectScopedResourceReadMetadata

ProjectScopedResourceReadMetadata extracts project scoped metdata from a resource for GET APIs.

func ResourceReadMetadata

ResourceReadMetadata extracts generic metadata from a resource for GET APIs.

func UpdateObjectMetadata

func UpdateObjectMetadata(required, current metav1.Object, requiredAnnotations, optionalAnnotations []string) error

UpdateObjectMetadata abstracts away metadata updates.

Types

type ObjectMetadata

type ObjectMetadata metav1.ObjectMeta

ObjectMetadata implements a builder pattern.

func NewObjectMetadata

func NewObjectMetadata(metadata *openapi.ResourceWriteMetadata, namespace, actor string) *ObjectMetadata

NewObjectMetadata requests the bare minimum to build an object metadata object.

func (*ObjectMetadata) Get

func (o *ObjectMetadata) Get() metav1.ObjectMeta

Get renders the object metadata ready for inclusion into a Kubernetes resource.

func (*ObjectMetadata) WithLabel

func (o *ObjectMetadata) WithLabel(key, value string) *ObjectMetadata

WithLabel allows non-generic labels to be attached to a resource.

func (*ObjectMetadata) WithOrganization

func (o *ObjectMetadata) WithOrganization(id string) *ObjectMetadata

WithOrganization adds an organization for scoped resources.

func (*ObjectMetadata) WithProject

func (o *ObjectMetadata) WithProject(id string) *ObjectMetadata

WithProject adds a project for scoped resources.

Jump to

Keyboard shortcuts

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