v1alpha1

package
v0.0.0-...-5cbd3cb Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 34

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=config.porch.kpt.dev

Index

Constants

View Source
const (
	// Type of the Repository condition.
	RepositoryReady = "Ready"

	// Reason for the condition is error.
	ReasonError = "Error"
	// Reason for the condition is the repository is ready.
	ReasonReady = "Ready"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "config.porch.kpt.dev", Version: "v1alpha1"}

	TypeRepository = TypeInfo{
		Kind:     "Repository",
		Resource: GroupVersion.WithResource("repositories"),
		// contains filtered or unexported fields
	}

	TypeFunction = TypeInfo{
		Kind:     "Function",
		Resource: GroupVersion.WithResource("functions"),
		// contains filtered or unexported fields
	}

	AllKinds = []TypeInfo{TypeRepository, TypeFunction}
)

Functions

func AddToScheme

func AddToScheme(scheme *runtime.Scheme) error

Types

type Function

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

	Spec   FunctionSpec   `json:"spec,omitempty"`
	Status FunctionStatus `json:"status,omitempty"`
}

Function represents a kpt function discovered in a repository Function resources are created automatically by discovery in a registered Repository. Function resource names will be computed as <Repository Name>:<Function Name> to ensure uniqueness of names, and will follow formatting of [DNS Subdomain Names](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names).

func (*Function) DeepCopy

func (in *Function) DeepCopy() *Function

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

func (*Function) DeepCopyInto

func (in *Function) DeepCopyInto(out *Function)

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

func (*Function) DeepCopyObject

func (in *Function) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FunctionConfig

type FunctionConfig struct {
	metav1.TypeMeta `json:",inline"`
	// Experimental: requiredFields tells necessary fields and is aimed to help users write the FunctionConfig.
	// Otherwise, users can get the required fields info from the function evaluation error message.
	RequiredFields []string `json:"requiredFields,omitempty"`
}

FunctionConfig specifies all the valid types of the function config for this function. If unspecified, defaults to v1/ConfigMap. For example, function `set-namespace` accepts both `ConfigMap` and `SetNamespace`

func (*FunctionConfig) DeepCopy

func (in *FunctionConfig) DeepCopy() *FunctionConfig

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

func (*FunctionConfig) DeepCopyInto

func (in *FunctionConfig) DeepCopyInto(out *FunctionConfig)

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

type FunctionEval

type FunctionEval struct {
	// `Image` specifies the function image, such as `gcr.io/kpt-fn/gatekeeper:v0.2`. Use of `Image` is mutually exclusive with `FunctionRef`.
	Image string `json:"image,omitempty"`
	// `FunctionRef` specifies the function by reference to a Function resource. Mutually exclusive with `Image`.
	FunctionRef *FunctionRef `json:"functionRef,omitempty"`
	// `ConfigMap` specifies the function config (https://kpt.dev/reference/cli/fn/eval/).
	ConfigMap map[string]string `json:"configMap,omitempty"`
}

func (*FunctionEval) DeepCopy

func (in *FunctionEval) DeepCopy() *FunctionEval

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

func (*FunctionEval) DeepCopyInto

func (in *FunctionEval) DeepCopyInto(out *FunctionEval)

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

type FunctionList

type FunctionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Function `json:"items"`
}

FunctionList

func (*FunctionList) DeepCopy

func (in *FunctionList) DeepCopy() *FunctionList

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

func (*FunctionList) DeepCopyInto

func (in *FunctionList) DeepCopyInto(out *FunctionList)

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

func (*FunctionList) DeepCopyObject

func (in *FunctionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FunctionRef

type FunctionRef struct {
	// `Name` is the name of the `Function` resource referenced. The resource is expected to be within the same namespace.
	Name string `json:"name"`
}

`FunctionRef` is a reference to a `Function` resource.

func (*FunctionRef) DeepCopy

func (in *FunctionRef) DeepCopy() *FunctionRef

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

func (*FunctionRef) DeepCopyInto

func (in *FunctionRef) DeepCopyInto(out *FunctionRef)

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

type FunctionSpec

type FunctionSpec struct {
	// Image specifies the function image, such as 'gcr.io/kpt-fn/gatekeeper:v0.2'.
	Image string `json:"image"`

	// RepositoryRef references the repository in which the function is located.
	RepositoryRef RepositoryRef `json:"repositoryRef"`

	// FunctionType specifies the function types (mutator, validator or/and others).
	FunctionTypes []FunctionType `json:"functionTypes,omitempty"`

	FunctionConfigs []FunctionConfig `json:"functionConfigs,omitempty"`

	// Keywords are used as filters to provide correlation in function discovery.
	Keywords []string `json:"keywords,omitempty"`

	// Description is a short description of the function.
	Description string `json:"description"`

	// `DocumentationUrl specifies the URL of comprehensive function documentation`
	DocumentationUrl string `json:"documentationUrl,omitempty"`
}

FunctionSpec defines the desired state of a Function

func (*FunctionSpec) DeepCopy

func (in *FunctionSpec) DeepCopy() *FunctionSpec

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

func (*FunctionSpec) DeepCopyInto

func (in *FunctionSpec) DeepCopyInto(out *FunctionSpec)

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

type FunctionStatus

type FunctionStatus struct {
}

FunctionStatus defines the observed state of Function

func (*FunctionStatus) DeepCopy

func (in *FunctionStatus) DeepCopy() *FunctionStatus

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

func (*FunctionStatus) DeepCopyInto

func (in *FunctionStatus) DeepCopyInto(out *FunctionStatus)

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

type FunctionType

type FunctionType string
const (
	FunctionTypeValidator FunctionType = "validator"
	FunctionTypeMutator   FunctionType = "mutator"
)

type GitRepository

type GitRepository struct {
	// Address of the Git repository, for example:
	//   `https://github.com/GoogleCloudPlatform/blueprints.git`
	Repo string `json:"repo"`
	// Name of the branch containing the packages. Finalized packages will be committed to this branch (if the repository allows write access). If unspecified, defaults to "main".
	Branch string `json:"branch,omitempty"`
	// CreateBranch specifies if Porch should create the package branch if it doesn't exist.
	CreateBranch bool `json:"createBranch,omitempty"`
	// Directory within the Git repository where the packages are stored. A subdirectory of this directory containing a Kptfile is considered a package. If unspecified, defaults to root directory.
	Directory string `json:"directory,omitempty"`
	// Reference to secret containing authentication credentials.
	SecretRef SecretRef `json:"secretRef,omitempty"`
}

GitRepository describes a Git repository. TODO: authentication methods

func (*GitRepository) DeepCopy

func (in *GitRepository) DeepCopy() *GitRepository

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

func (*GitRepository) DeepCopyInto

func (in *GitRepository) DeepCopyInto(out *GitRepository)

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

type OciRepository

type OciRepository struct {
	// Registry is the address of the OCI registry
	Registry string `json:"registry"`
	// Reference to secret containing authentication credentials.
	SecretRef SecretRef `json:"secretRef,omitempty"`
}

OciRepository describes a repository compatible with the Open Container Registry standard. TODO: allow sub-selection of the registry, i.e. filter by tags, ...? TODO: authentication types?

func (*OciRepository) DeepCopy

func (in *OciRepository) DeepCopy() *OciRepository

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

func (*OciRepository) DeepCopyInto

func (in *OciRepository) DeepCopyInto(out *OciRepository)

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

type Repository

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

	Spec   RepositorySpec   `json:"spec,omitempty"`
	Status RepositoryStatus `json:"status,omitempty"`
}

Repository

func (*Repository) DeepCopy

func (in *Repository) DeepCopy() *Repository

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

func (*Repository) DeepCopyInto

func (in *Repository) DeepCopyInto(out *Repository)

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

func (*Repository) DeepCopyObject

func (in *Repository) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RepositoryContent

type RepositoryContent string
const (
	RepositoryContentFunction RepositoryContent = "Function"
	RepositoryContentPackage  RepositoryContent = "Package"
)

type RepositoryList

type RepositoryList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Repository `json:"items"`
}

RepositoryList contains a list of Repo

func (*RepositoryList) DeepCopy

func (in *RepositoryList) DeepCopy() *RepositoryList

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

func (*RepositoryList) DeepCopyInto

func (in *RepositoryList) DeepCopyInto(out *RepositoryList)

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

func (*RepositoryList) DeepCopyObject

func (in *RepositoryList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RepositoryRef

type RepositoryRef struct {
	// Name of the Repository resource referenced.
	Name string `json:"name"`
}

RepositoryRef identifies a reference to a Repository resource.

func (*RepositoryRef) DeepCopy

func (in *RepositoryRef) DeepCopy() *RepositoryRef

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

func (*RepositoryRef) DeepCopyInto

func (in *RepositoryRef) DeepCopyInto(out *RepositoryRef)

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

type RepositorySpec

type RepositorySpec struct {
	// User-friendly description of the repository
	Description string `json:"description,omitempty"`
	// The repository is a deployment repository; final packages in this repository are deployment ready.
	Deployment bool `json:"deployment,omitempty"`
	// Type of the repository (i.e. git, OCI)
	Type RepositoryType `json:"type,omitempty"`
	// Content stored in the repository (i.e. Function, Package - the literal values correspond to the API resource names).
	// TODO: support repository with mixed content?
	Content RepositoryContent `json:"content,omitempty"`
	// Git repository details. Required if `type` is `git`. Ignored if `type` is not `git`.
	Git *GitRepository `json:"git,omitempty"`
	// OCI repository details. Required if `type` is `oci`. Ignored if `type` is not `oci`.
	Oci *OciRepository `json:"oci,omitempty"`
	// Upstream is the default upstream repository for packages in this
	// repository. Specifying it per repository allows simpler UX when
	// creating packages.
	Upstream *UpstreamRepository `json:"upstream,omitempty"`

	// `Mutators` specifies list of functions to be added to the list of package's mutators on changes to the packages in the repository to ensure the packages meet constraints
	// enforced by the mutators associated with the repository.
	// Based on the Kubernetest Admission Controllers (https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). The functions will be evaluated
	// in the order specified in the list.
	Mutators []FunctionEval `json:"mutators,omitempty"`

	// `Validators` specifies list of functions to be added to the list of package's validators on changes to the packages in the repository to ensure the packages meet constraints
	// enforced by the validators associated with the repository.
	// Based on the Kubernetest Admission Controllers (https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). The functions will be evaluated
	// in the order specified in the list.
	Validators []FunctionEval `json:"validators,omitempty"`
}

RepositorySpec defines the desired state of Repository

Notes:

  • deployment repository - in KRM API ConfigSync would be configured directly? (or via this API)

func (*RepositorySpec) DeepCopy

func (in *RepositorySpec) DeepCopy() *RepositorySpec

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

func (*RepositorySpec) DeepCopyInto

func (in *RepositorySpec) DeepCopyInto(out *RepositorySpec)

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

type RepositoryStatus

type RepositoryStatus struct {
	// Conditions describes the reconciliation state of the object.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

RepositoryStatus defines the observed state of Repository

func (*RepositoryStatus) DeepCopy

func (in *RepositoryStatus) DeepCopy() *RepositoryStatus

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

func (*RepositoryStatus) DeepCopyInto

func (in *RepositoryStatus) DeepCopyInto(out *RepositoryStatus)

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

type RepositoryType

type RepositoryType string
const (
	RepositoryTypeGit RepositoryType = "git"
	RepositoryTypeOCI RepositoryType = "oci"
)

type SecretRef

type SecretRef struct {
	// Name of the secret. The secret is expected to be located in the same namespace as the resource containing the reference.
	Name string `json:"name"`
}

func (*SecretRef) DeepCopy

func (in *SecretRef) DeepCopy() *SecretRef

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

func (*SecretRef) DeepCopyInto

func (in *SecretRef) DeepCopyInto(out *SecretRef)

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

type TypeInfo

type TypeInfo struct {
	Kind     string
	Resource schema.GroupVersionResource
	// contains filtered or unexported fields
}

TypeInfo holds type meta-information

func (*TypeInfo) APIVersion

func (t *TypeInfo) APIVersion() string

APIVersion returns the apiVersion for the type

func (*TypeInfo) GVK

func (t *TypeInfo) GVK() schema.GroupVersionKind

GVK returns the schema.GroupVersionKind for the type

func (*TypeInfo) GroupResource

func (t *TypeInfo) GroupResource() schema.GroupResource

GroupResource returns the GroupResource for the kind

type UpstreamRepository

type UpstreamRepository struct {
	// Type of the repository (i.e. git, OCI). If empty, repositoryRef will be used.
	Type RepositoryType `json:"type,omitempty"`
	// Git repository details. Required if `type` is `git`. Must be unspecified if `type` is not `git`.
	Git *GitRepository `json:"git,omitempty"`
	// OCI repository details. Required if `type` is `oci`. Must be unspecified if `type` is not `oci`.
	Oci *OciRepository `json:"oci,omitempty"`
	// RepositoryRef contains a reference to an existing Repository resource to be used as the default upstream repository.
	RepositoryRef *RepositoryRef `json:"repositoryRef,omitempty"`
}

UpstreamRepository repository may be specified directly or by referencing another Repository resource.

func (*UpstreamRepository) DeepCopy

func (in *UpstreamRepository) DeepCopy() *UpstreamRepository

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

func (*UpstreamRepository) DeepCopyInto

func (in *UpstreamRepository) DeepCopyInto(out *UpstreamRepository)

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

Jump to

Keyboard shortcuts

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