v1alpha3

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha3 contains API Schema definitions for the configbutler.ai v1alpha3 API group. +kubebuilder:object:generate=true +groupName=configbutler.ai

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "configbutler.ai", Version: "v1alpha3"}

	// 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

This section is empty.

Types

type AgeEncryptionSpec

type AgeEncryptionSpec struct {
	// Enabled toggles age-based recipient resolution and bootstrap behavior.
	// +optional
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// Recipients defines how recipients are resolved.
	// +optional
	Recipients AgeRecipientsSpec `json:"recipients,omitempty"`
}

AgeEncryptionSpec configures age recipient resolution behavior.

func (*AgeEncryptionSpec) DeepCopy

func (in *AgeEncryptionSpec) DeepCopy() *AgeEncryptionSpec

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

func (*AgeEncryptionSpec) DeepCopyInto

func (in *AgeEncryptionSpec) DeepCopyInto(out *AgeEncryptionSpec)

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

type AgeRecipientsSpec

type AgeRecipientsSpec struct {
	// PublicKeys is a static list of age recipients (age1...).
	// +optional
	// +kubebuilder:validation:items:MinLength=1
	PublicKeys []string `json:"publicKeys,omitempty"`

	// ExtractFromSecret derives recipients from all *.agekey entries in encryption.secretRef.
	// +optional
	// +kubebuilder:default=false
	ExtractFromSecret bool `json:"extractFromSecret,omitempty"`

	// GenerateWhenMissing creates a date-named *.agekey entry in encryption.secretRef when no *.agekey exists.
	// +optional
	// +kubebuilder:default=false
	GenerateWhenMissing bool `json:"generateWhenMissing,omitempty"`
}

AgeRecipientsSpec defines age recipient source and key generation behavior.

func (*AgeRecipientsSpec) DeepCopy

func (in *AgeRecipientsSpec) DeepCopy() *AgeRecipientsSpec

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

func (*AgeRecipientsSpec) DeepCopyInto

func (in *AgeRecipientsSpec) DeepCopyInto(out *AgeRecipientsSpec)

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

type ClusterResourceRule

type ClusterResourceRule struct {
	// Operations to watch. If empty, watches all operations (CREATE, UPDATE, DELETE).
	// Supports: CREATE, UPDATE, DELETE, or * (wildcard for all operations).
	// Examples:
	//   - ["CREATE", "UPDATE"] watches only creation and updates
	//   - ["*"] or [] watches all operations
	// +optional
	Operations []OperationType `json:"operations,omitempty"`

	// APIGroups to match. Empty string ("") matches the core API group.
	// If omitted, GitOps Reverser resolves the resource name across all served API groups.
	// Wildcards supported: "*" matches all groups.
	// Examples:
	//   - [""] matches core API (nodes, namespaces)
	//   - ["rbac.authorization.k8s.io"] matches RBAC resources
	//   - ["*"] matches all groups
	//   - [] resolves a named resource only when it is served by one API group
	// +optional
	APIGroups []string `json:"apiGroups,omitempty"`

	// APIVersions to match. If empty, uses the preferred served version for each group/resource.
	// Wildcards supported: "*" matches all versions.
	// Examples:
	//   - ["v1"] matches only v1 version
	//   - ["*"] matches all served versions
	//   - [] matches the preferred served version
	// +optional
	APIVersions []string `json:"apiVersions,omitempty"`

	// Resources to match (plural names like "nodes", "clusterroles").
	// This field is required and determines which resource types trigger this rule.
	// Wildcard semantics follow Kubernetes admission webhook patterns:
	//   - "*" matches all resources
	//   - "nodes" matches exactly nodes
	//   - "pods" matches exactly pods (for namespaced scope)
	//
	// Note: Subresources cannot be added here. Values containing "/" (for example
	// "pods/log" or "pods/*") are rejected by the API because subresources are
	// not supported for list/watch snapshot planning. Prefix/suffix wildcards
	// like "pod*" or "*.example.com" are NOT supported. Use exact matches or the
	// "*" wildcard for broad matching.
	// +required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:MinLength=1
	// +kubebuilder:validation:items:Pattern=`^[^/]*$`
	Resources []string `json:"resources"`

	// Scope defines whether this rule watches Cluster-scoped or Namespaced resources.
	// - "Cluster": For cluster-scoped resources (Nodes, ClusterRoles, CRDs, etc.).
	// - "Namespaced": For namespaced resources (Pods, Deployments, Secrets, etc.),
	//                 across all namespaces.
	// +required
	// +kubebuilder:validation:Enum=Cluster;Namespaced
	Scope ResourceScope `json:"scope"`
}

ClusterResourceRule defines which resources to watch with scope control. Each rule independently specifies whether it watches cluster-scoped or namespaced resources.

func (*ClusterResourceRule) DeepCopy

func (in *ClusterResourceRule) DeepCopy() *ClusterResourceRule

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

func (*ClusterResourceRule) DeepCopyInto

func (in *ClusterResourceRule) DeepCopyInto(out *ClusterResourceRule)

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

type ClusterWatchRule

type ClusterWatchRule struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec defines the desired state of ClusterWatchRule.
	// +required
	Spec ClusterWatchRuleSpec `json:"spec"`

	// status defines the observed state of ClusterWatchRule.
	// +optional
	Status ClusterWatchRuleStatus `json:"status,omitempty"`
}

ClusterWatchRule watches resources across the entire cluster. It provides the ability to audit both cluster-scoped resources (Nodes, ClusterRoles, CRDs) and namespaced resources across multiple namespaces with per-rule filtering.

Security model:

  • ClusterWatchRule is cluster-scoped and requires cluster-admin permissions
  • It references a GitTarget via targetRef (namespace required)
  • Each rule can independently specify Cluster or Namespaced scope

Use cases:

  • Audit cluster infrastructure (Nodes, PersistentVolumes, StorageClasses)
  • Audit RBAC changes (ClusterRoles, ClusterRoleBindings)
  • Audit CRD installations and updates
  • Audit resources across multiple namespaces (e.g., all production namespaces)

func (*ClusterWatchRule) DeepCopy

func (in *ClusterWatchRule) DeepCopy() *ClusterWatchRule

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

func (*ClusterWatchRule) DeepCopyInto

func (in *ClusterWatchRule) DeepCopyInto(out *ClusterWatchRule)

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

func (*ClusterWatchRule) DeepCopyObject

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

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

type ClusterWatchRuleList

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

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

ClusterWatchRuleList contains a list of ClusterWatchRule.

func (*ClusterWatchRuleList) DeepCopy

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

func (*ClusterWatchRuleList) DeepCopyInto

func (in *ClusterWatchRuleList) DeepCopyInto(out *ClusterWatchRuleList)

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

func (*ClusterWatchRuleList) DeepCopyObject

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

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

type ClusterWatchRuleSpec

type ClusterWatchRuleSpec struct {
	// TargetRef references the GitTarget to use.
	// Must specify namespace.
	// +required
	TargetRef NamespacedTargetReference `json:"targetRef"`

	// Rules define which resources to watch.
	// Multiple rules create a logical OR - a resource matching ANY rule is watched.
	// Each rule can specify cluster-scoped or namespaced resources.
	// +required
	// +kubebuilder:validation:MinItems=1
	Rules []ClusterResourceRule `json:"rules"`
}

ClusterWatchRuleSpec defines the desired state of ClusterWatchRule.

func (*ClusterWatchRuleSpec) DeepCopy

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

func (*ClusterWatchRuleSpec) DeepCopyInto

func (in *ClusterWatchRuleSpec) DeepCopyInto(out *ClusterWatchRuleSpec)

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

type ClusterWatchRuleStatus

type ClusterWatchRuleStatus struct {
	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations of the ClusterWatchRule's state.
	// +optional
	// +listType=map
	// +listMapKey=type
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// Streams is the bounded stream-readiness roll-up for the types this rule resolves.
	// +optional
	Streams *WatchRuleStreamsStatus `json:"streams,omitempty"`
}

ClusterWatchRuleStatus defines the observed state of ClusterWatchRule.

func (*ClusterWatchRuleStatus) DeepCopy

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

func (*ClusterWatchRuleStatus) DeepCopyInto

func (in *ClusterWatchRuleStatus) DeepCopyInto(out *ClusterWatchRuleStatus)

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

type CommitMessageSpec

type CommitMessageSpec struct {
	// EventTemplate is a Go text/template string for per-event commit messages
	// (used when commitWindow is "0s"; one event per commit).
	// Available variables: Operation, Group, Version, Resource, Namespace, Name,
	// APIVersion, Username, GitTarget.
	// +optional
	EventTemplate string `json:"eventTemplate,omitempty"`

	// ReconcileTemplate is a Go text/template string for reconcile commit messages
	// (the mark-and-sweep reconcile path; one commit per synced type).
	// Available variables: Count, GitTarget, Group, Version, Resource, APIVersion, Revision.
	// Group/Version/Resource/APIVersion name the synced type for a per-type reconcile and
	// Revision is the cluster resourceVersion the reconcile was pinned to; both are empty
	// for a whole-target reconcile or a pure sweep, so a template referencing them must
	// render cleanly when they are absent (the default guards them with {{if}}).
	// +optional
	ReconcileTemplate string `json:"reconcileTemplate,omitempty"`

	// GroupTemplate is a Go text/template string for grouped commit messages
	// (the commit-window path; one commit per (author, gitTarget) group
	// produced by the batching pipeline).
	// Available variables: Author, GitTarget, Count, Operations (map of
	// CREATE/UPDATE/DELETE counts), Resources (slice of {Group, Version,
	// Resource, Namespace, Name}).
	// +optional
	GroupTemplate string `json:"groupTemplate,omitempty"`
}

CommitMessageSpec configures commit message formatting.

func (*CommitMessageSpec) DeepCopy

func (in *CommitMessageSpec) DeepCopy() *CommitMessageSpec

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

func (*CommitMessageSpec) DeepCopyInto

func (in *CommitMessageSpec) DeepCopyInto(out *CommitMessageSpec)

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

type CommitRequest

type CommitRequest struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of CommitRequest
	// +required
	Spec CommitRequestSpec `json:"spec"`

	// status defines the observed state of CommitRequest
	// +optional
	Status CommitRequestStatus `json:"status,omitempty,omitzero"`
}

CommitRequest is a one-shot "save" signal: creating one finalizes the open commit window for the referenced GitTarget instead of waiting for the silence timer. The resulting commit SHA is reported back in status.

func (*CommitRequest) DeepCopy

func (in *CommitRequest) DeepCopy() *CommitRequest

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

func (*CommitRequest) DeepCopyInto

func (in *CommitRequest) DeepCopyInto(out *CommitRequest)

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

func (*CommitRequest) DeepCopyObject

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

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

type CommitRequestList

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

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

CommitRequestList contains a list of CommitRequest.

func (*CommitRequestList) DeepCopy

func (in *CommitRequestList) DeepCopy() *CommitRequestList

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

func (*CommitRequestList) DeepCopyInto

func (in *CommitRequestList) DeepCopyInto(out *CommitRequestList)

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

func (*CommitRequestList) DeepCopyObject

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

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

type CommitRequestSpec

type CommitRequestSpec struct {
	// TargetRef names the GitTarget whose open commit window to finalize.
	// The GitTarget must be in the same namespace as this CommitRequest.
	// +required
	TargetRef LocalTargetReference `json:"targetRef"`

	// Message is an optional commit message for the finalized commit. When
	// omitted, the generated grouped-commit message is used.
	//
	// When present it is limited to 1-1024 Unicode characters and used
	// verbatim as the commit message. Newlines are allowed so a subject and
	// body can be supplied; all other ASCII control characters (including tab
	// and carriage return) are rejected.
	// +optional
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=1024
	// +kubebuilder:validation:Pattern=`^[^\x00-\x09\x0B-\x1F\x7F]*$`
	Message string `json:"message,omitempty"`

	// CloseDelaySeconds optionally delays closing the open commit window for this
	// many seconds after the CommitRequest is attributed, acting as an extra collect
	// window: changes the author makes in the meantime still join the open commit
	// window and are included in the resulting commit. Omitted or 0 closes the window
	// as soon as the CommitRequest is attributed to its author. The window can still
	// be closed earlier by another author's change or by the provider's commit window
	// timer, exactly as without a CommitRequest.
	// +optional
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=300
	CloseDelaySeconds int32 `json:"closeDelaySeconds,omitempty"`
}

CommitRequestSpec defines the desired state of CommitRequest. The spec is immutable after creation: a CEL validation rule rejects any update that changes it, so a delayed audit event always acts on the spec the object was created with.

+kubebuilder:validation:XValidation:rule="self == oldSelf",message="CommitRequest spec is immutable after creation"

func (*CommitRequestSpec) DeepCopy

func (in *CommitRequestSpec) DeepCopy() *CommitRequestSpec

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

func (*CommitRequestSpec) DeepCopyInto

func (in *CommitRequestSpec) DeepCopyInto(out *CommitRequestSpec)

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

type CommitRequestStatus

type CommitRequestStatus struct {
	// ObservedGeneration is the most recent generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions report the request's progress and terminal outcome: the Ready
	// summary, the kstatus Reconciling/Stalled pair, and the domain conditions
	// AuthorAttributed and Pushed.
	// +optional
	// +listType=map
	// +listMapKey=type
	// +patchStrategy=merge
	// +patchMergeKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// Branch is the Git branch the GitTarget commits to. Populated once the
	// finalize resolves.
	// +optional
	Branch string `json:"branch,omitempty"`

	// SHA is the resulting commit SHA. Set when the commit was pushed (Pushed=True).
	// +optional
	SHA string `json:"sha,omitempty"`
}

CommitRequestStatus defines the observed state of CommitRequest. Progress and outcome are reported entirely through conditions (kstatus-compatible), so the object carries no lifecycle phase string:

  • Ready (summary): True once the request reached a terminal outcome that is not an error — a pushed commit, or a benign no-commit (nothing to save, already present, or a foreign open window). False while in progress or when it failed.
  • Reconciling / Stalled: the kstatus progress / blocked pair. Reconciling=True while finalizing; Stalled=True when the finalize failed and needs attention.
  • AuthorAttributed (domain): binary and settled immediately. True (AttributedFromAdmission) when the submitter captured at admission named the commit author; False (CommitterFallback) when no admission record exists — the validate-operator-types webhook is not configured — and the commit is authored by the configured committer. False is not a failure and does not affect Ready.
  • Pushed (domain): True once the commit is in the remote repository.

func (*CommitRequestStatus) DeepCopy

func (in *CommitRequestStatus) DeepCopy() *CommitRequestStatus

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

func (*CommitRequestStatus) DeepCopyInto

func (in *CommitRequestStatus) DeepCopyInto(out *CommitRequestStatus)

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

type CommitSigningSpec

type CommitSigningSpec struct {
	// SecretRef references the Secret containing the signing key material.
	// Expected keys will be defined by the signing implementation.
	SecretRef LocalSecretReference `json:"secretRef"`

	// GenerateWhenMissing causes the operator to generate signing key material
	// in the referenced Secret when it is missing.
	// +optional
	// +kubebuilder:default=false
	GenerateWhenMissing bool `json:"generateWhenMissing,omitempty"`
}

CommitSigningSpec configures commit signing.

func (*CommitSigningSpec) DeepCopy

func (in *CommitSigningSpec) DeepCopy() *CommitSigningSpec

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

func (*CommitSigningSpec) DeepCopyInto

func (in *CommitSigningSpec) DeepCopyInto(out *CommitSigningSpec)

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

type CommitSpec

type CommitSpec struct {
	// Committer configures the operator identity written as the commit committer.
	// When signing is enabled, Email must be a verified address on the account
	// that owns the signing key.
	// +optional
	Committer *CommitterSpec `json:"committer,omitempty"`

	// Message configures commit message formatting.
	// +optional
	Message *CommitMessageSpec `json:"message,omitempty"`

	// Signing configures commit signing.
	// +optional
	Signing *CommitSigningSpec `json:"signing,omitempty"`
}

CommitSpec configures how gitops-reverser creates commits for a GitProvider.

func (*CommitSpec) DeepCopy

func (in *CommitSpec) DeepCopy() *CommitSpec

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

func (*CommitSpec) DeepCopyInto

func (in *CommitSpec) DeepCopyInto(out *CommitSpec)

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

type CommitterSpec

type CommitterSpec struct {
	// Name is the git committer name.
	// +optional
	// +kubebuilder:default="GitOps Reverser"
	Name string `json:"name,omitempty"`

	// Email is the git committer email.
	// +optional
	// +kubebuilder:default="noreply@configbutler.ai"
	Email string `json:"email,omitempty"`
}

CommitterSpec configures the bot identity used as the commit committer.

func (*CommitterSpec) DeepCopy

func (in *CommitterSpec) DeepCopy() *CommitterSpec

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

func (*CommitterSpec) DeepCopyInto

func (in *CommitterSpec) DeepCopyInto(out *CommitterSpec)

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

type EncryptionSpec

type EncryptionSpec struct {
	// Provider selects the encryption provider.
	// +kubebuilder:default=sops
	// +kubebuilder:validation:Enum=sops
	Provider string `json:"provider"`

	// SecretRef references namespace-local Secret data used by the encryption provider.
	// +optional
	SecretRef LocalSecretReference `json:"secretRef,omitempty"`

	// Age configures age-specific encryption behavior for SOPS.
	// +optional
	Age *AgeEncryptionSpec `json:"age,omitempty"`
}

EncryptionSpec configures Secret encryption behavior for git writes.

func (*EncryptionSpec) DeepCopy

func (in *EncryptionSpec) DeepCopy() *EncryptionSpec

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

func (*EncryptionSpec) DeepCopyInto

func (in *EncryptionSpec) DeepCopyInto(out *EncryptionSpec)

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

type GitProvider

type GitProvider struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of GitProvider
	// +required
	Spec GitProviderSpec `json:"spec"`

	// status defines the observed state of GitProvider
	// +optional
	Status GitProviderStatus `json:"status,omitempty,omitzero"`
}

GitProvider is the Schema for the gitproviders API.

func (*GitProvider) DeepCopy

func (in *GitProvider) DeepCopy() *GitProvider

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

func (*GitProvider) DeepCopyInto

func (in *GitProvider) DeepCopyInto(out *GitProvider)

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

func (*GitProvider) DeepCopyObject

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

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

type GitProviderList

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

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

GitProviderList contains a list of GitProvider.

func (*GitProviderList) DeepCopy

func (in *GitProviderList) DeepCopy() *GitProviderList

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

func (*GitProviderList) DeepCopyInto

func (in *GitProviderList) DeepCopyInto(out *GitProviderList)

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

func (*GitProviderList) DeepCopyObject

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

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

type GitProviderReference

type GitProviderReference struct {
	// API Group of the referent.
	// +kubebuilder:default=configbutler.ai
	// +kubebuilder:validation:Enum=configbutler.ai
	Group string `json:"group,omitempty"`

	// Kind of the referent.
	// Optional because this reference currently only supports a single kind (GitProvider).
	// Keeping it optional allows users to omit it while still benefiting from CRD defaulting.
	// +optional
	// +kubebuilder:validation:Enum=GitProvider
	// +kubebuilder:default=GitProvider
	Kind string `json:"kind,omitempty"`

	// Name of the referent.
	// +required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
}

GitProviderReference references the GitProvider that backs a GitTarget. Many GitTargets may reference the same GitProvider; the reference is always to a GitProvider in the GitTarget's own namespace. Group and Kind are typed (with defaults) for consistency with the project's other local references and so the schema is explicit about what it accepts — currently only configbutler.ai/GitProvider.

func (*GitProviderReference) DeepCopy

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

func (*GitProviderReference) DeepCopyInto

func (in *GitProviderReference) DeepCopyInto(out *GitProviderReference)

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

type GitProviderSpec

type GitProviderSpec struct {
	// URL of the repository (HTTP/SSH).
	// Immutable: delete and recreate the GitProvider to point at a different repository.
	// +kubebuilder:validation:MinLength=1
	URL string `json:"url"`

	// SecretRef for authentication credentials (may be nil for public repos)
	SecretRef *LocalSecretReference `json:"secretRef,omitempty"`

	// KnownHostsRef optionally points at a namespace-local ConfigMap or Secret holding SSH
	// known_hosts, so host trust can be centralized across GitProviders on the same host instead
	// of repeated in every credentials Secret. It is used only for SSH and ignored for HTTP auth.
	// Host keys are resolved in priority order: the credentials Secret's own known_hosts, then this
	// ref, then the install-level default known-hosts ConfigMap; if none yields valid keys, SSH
	// fails closed.
	// +optional
	KnownHostsRef *KnownHostsReference `json:"knownHostsRef,omitempty"`

	// AllowedBranches restricts which branches can be written to.
	// +required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:MinLength=1
	AllowedBranches []string `json:"allowedBranches"`

	// Push controls how events are coalesced into commits before pushing.
	// +optional
	Push *PushStrategy `json:"push,omitempty"`

	// Commit configures commit identity, message formatting, and signing behavior.
	// +optional
	Commit *CommitSpec `json:"commit,omitempty"`
}

GitProviderSpec defines the desired state of GitProvider.

Only the repository URL is immutable. The URL is the destination identity that every referencing GitTarget materializes into; changing it would silently point those targets at a different repository and orphan their existing materialization (the same reason a GitTarget's destination is immutable). To repoint, delete and recreate the GitProvider. Everything else here is operational and deliberately stays mutable — notably allowedBranches (widening or narrowing the writable set is a normal change that must not require tearing down every GitTarget), plus auth, push tuning, and commit identity/signing.

+kubebuilder:validation:XValidation:rule="self.url == oldSelf.url",message="spec.url is immutable; delete and recreate the GitProvider to point at a different repository"

func (*GitProviderSpec) DeepCopy

func (in *GitProviderSpec) DeepCopy() *GitProviderSpec

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

func (*GitProviderSpec) DeepCopyInto

func (in *GitProviderSpec) DeepCopyInto(out *GitProviderSpec)

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

type GitProviderStatus

type GitProviderStatus struct {
	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions report repository validation and commit configuration readiness:
	// the Ready summary plus the kstatus Reconciling/Stalled pair.
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// SigningPublicKey is the operator's SSH signing public key in authorized_keys format.
	// Register this as a signing key on your git platform.
	// Only populated when commit.signing is configured and a signing key is available.
	// +optional
	SigningPublicKey string `json:"signingPublicKey,omitempty"`
}

GitProviderStatus defines the observed state of GitProvider.

func (*GitProviderStatus) DeepCopy

func (in *GitProviderStatus) DeepCopy() *GitProviderStatus

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

func (*GitProviderStatus) DeepCopyInto

func (in *GitProviderStatus) DeepCopyInto(out *GitProviderStatus)

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

type GitTarget

type GitTarget struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty,omitzero"`

	// spec defines the desired state of GitTarget
	// +required
	Spec GitTargetSpec `json:"spec"`

	// status defines the observed state of GitTarget
	// +optional
	Status GitTargetStatus `json:"status,omitempty,omitzero"`
}

GitTarget is the Schema for the gittargets API.

func (*GitTarget) DeepCopy

func (in *GitTarget) DeepCopy() *GitTarget

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

func (*GitTarget) DeepCopyInto

func (in *GitTarget) DeepCopyInto(out *GitTarget)

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

func (*GitTarget) DeepCopyObject

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

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

type GitTargetList

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

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

GitTargetList contains a list of GitTarget.

func (*GitTargetList) DeepCopy

func (in *GitTargetList) DeepCopy() *GitTargetList

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

func (*GitTargetList) DeepCopyInto

func (in *GitTargetList) DeepCopyInto(out *GitTargetList)

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

func (*GitTargetList) DeepCopyObject

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

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

type GitTargetPlacementSpec

type GitTargetPlacementSpec struct {
	// ByType maps an exact resource type key ("{group}/{version}/{resource}", e.g.
	// "v1/configmaps", "apps/v1/deployments", or "v1/secrets"; core resources omit
	// the group) to the path template used for a new resource of that type. A path
	// selected for a sensitive resource (Secrets, plus any operator-configured
	// sensitive type) must be identity-complete so it cannot collide two distinct
	// sensitive resources onto one file.
	// +optional
	ByType map[string]string `json:"byType,omitempty"`

	// Default is the path template used for a new resource whose type has no ByType
	// entry. Omitted, it falls through to sibling-layout inference and then the
	// built-in canonical path. A bundling default (one that is not identity-complete,
	// such as "all.yaml") is only valid when a sensitive resource can never reach it
	// — give every sensitive type an explicit identity-complete ByType entry.
	// +optional
	Default string `json:"default,omitempty"`
}

GitTargetPlacementSpec declares where NEW resources are written when no document for their identity exists yet in Git — one exact-type map plus a fallback default template (Option B2 of docs/spec/gittarget-new-file-placement-rules.md). There is deliberately no separate "sensitive" placement block: sensitivity is a write-safety classification the controller owns (encrypt the content, keep the path identity-complete, never append or co-mingle), not a second placement namespace the user has to configure. A user routes Secrets the same way they route anything else — by naming their type in ByType. When a resource's type has no ByType entry and no Default, placement falls back to following the layout already established by sibling resources in the repository, and finally to the canonical, versionless {namespaceOrCluster}/{group}/{resource}/{name}.yaml path when there is nothing to follow. Because that fallback omits the API version, objects that differ only by version share a file; a target that watches several versions of the same group/resource and wants them separated must use a ByType/Default template that includes {version}.

func (*GitTargetPlacementSpec) DeepCopy

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

func (*GitTargetPlacementSpec) DeepCopyInto

func (in *GitTargetPlacementSpec) DeepCopyInto(out *GitTargetPlacementSpec)

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

type GitTargetSpec

type GitTargetSpec struct {
	// ProviderRef references the GitProvider that backs this target.
	// Immutable: delete and recreate the GitTarget to change its destination.
	// +required
	ProviderRef GitProviderReference `json:"providerRef"`

	// Branch to use for this target.
	// Must be one of the allowed branches in the provider.
	// Immutable: delete and recreate the GitTarget to change its destination.
	// +required
	// +kubebuilder:validation:MinLength=1
	Branch string `json:"branch"`

	// Path within the repository to write resources to, relative to the repository
	// root. Required and must be non-empty — there is no default, so a GitTarget can
	// never silently write to the repository root. To deliberately target the
	// repository root, set it to "." (the ArgoCD/Flux convention); an empty string is
	// rejected because it is too easy to leave blank by accident to be a deliberate
	// root choice. Any leading slash (absolute path) and ".." are rejected, and a
	// trailing slash is normalized away.
	// Immutable: delete and recreate the GitTarget to change its destination.
	// +required
	// +kubebuilder:validation:MinLength=1
	Path string `json:"path"`

	// Encryption defines encryption settings for Secret resource writes.
	// +optional
	Encryption *EncryptionSpec `json:"encryption,omitempty"`

	// Placement declares where NEW resources are written. It has no effect on a
	// resource that already has a document in Git — that document is always
	// updated in place at its existing location, wherever that is. Mutable: a
	// change only affects resources created after the change.
	// +optional
	Placement *GitTargetPlacementSpec `json:"placement,omitempty"`
}

GitTargetSpec defines the desired state of GitTarget.

The destination fields — providerRef, branch, and path — are immutable. A GitTarget materializes the watched resources at exactly one (provider, branch, folder); changing where it writes would orphan the old materialization and require migrating manifests between repositories/branches/folders. Instead of reconciling that move, the destination is fixed: to relocate a GitTarget, delete it and create a new one. This keeps the one-owner-per-folder invariant and the initial-snapshot gate simple — a successful snapshot can never be silently invalidated by a destination change.

+kubebuilder:validation:XValidation:rule="self.providerRef == oldSelf.providerRef",message="spec.providerRef is immutable; delete and recreate the GitTarget to change its destination" +kubebuilder:validation:XValidation:rule="self.branch == oldSelf.branch",message="spec.branch is immutable; delete and recreate the GitTarget to change its destination" +kubebuilder:validation:XValidation:rule="self.path == oldSelf.path",message="spec.path is immutable; delete and recreate the GitTarget to change its destination"

func (*GitTargetSpec) DeepCopy

func (in *GitTargetSpec) DeepCopy() *GitTargetSpec

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

func (*GitTargetSpec) DeepCopyInto

func (in *GitTargetSpec) DeepCopyInto(out *GitTargetSpec)

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

type GitTargetStatus

type GitTargetStatus struct {
	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations of an object's state
	// +optional
	// +listType=map
	// +listMapKey=type
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// LastReconcileTime is the timestamp of the most recent reconcile attempt.
	// +optional
	LastReconcileTime metav1.Time `json:"lastReconcileTime,omitempty"`

	// LastPushTime is the timestamp of the last successful push.
	// +optional
	LastPushTime *metav1.Time `json:"lastPushTime,omitempty"`

	// Streams is the bounded data-plane roll-up over this GitTarget's tracked types.
	// Counts, never a per-type list, so it stays bounded however many types are watched.
	// +optional
	Streams *GitTargetStreamsStatus `json:"streams,omitempty"`
}

GitTargetStatus defines the observed state of GitTarget.

func (*GitTargetStatus) DeepCopy

func (in *GitTargetStatus) DeepCopy() *GitTargetStatus

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

func (*GitTargetStatus) DeepCopyInto

func (in *GitTargetStatus) DeepCopyInto(out *GitTargetStatus)

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

type GitTargetStreamsStatus

type GitTargetStreamsStatus struct {
	// Summary is the display-only ready/total ratio.
	// +optional
	Summary string `json:"summary,omitempty"`

	// Total is how many types this target tracks.
	Total int32 `json:"total"`

	// Ready is how many tracked types are Streaming.
	Ready int32 `json:"ready"`

	// Replaying is how many tracked types are still replaying their initial events.
	Replaying int32 `json:"replaying"`

	// Blocked is how many tracked types cannot currently be watched.
	Blocked int32 `json:"blocked"`

	// ObservedTime is when this roll-up was last computed.
	// +optional
	ObservedTime *metav1.Time `json:"observedTime,omitempty"`
}

GitTargetStreamsStatus is a bounded roll-up of the stream readiness state for the types this GitTarget tracks.

func (*GitTargetStreamsStatus) DeepCopy

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

func (*GitTargetStreamsStatus) DeepCopyInto

func (in *GitTargetStreamsStatus) DeepCopyInto(out *GitTargetStreamsStatus)

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

type KnownHostsReference

type KnownHostsReference struct {
	// Kind of the referent: ConfigMap (default) or Secret.
	// +optional
	// +kubebuilder:validation:Enum=ConfigMap;Secret
	// +kubebuilder:default=ConfigMap
	Kind string `json:"kind,omitempty"`

	// Name of the ConfigMap or Secret.
	// +required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
}

KnownHostsReference points at a namespace-local ConfigMap or Secret that holds SSH known_hosts host-trust material. The data is read from the "known_hosts" key, falling back to "ssh_known_hosts" (the key Argo CD's argocd-ssh-known-hosts-cm ConfigMap uses, for host keys copied out of it).

func (*KnownHostsReference) DeepCopy

func (in *KnownHostsReference) DeepCopy() *KnownHostsReference

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

func (*KnownHostsReference) DeepCopyInto

func (in *KnownHostsReference) DeepCopyInto(out *KnownHostsReference)

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

type LocalSecretReference

type LocalSecretReference struct {
	// Group of the referent.
	// +kubebuilder:default=""
	// +optional
	Group string `json:"group,omitempty"`

	// Kind of the referent.
	// +kubebuilder:validation:Enum=Secret
	// +kubebuilder:default=Secret
	// +optional
	Kind string `json:"kind,omitempty"`

	// Name of the Secret.
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
}

LocalSecretReference is a typed reference to a Secret in the same namespace.

func (*LocalSecretReference) DeepCopy

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

func (*LocalSecretReference) DeepCopyInto

func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference)

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

type LocalTargetReference

type LocalTargetReference struct {
	// API Group of the referent.
	// +kubebuilder:default=configbutler.ai
	// +kubebuilder:validation:Enum=configbutler.ai
	Group string `json:"group,omitempty"`

	// Kind of the referent.
	// Optional because this reference currently only supports a single kind (GitTarget).
	// Keeping it optional allows users to omit it while still benefiting from CRD defaulting.
	// +optional
	// +kubebuilder:validation:Enum=GitTarget
	// +kubebuilder:default=GitTarget
	Kind string `json:"kind,omitempty"`

	// Name of the referent.
	// +required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`
}

func (*LocalTargetReference) DeepCopy

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

func (*LocalTargetReference) DeepCopyInto

func (in *LocalTargetReference) DeepCopyInto(out *LocalTargetReference)

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

type NamespacedTargetReference

type NamespacedTargetReference struct {
	// API Group of the referent.
	// +kubebuilder:validation:Enum=configbutler.ai
	// +kubebuilder:default=configbutler.ai
	Group string `json:"group,omitempty"`

	// Kind of the referent.
	// Optional because this reference currently only supports a single kind (GitTarget).
	// Keeping it optional allows users to omit it while still benefiting from CRD defaulting.
	// +optional
	// +kubebuilder:validation:Enum=GitTarget
	// +kubebuilder:default=GitTarget
	Kind string `json:"kind,omitempty"`

	// Name of the referent.
	// +required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Required because ClusterWatchRule has no namespace.
	// +required
	// +kubebuilder:validation:MinLength=1
	Namespace string `json:"namespace"`
}

func (*NamespacedTargetReference) DeepCopy

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

func (*NamespacedTargetReference) DeepCopyInto

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

type OperationType

type OperationType string

OperationType specifies the type of operation that triggers a watch event. +kubebuilder:validation:Enum=CREATE;UPDATE;DELETE;*

const (
	// OperationCreate matches resource creation events.
	OperationCreate OperationType = "CREATE"
	// OperationUpdate matches resource update events.
	OperationUpdate OperationType = "UPDATE"
	// OperationDelete matches resource deletion events.
	OperationDelete OperationType = "DELETE"
	// OperationAll matches all operation types.
	OperationAll OperationType = "*"
)

type PushStrategy

type PushStrategy struct {
	// CommitWindow is the rolling silence window used to coalesce events into
	// a single commit per (author, gitTarget). The timer resets on every event
	// arrival and a flush is triggered after this many seconds of silence.
	// Setting "0s" opts into per-event commits in the steady-state.
	// Defaults to "5s".
	// +optional
	CommitWindow *string `json:"commitWindow,omitempty"`
}

PushStrategy defines how events are coalesced into commits before pushing.

func (*PushStrategy) DeepCopy

func (in *PushStrategy) DeepCopy() *PushStrategy

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

func (*PushStrategy) DeepCopyInto

func (in *PushStrategy) DeepCopyInto(out *PushStrategy)

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

type ResourceRule

type ResourceRule struct {
	// Operations to watch. If empty, watches all operations (CREATE, UPDATE, DELETE).
	// Supports: CREATE, UPDATE, DELETE, or * (wildcard for all operations).
	// Examples:
	//   - ["CREATE", "UPDATE"] watches only creation and updates, ignoring deletions
	//   - ["*"] or [] watches all operations
	// +optional
	Operations []OperationType `json:"operations,omitempty"`

	// APIGroups to match. Empty string ("") matches the core API group.
	// If omitted, GitOps Reverser resolves the resource name across all served API groups.
	// Wildcards supported: "*" matches all groups.
	// Examples:
	//   - [""] matches core API (pods, services, configmaps)
	//   - ["apps"] matches apps API group (deployments, statefulsets)
	//   - ["", "apps"] matches both core and apps groups
	//   - ["*"] matches all groups
	//   - [] resolves a named resource only when it is served by one API group
	// +optional
	APIGroups []string `json:"apiGroups,omitempty"`

	// APIVersions to match. If empty, uses the preferred served version for each group/resource.
	// Wildcards supported: "*" matches all versions.
	// Examples:
	//   - ["v1"] matches only v1 version
	//   - ["v1", "v1beta1"] matches both versions
	//   - ["*"] matches all served versions
	//   - [] matches the preferred served version
	//
	// Multi-version note: the built-in cold-start Git path is versionless, so two
	// objects that differ only by API version resolve to the same file. To watch
	// several versions of a group/resource and keep them in separate files, give the
	// GitTarget a placement template that includes {version} (see GitTargetPlacementSpec).
	// +optional
	APIVersions []string `json:"apiVersions,omitempty"`

	// Resources to match (plural names like "pods", "configmaps").
	// This field is required and determines which resource types trigger this rule.
	// Wildcard semantics follow Kubernetes admission webhook patterns:
	//   - "*" matches all resources
	//   - "pods" matches exactly pods (case-insensitive)
	//
	// For custom resources, use the exact plural resource name and set apiGroups
	// when more than one served API group exposes that name.
	//
	// Note: Subresources cannot be added here. Values containing "/" (for example
	// "pods/log" or "pods/*") are rejected by the API because subresources are
	// not supported for list/watch snapshot planning. Prefix/suffix wildcards
	// like "pod*" or "*.example.com" are NOT supported. Use exact matches or the
	// "*" wildcard for broad matching.
	// +required
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:items:MinLength=1
	// +kubebuilder:validation:items:Pattern=`^[^/]*$`
	Resources []string `json:"resources"`
}

ResourceRule defines a set of namespaced resources to watch. Omitted API groups and versions are resolved from the served Kubernetes API surface. All fields except Resources are optional.

func (*ResourceRule) DeepCopy

func (in *ResourceRule) DeepCopy() *ResourceRule

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

func (*ResourceRule) DeepCopyInto

func (in *ResourceRule) DeepCopyInto(out *ResourceRule)

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

type ResourceScope

type ResourceScope string

ResourceScope defines the scope of resources. +kubebuilder:validation:Enum=Cluster;Namespaced

const (
	// ResourceScopeCluster indicates cluster-scoped resources (Nodes, ClusterRoles, etc.).
	ResourceScopeCluster ResourceScope = "Cluster"

	// ResourceScopeNamespaced indicates namespaced resources (Pods, Deployments, etc.).
	ResourceScopeNamespaced ResourceScope = "Namespaced"
)

type WatchRule

type WatchRule struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec defines the desired state of WatchRule
	// +required
	Spec WatchRuleSpec `json:"spec"`

	// status defines the observed state of WatchRule
	// +optional
	Status WatchRuleStatus `json:"status,omitempty"`
}

WatchRule watches namespaced resources within its own namespace. It provides fine-grained control over which resources trigger Git commits, with filtering by operation type, API group, version, and labels.

Security model:

  • WatchRule is namespace-scoped and can only watch resources in its own namespace
  • Use ClusterWatchRule for watching cluster-scoped resources (Nodes, ClusterRoles, etc.)
  • RBAC controls who can create/modify WatchRules per namespace

func (*WatchRule) DeepCopy

func (in *WatchRule) DeepCopy() *WatchRule

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

func (*WatchRule) DeepCopyInto

func (in *WatchRule) DeepCopyInto(out *WatchRule)

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

func (*WatchRule) DeepCopyObject

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

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

type WatchRuleList

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

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

WatchRuleList contains a list of WatchRule.

func (*WatchRuleList) DeepCopy

func (in *WatchRuleList) DeepCopy() *WatchRuleList

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

func (*WatchRuleList) DeepCopyInto

func (in *WatchRuleList) DeepCopyInto(out *WatchRuleList)

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

func (*WatchRuleList) DeepCopyObject

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

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

type WatchRuleSpec

type WatchRuleSpec struct {
	// TargetRef references the GitTarget to use.
	// Must be in the same namespace.
	// +required
	TargetRef LocalTargetReference `json:"targetRef"`

	// Rules define which resources to watch within this namespace.
	// Multiple rules create a logical OR - a resource matching ANY rule is watched.
	// Each rule can specify operations, API groups, versions, and resource types.
	// +required
	// +kubebuilder:validation:MinItems=1
	Rules []ResourceRule `json:"rules"`
}

WatchRuleSpec defines the desired state of WatchRule. WatchRule watches resources ONLY within its own namespace.

func (*WatchRuleSpec) DeepCopy

func (in *WatchRuleSpec) DeepCopy() *WatchRuleSpec

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

func (*WatchRuleSpec) DeepCopyInto

func (in *WatchRuleSpec) DeepCopyInto(out *WatchRuleSpec)

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

type WatchRuleStatus

type WatchRuleStatus struct {
	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations of an object's state
	// +optional
	// +listType=map
	// +listMapKey=type
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// Streams is the bounded stream-readiness roll-up for the types this rule resolves.
	// +optional
	Streams *WatchRuleStreamsStatus `json:"streams,omitempty"`
}

WatchRuleStatus defines the observed state of WatchRule.

func (*WatchRuleStatus) DeepCopy

func (in *WatchRuleStatus) DeepCopy() *WatchRuleStatus

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

func (*WatchRuleStatus) DeepCopyInto

func (in *WatchRuleStatus) DeepCopyInto(out *WatchRuleStatus)

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

type WatchRuleStreamsStatus

type WatchRuleStreamsStatus struct {
	// Summary is the display-only ready/total ratio.
	// +optional
	Summary string `json:"summary,omitempty"`

	// Total is how many types this rule resolves.
	Total int32 `json:"total"`

	// Ready is how many resolved types are Streaming.
	Ready int32 `json:"ready"`

	// Replaying is how many resolved types are still replaying their initial events.
	Replaying int32 `json:"replaying"`

	// Blocked is how many resolved types cannot currently be watched.
	Blocked int32 `json:"blocked"`

	// PendingSample is a bounded sample of types not yet ready.
	// +optional
	// +kubebuilder:validation:MaxItems=5
	PendingSample []string `json:"pendingSample,omitempty"`

	// ObservedTime is when this roll-up was last computed.
	// +optional
	ObservedTime *metav1.Time `json:"observedTime,omitempty"`
}

WatchRuleStreamsStatus is a bounded roll-up of the stream-readiness state for the types a WatchRule or ClusterWatchRule resolves.

func (*WatchRuleStreamsStatus) DeepCopy

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

func (*WatchRuleStreamsStatus) DeepCopyInto

func (in *WatchRuleStreamsStatus) DeepCopyInto(out *WatchRuleStreamsStatus)

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