v1alpha1

package
v0.0.0-...-da4181b Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the gitopssets v1alpha1 API group +groupName=sets.gitops.pro

Package v1alpha1 contains API Schema definitions for the templates v1alpha1 API group +kubebuilder:object:generate=true +groupName=sets.gitops.pro

Index

Constants

View Source
const (
	// ReconciliationFailedReason represents the fact that
	// the reconciliation failed.
	ReconciliationFailedReason string = "ReconciliationFailed"

	// ReconciliationSucceededReason represents the fact that
	// the reconciliation succeeded.
	ReconciliationSucceededReason string = "ReconciliationSucceeded"
)
View Source
const GitOpsSetFinalizer = "finalizers.sets.gitops.pro"

GitOpsSetFinalizer is the finalizer added to GitOpsSets to allow us to clean up resources.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "sets.gitops.pro", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetGitOpsSetReadiness

func GetGitOpsSetReadiness(set *GitOpsSet) metav1.ConditionStatus

GetGitOpsSetReadiness returns the readiness condition of the GitOpsSet.

func SetGitOpsSetReadiness

func SetGitOpsSetReadiness(set *GitOpsSet, inventory *ResourceInventory, status metav1.ConditionStatus, reason, message string)

SetGitOpsSetReadiness sets the ready condition with the given status, reason and message.

Types

type APIClientGenerator

type APIClientGenerator struct {
	// The interval at which to poll the API endpoint.
	// +required
	Interval metav1.Duration `json:"interval"`

	// This is the API endpoint to use.
	// +kubebuilder:validation:Pattern="^(http|https)://"
	// +optional
	Endpoint string `json:"endpoint,omitempty"`

	// Method defines the HTTP method to use to talk to the endpoint.
	// +kubebuilder:default="GET"
	// +kubebuilder:validation:Enum=GET;POST
	Method string `json:"method,omitempty"`

	// JSONPath is string that is used to modify the result of the API
	// call.
	//
	// This can be used to extract a repeating element from a response.
	// https://kubernetes.io/docs/reference/kubectl/jsonpath/
	JSONPath string `json:"jsonPath,omitempty"`

	// HeadersRef allows optional configuration of a Secret or ConfigMap to add
	// additional headers to an outgoing request.
	//
	// For example, a Secret with a key Authorization: Bearer abc123 could be
	// used to configure an authorization header.
	//
	// +optional
	HeadersRef *HeadersReference `json:"headersRef,omitempty"`

	// Body is set as the body in a POST request.
	//
	// If set, this will configure the Method to be POST automatically.
	// +optional
	Body *apiextensionsv1.JSON `json:"body,omitempty"`

	// SingleElement means generate a single element with the result of the API
	// call.
	//
	// When true, the response must be a JSON object and will be returned as a
	// single element, i.e. only one element will be generated containing the
	// entire object.
	//
	// +optional
	SingleElement bool `json:"singleElement,omitempty"`

	// Reference to Secret in same namespace with a field "caFile" which
	// provides the Certificate Authority to trust when making API calls.
	SecretRef *LocalObjectReference `json:"secretRef,omitempty"`
}

APIClientGenerator defines a generator that queries an API endpoint and uses that to generate data.

func (*APIClientGenerator) DeepCopy

func (in *APIClientGenerator) DeepCopy() *APIClientGenerator

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

func (*APIClientGenerator) DeepCopyInto

func (in *APIClientGenerator) DeepCopyInto(out *APIClientGenerator)

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

type ClusterGenerator

type ClusterGenerator struct {
	// Selector is used to filter the clusters that you want to target.
	//
	// If no selector is provided, no clusters will be matched.
	// +optional
	Selector metav1.LabelSelector `json:"selector,omitempty"`
}

ClusterGenerator defines a generator that queries the cluster API for relevant clusters.

func (*ClusterGenerator) DeepCopy

func (in *ClusterGenerator) DeepCopy() *ClusterGenerator

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

func (*ClusterGenerator) DeepCopyInto

func (in *ClusterGenerator) DeepCopyInto(out *ClusterGenerator)

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

type ConfigGenerator

type ConfigGenerator struct {
	// Kind of the referent.
	// +kubebuilder:validation:Enum=ConfigMap;Secret
	// +required
	Kind string `json:"kind"`

	// Name of the referent.
	// +required
	Name string `json:"name"`
}

ConfigGenerator loads a referenced ConfigMap or Secret from the Cluster and makes it available as a resource.

func (*ConfigGenerator) DeepCopy

func (in *ConfigGenerator) DeepCopy() *ConfigGenerator

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

func (*ConfigGenerator) DeepCopyInto

func (in *ConfigGenerator) DeepCopyInto(out *ConfigGenerator)

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

type GitOpsSet

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

	Spec   GitOpsSetSpec   `json:"spec,omitempty"`
	Status GitOpsSetStatus `json:"status,omitempty"`
}

GitOpsSet is the Schema for the gitopssets API

func (*GitOpsSet) DeepCopy

func (in *GitOpsSet) DeepCopy() *GitOpsSet

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

func (*GitOpsSet) DeepCopyInto

func (in *GitOpsSet) DeepCopyInto(out *GitOpsSet)

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

func (*GitOpsSet) DeepCopyObject

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

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

func (GitOpsSet) GetConditions

func (in GitOpsSet) GetConditions() []metav1.Condition

GetConditions returns the status conditions of the object.

func (*GitOpsSet) SetConditions

func (in *GitOpsSet) SetConditions(conditions []metav1.Condition)

SetConditions sets the status conditions on the object.

type GitOpsSetGenerator

type GitOpsSetGenerator struct {
	List          *ListGenerator          `json:"list,omitempty"`
	PullRequests  *PullRequestGenerator   `json:"pullRequests,omitempty"`
	GitRepository *GitRepositoryGenerator `json:"gitRepository,omitempty"`
	OCIRepository *OCIRepositoryGenerator `json:"ociRepository,omitempty"`
	Matrix        *MatrixGenerator        `json:"matrix,omitempty"`
	Cluster       *ClusterGenerator       `json:"cluster,omitempty"`
	APIClient     *APIClientGenerator     `json:"apiClient,omitempty"`
	ImagePolicy   *ImagePolicyGenerator   `json:"imagePolicy,omitempty"`
	Config        *ConfigGenerator        `json:"config,omitempty"`
}

GitOpsSetGenerator is the top-level set of generators for this GitOpsSet.

func (*GitOpsSetGenerator) DeepCopy

func (in *GitOpsSetGenerator) DeepCopy() *GitOpsSetGenerator

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

func (*GitOpsSetGenerator) DeepCopyInto

func (in *GitOpsSetGenerator) DeepCopyInto(out *GitOpsSetGenerator)

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

type GitOpsSetList

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

GitOpsSetList contains a list of GitOpsSet

func (*GitOpsSetList) DeepCopy

func (in *GitOpsSetList) DeepCopy() *GitOpsSetList

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

func (*GitOpsSetList) DeepCopyInto

func (in *GitOpsSetList) DeepCopyInto(out *GitOpsSetList)

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

func (*GitOpsSetList) DeepCopyObject

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

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

type GitOpsSetNestedGenerator

type GitOpsSetNestedGenerator struct {
	// Name is an optional field that will be used to prefix the values generated
	// by the nested generators, this allows multiple generators of the same
	// type in a single Matrix generator.
	// +optional
	Name string `json:"name,omitempty"`

	List          *ListGenerator          `json:"list,omitempty"`
	GitRepository *GitRepositoryGenerator `json:"gitRepository,omitempty"`
	OCIRepository *OCIRepositoryGenerator `json:"ociRepository,omitempty"`
	PullRequests  *PullRequestGenerator   `json:"pullRequests,omitempty"`
	Cluster       *ClusterGenerator       `json:"cluster,omitempty"`
	APIClient     *APIClientGenerator     `json:"apiClient,omitempty"`
	ImagePolicy   *ImagePolicyGenerator   `json:"imagePolicy,omitempty"`
	Config        *ConfigGenerator        `json:"config,omitempty"`
}

GitOpsSetNestedGenerator describes the generators usable by the MatrixGenerator. This is a subset of the generators allowed by the GitOpsSetGenerator because the CRD format doesn't support recursive declarations.

func (*GitOpsSetNestedGenerator) DeepCopy

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

func (*GitOpsSetNestedGenerator) DeepCopyInto

func (in *GitOpsSetNestedGenerator) DeepCopyInto(out *GitOpsSetNestedGenerator)

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

type GitOpsSetSpec

type GitOpsSetSpec struct {
	// Suspend tells the controller to suspend the reconciliation of this
	// GitOpsSet.
	// +optional
	Suspend bool `json:"suspend,omitempty"`

	// Generators generate the data to be inserted into the provided templates.
	Generators []GitOpsSetGenerator `json:"generators,omitempty"`

	// Templates are a set of YAML templates that are rendered into resources
	// from the data supplied by the generators.
	Templates []GitOpsSetTemplate `json:"templates,omitempty"`

	// The name of the Kubernetes service account to impersonate
	// when reconciling this Kustomization.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
}

GitOpsSetSpec defines the desired state of GitOpsSet

func (*GitOpsSetSpec) DeepCopy

func (in *GitOpsSetSpec) DeepCopy() *GitOpsSetSpec

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

func (*GitOpsSetSpec) DeepCopyInto

func (in *GitOpsSetSpec) DeepCopyInto(out *GitOpsSetSpec)

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

type GitOpsSetStatus

type GitOpsSetStatus struct {
	meta.ReconcileRequestStatus `json:",inline"`

	// ObservedGeneration is the last observed generation of the HelmRepository
	// object.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions holds the conditions for the GitOpsSet
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Inventory contains the list of Kubernetes resource object references that
	// have been successfully applied
	// +optional
	Inventory *ResourceInventory `json:"inventory,omitempty"`
}

GitOpsSetStatus defines the observed state of GitOpsSet

func (*GitOpsSetStatus) DeepCopy

func (in *GitOpsSetStatus) DeepCopy() *GitOpsSetStatus

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

func (*GitOpsSetStatus) DeepCopyInto

func (in *GitOpsSetStatus) DeepCopyInto(out *GitOpsSetStatus)

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

type GitOpsSetTemplate

type GitOpsSetTemplate struct {
	// Repeat is a JSONPath string defining that the template content should be
	// repeated for each of the matching elements in the JSONPath expression.
	// https://kubernetes.io/docs/reference/kubectl/jsonpath/
	Repeat string `json:"repeat,omitempty"`
	// Content is the YAML to be templated and generated.
	Content runtime.RawExtension `json:"content"`
}

GitOpsSetTemplate describes a resource to create

func (*GitOpsSetTemplate) DeepCopy

func (in *GitOpsSetTemplate) DeepCopy() *GitOpsSetTemplate

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

func (*GitOpsSetTemplate) DeepCopyInto

func (in *GitOpsSetTemplate) DeepCopyInto(out *GitOpsSetTemplate)

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

type GitRepositoryGenerator

type GitRepositoryGenerator struct {
	// RepositoryRef is the name of a GitRepository resource to be generated from.
	RepositoryRef string `json:"repositoryRef,omitempty"`

	// Files is a set of rules for identifying files to be parsed.
	Files []RepositoryGeneratorFileItem `json:"files,omitempty"`

	// Directories is a set of rules for identifying directories to be
	// generated.
	Directories []RepositoryGeneratorDirectoryItem `json:"directories,omitempty"`
}

GitRepositoryGenerator generates from files in a Flux GitRepository resource.

func (*GitRepositoryGenerator) DeepCopy

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

func (*GitRepositoryGenerator) DeepCopyInto

func (in *GitRepositoryGenerator) DeepCopyInto(out *GitRepositoryGenerator)

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

type HeadersReference

type HeadersReference struct {
	// The resource kind to get headers from.
	// +kubebuilder:validation:Enum=Secret;ConfigMap
	Kind string `json:"kind"`
	// Name of the resource in the same namespace to apply headers from.
	Name string `json:"name"`
}

HeadersReference references either a Secret or ConfigMap to be used for additional request headers.

func (*HeadersReference) DeepCopy

func (in *HeadersReference) DeepCopy() *HeadersReference

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

func (*HeadersReference) DeepCopyInto

func (in *HeadersReference) DeepCopyInto(out *HeadersReference)

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

type ImagePolicyGenerator

type ImagePolicyGenerator struct {
	// PolicyRef is the name of a ImagePolicy resource to be generated from.
	PolicyRef string `json:"policyRef,omitempty"`
}

ImagePolicyGenerator generates from the ImagePolicy.

func (*ImagePolicyGenerator) DeepCopy

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

func (*ImagePolicyGenerator) DeepCopyInto

func (in *ImagePolicyGenerator) DeepCopyInto(out *ImagePolicyGenerator)

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

type ListGenerator

type ListGenerator struct {
	Elements []apiextensionsv1.JSON `json:"elements,omitempty"`
}

ListGenerator generates from a hard-coded list.

func (*ListGenerator) DeepCopy

func (in *ListGenerator) DeepCopy() *ListGenerator

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

func (*ListGenerator) DeepCopyInto

func (in *ListGenerator) DeepCopyInto(out *ListGenerator)

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

type LocalObjectReference

type LocalObjectReference struct {
	// Name of the referent.
	// +required
	Name string `json:"name"`
}

LocalObjectReference contains enough information to locate the referenced Kubernetes resource object.

func (*LocalObjectReference) DeepCopy

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

func (*LocalObjectReference) DeepCopyInto

func (in *LocalObjectReference) DeepCopyInto(out *LocalObjectReference)

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

type MatrixGenerator

type MatrixGenerator struct {
	// Generators is a list of generators to be combined.
	Generators []GitOpsSetNestedGenerator `json:"generators,omitempty"`

	// SingleElement means generate a single element with the result of the
	// merged generator elements.
	//
	// When true, the matrix elements will be merged to a single element, with
	// whatever prefixes they have.
	// It's recommended that you use the Name field to separate out elements.
	//
	// +optional
	SingleElement bool `json:"singleElement,omitempty"`
}

MatrixGenerator defines a matrix that combines generators. The matrix is a cartesian product of the generators.

func (*MatrixGenerator) DeepCopy

func (in *MatrixGenerator) DeepCopy() *MatrixGenerator

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

func (*MatrixGenerator) DeepCopyInto

func (in *MatrixGenerator) DeepCopyInto(out *MatrixGenerator)

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

type OCIRepositoryGenerator

type OCIRepositoryGenerator struct {
	// RepositoryRef is the name of a OCIRepository resource to be generated from.
	RepositoryRef string `json:"repositoryRef,omitempty"`

	// Files is a set of rules for identifying files to be parsed.
	Files []RepositoryGeneratorFileItem `json:"files,omitempty"`

	// Directories is a set of rules for identifying directories to be
	// generated.
	Directories []RepositoryGeneratorDirectoryItem `json:"directories,omitempty"`
}

OCIRepositoryGenerator generates from files in a Flux OCIRepository resource.

func (*OCIRepositoryGenerator) DeepCopy

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

func (*OCIRepositoryGenerator) DeepCopyInto

func (in *OCIRepositoryGenerator) DeepCopyInto(out *OCIRepositoryGenerator)

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

type PullRequestGenerator

type PullRequestGenerator struct {
	// The interval at which to check for repository updates.
	// +required
	Interval metav1.Duration `json:"interval"`

	// Determines which git-api protocol to use.
	// +kubebuilder:validation:Enum=github;gitlab;bitbucketserver
	Driver string `json:"driver"`
	// This is the API endpoint to use.
	// +kubebuilder:validation:Pattern="^https://"
	// +optional
	ServerURL string `json:"serverURL,omitempty"`
	// This should be the Repo you want to query.
	// e.g. my-org/my-repo
	// +required
	Repo string `json:"repo"`

	// Reference to Secret in same namespace with a field "password" which is an
	// auth token that can query the Git Provider API.
	SecretRef *LocalObjectReference `json:"secretRef,omitempty"`

	// Labels is used to filter the PRs that you want to target.
	// This may be applied on the server.
	// +optional
	Labels []string `json:"labels,omitempty"`

	// Fork is used to filter out forks from the target PRs if false,
	// or to include forks if  true
	// +optional
	Forks bool `json:"forks,omitempty"`
}

PullRequestGenerator defines a generator that queries a Git hosting service for relevant PRs.

func (*PullRequestGenerator) DeepCopy

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

func (*PullRequestGenerator) DeepCopyInto

func (in *PullRequestGenerator) DeepCopyInto(out *PullRequestGenerator)

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

type RepositoryGeneratorDirectoryItem

type RepositoryGeneratorDirectoryItem struct {
	Path    string `json:"path"`
	Exclude bool   `json:"exclude,omitempty"`
}

RepositoryGeneratorDirectoryItem stores the information about a specific directory to be generated from.

func (*RepositoryGeneratorDirectoryItem) DeepCopy

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

func (*RepositoryGeneratorDirectoryItem) DeepCopyInto

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

type RepositoryGeneratorFileItem

type RepositoryGeneratorFileItem struct {
	// Path is the name of a file to read and generate from can be JSON or YAML.
	Path string `json:"path"`
}

RepositoryGeneratorFileItem defines a path to a file to be parsed when generating.

func (*RepositoryGeneratorFileItem) DeepCopy

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

func (*RepositoryGeneratorFileItem) DeepCopyInto

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,omitempty"`
}

ResourceInventory contains a list of Kubernetes resource object references that have been applied by a Kustomization.

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 resource within a cluster.

func ResourceRefFromObject

func ResourceRefFromObject(obj runtime.Object) (ResourceRef, error)

ResourceRefFromObject returns a ResourceRef from a runtime.Object.

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.

Jump to

Keyboard shortcuts

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