v1alpha1

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package v1alpha1 contains the API Schema definitions for Timoni API. +kubebuilder:object:generate=true

Index

Constants

View Source
const (
	EnabledValue  = "enabled"
	DisabledValue = "disabled"
)
View Source
const (
	IgnoreFile            = "timoni.ignore"
	DefaultIgnorePatterns = `# VCS
.git/
.gitignore
.gitmodules
.gitattributes

# Go
vendor/
go.mod
go.sum

# CUE
*_tool.cue

# Timoni
timoni.ignore
`
)
View Source
const (
	// UserAgent is the agent name used for OCI operations.
	UserAgent = "timoni/v1"

	// ConfigMediaType is the OCI media type for the config layer.
	ConfigMediaType = "application/vnd.timoni.config.v1+json"

	// ContentMediaType is the OCI media type for the content layer.
	ContentMediaType = "application/vnd.timoni.content.v1.tar+gzip"
)
View Source
const BundleSchema = `` /* 569-byte string literal not displayed */

BundleSchema defines the v1alpha1 CUE schema for Timoni's bundle API. TODO: switch to go:embed when this is available https://github.com/cue-lang/cue/issues/607

View Source
const InstanceSchema = `
#Timoni: {
	apiVersion: string & =~"^v1alpha1$"
	instance: {...}
	apply: [string]: [...]
}

timoni: #Timoni
`

InstanceSchema defines the v1alpha1 CUE schema for Timoni's instance API.

Variables

View Source
var (
	// PruneAction is the annotation that defines if a Kubernetes resource should be garbage collected.
	PruneAction = fmt.Sprintf("action.%s/prune", GroupVersion.Group)

	// ForceAction is the annotation that defines if a Kubernetes resource should be recreated.
	ForceAction = fmt.Sprintf("action.%s/force", GroupVersion.Group)

	// IfNotPresentAction is the annotation that defines if a Kubernetes resource
	// should be applied only if it doesn't exist on the cluster.
	IfNotPresentAction = fmt.Sprintf("action.%s/one-off", GroupVersion.Group)
)
View Source
var (
	// GroupVersion is the group version of Timoni's APIs.
	GroupVersion = schema.GroupVersion{Group: "timoni.sh", Version: "v1alpha1"}

	// InstanceKind is the kind name of the Instance type.
	InstanceKind = "Instance"

	// FieldManager is the name of the manager performing Kubernetes patch operations.
	FieldManager = "timoni"
)

Functions

This section is empty.

Types

type Instance

type Instance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Module is a reference to the module's artifact in the registry.
	Module ModuleReference `json:"module"`

	// Values is the module configuration.
	// +optional
	Values string `json:"values,omitempty"`

	// LastTransitionTime is the timestamp (UTC RFC3339) of the last inventory change.
	// +optional
	LastTransitionTime string `json:"lastTransitionTime,omitempty"`

	// Inventory contains the list of Kubernetes resource object references.
	// +optional
	Inventory *ResourceInventory `json:"inventory,omitempty"`
}

Instance holds the information about the module, values and the list of the managed Kubernetes resources.

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance.

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ModuleReference

type ModuleReference struct {
	// Name of the module.
	Name string `json:"name"`

	// Repository is the OCI artifact repo name in the format
	// 'oci://<reg.host>/<org>/<repo>'.
	Repository string `json:"repository"`

	// Version is the OCI artifact tag in strict semver format.
	Version string `json:"version"`

	// Digest of the OCI artifact in the format '<sha-type>:<hex>'.
	Digest string `json:"digest"`
}

ModuleReference contains the information necessary to locate a module's OCI artifact in the registry.

func (*ModuleReference) DeepCopy

func (in *ModuleReference) DeepCopy() *ModuleReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModuleReference.

func (*ModuleReference) DeepCopyInto

func (in *ModuleReference) DeepCopyInto(out *ModuleReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceInventory

type ResourceInventory struct {
	// Entries of Kubernetes resource object references.
	Entries []ResourceRef `json:"entries"`
}

ResourceInventory contains a list of Kubernetes resource object references managed by an Instance.

func (*ResourceInventory) DeepCopy

func (in *ResourceInventory) DeepCopy() *ResourceInventory

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceInventory.

func (*ResourceInventory) DeepCopyInto

func (in *ResourceInventory) DeepCopyInto(out *ResourceInventory)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceRef

type ResourceRef struct {
	// ID is the string representation of the Kubernetes resource object's metadata,
	// in the format '<namespace>_<name>_<group>_<kind>'.
	ID string `json:"id"`

	// Version is the API version of the Kubernetes resource object's kind.
	Version string `json:"v"`
}

ResourceRef contains the information necessary to locate a Kubernetes resource object within a cluster.

func (*ResourceRef) DeepCopy

func (in *ResourceRef) DeepCopy() *ResourceRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRef.

func (*ResourceRef) DeepCopyInto

func (in *ResourceRef) DeepCopyInto(out *ResourceRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Selector added in v0.0.6

type Selector string

Selector is an enumeration of the supported CUE paths known to Timoni.

const (
	// BundleAPIVersionSelector is the CUE path for the Timoni's bundle API version.
	BundleAPIVersionSelector Selector = "bundle.apiVersion"

	// BundleName is the CUE path for the Timoni's bundle name.
	BundleName Selector = "bundle.name"

	// BundleInstancesSelector is the CUE path for the Timoni's bundle instances.
	BundleInstancesSelector Selector = "bundle.instances"

	// BundleModuleURLSelector is the CUE path for the Timoni's bundle module url.
	BundleModuleURLSelector Selector = "module.url"

	// BundleModuleVersionSelector is the CUE path for the Timoni's bundle module version.
	BundleModuleVersionSelector Selector = "module.version"

	// BundleModuleDigestSelector is the CUE path for the Timoni's bundle module digest.
	BundleModuleDigestSelector Selector = "module.digest"

	// BundleNamespaceSelector is the CUE path for the Timoni's bundle instance namespace.
	BundleNamespaceSelector Selector = "namespace"

	// BundleValuesSelector is the CUE path for the Timoni's bundle instance values.
	BundleValuesSelector Selector = "values"

	// BundleNameLabelKey is the Kubernetes label key for tracking Timoni's bundle by name.
	BundleNameLabelKey = "bundle.timoni.sh/name"
)
const (
	// APIVersionSelector is the CUE path for the Timoni's API version.
	APIVersionSelector Selector = "timoni.apiVersion"

	// ApplySelector is the CUE path for the Timoni's apply resource sets.
	ApplySelector Selector = "timoni.apply"

	// ValuesSelector is the CUE path for the Timoni's module values.
	ValuesSelector Selector = "values"
)

func (Selector) String added in v0.0.6

func (s Selector) String() string

String returns the string representation of the Selector.

Jump to

Keyboard shortcuts

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