v1alpha1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 defines the Hikyo operator's CustomResourceDefinition Go types: HikyoInstance (cluster-scoped connection configuration) and HikyoSecret (namespaced delivery request). The API group and every field spelling are fixed by the #64 handoff § 0.2, which the k8s-integration ADR delegates to #25. The CRD YAML under chart/hikyo/crds/ is generated from these markers by `controller-gen` and drift-checked by a Go test in this package.

The authority split is the ADR's central security decision, encoded here: a cluster-scoped Hikyo object may never carry authority, so HikyoInstance has no credential-shaped field and its whole spec is immutable; everything with authority or effect lives on the namespaced HikyoSecret. +kubebuilder:object:generate=true +groupName=hikyo.dev

Index

Constants

View Source
const (
	// ConditionReady is the summary — True only when Synced is True and no
	// refusal condition is active.
	ConditionReady = "Ready"
	// ConditionSynced reports whether the last fetch delivered or answered
	// current.
	ConditionSynced = "Synced"
	// ConditionDesignation reports whether the referenced credential object
	// carries a valid designation for this instance.
	ConditionDesignation = "Designation"
	// ConditionConflict reports an ownership or target conflict.
	ConditionConflict = "Conflict"
	// ConditionDelivery reports a delivery-content refusal or caveat.
	ConditionDelivery = "Delivery"
	// ConditionScrubbed reports the managed Secret was emptied (Opaque) or
	// deleted (typed) under an authoritative refusal.
	ConditionScrubbed = "Scrubbed"
	// ConditionRollout reports whether opted-in workloads progressed after a
	// stamp patch.
	ConditionRollout = "Rollout"
	// ConditionCredentialExpiry surfaces credential_expires_at ahead of time.
	ConditionCredentialExpiry = "CredentialExpiry"
	// ConditionPinExpired warns that the delivered revision's pin has expired.
	// Delivery continues while the revision remains available.
	ConditionPinExpired = "PinExpired"
	// ConditionUnreconciled reports a cluster-wide install seeing a CR in a
	// namespace excluded from authority.
	ConditionUnreconciled = "Unreconciled"
)

Condition types.

View Source
const (
	// Synced.
	ReasonDelivered       = "Delivered"       // full delivery written
	ReasonCurrent         = "Current"         // cursor answered current
	ReasonFetchFailed     = "FetchFailed"     // network error, 5xx, 429, 401 — retain, backoff
	ReasonNotMaterialized = "NotMaterialized" // 409, no published revision — retain/empty

	// Designation.
	ReasonSecretNotDesignated         = "SecretNotDesignated"
	ReasonServiceAccountNotDesignated = "ServiceAccountNotDesignated"
	ReasonInstanceMismatch            = "InstanceMismatch"
	ReasonAudienceMissing             = "AudienceMissing" // SA path, instance lacks audience

	// Conflict.
	ReasonManagedSecretNotOwned = "ManagedSecretNotOwned" // target exists without this CR's controller ownerRef
	ReasonTargetClaimed         = "TargetClaimed"         // another HikyoSecret (earlier) names the same target
	ReasonTargetTypeImmutable   = "TargetTypeImmutable"   // existing target has a different immutable Secret type

	// Delivery.
	ReasonUndeliveredSecrets          = "UndeliveredSecrets"          // all-or-nothing: secret keys arrived presence-only
	ReasonKeysMissing                 = "KeysMissing"                 // mapped source keys absent from the manifest
	ReasonInvalidSecretData           = "InvalidSecretData"           // mapped data is invalid for the requested native Secret type
	ReasonLoaderControlUnacknowledged = "LoaderControlUnacknowledged" // mapped secretKey on baseline, not acknowledged
	ReasonEnvFromSkip                 = "EnvFromSkip"                 // secretKey is not a valid env identifier (warning)

	// Scrubbed.
	ReasonAuthorizationWithdrawn = "AuthorizationWithdrawn" // 404 under an authenticating credential

	// Rollout.
	ReasonStalled = "Stalled" // opted-in workload not progressed after the stamp patch

	// CredentialExpiry.
	ReasonExpiresSoon = "ExpiresSoon" // within 7 days
	ReasonExpired     = "Expired"     // passed

	// PinExpired.
	ReasonPinExpired = "PinExpired"

	// Unreconciled.
	ReasonNamespaceNotBound = "NamespaceNotBound" // cluster-wide install, namespace excluded from authority

	// Ready summary.
	ReasonReconciled = "Reconciled" // Ready=True: Synced and no refusal active
	ReasonBlocked    = "Blocked"    // Ready=False: a refusal or failure is active
)

Reasons — the closed set. Each maps to exactly one ADR-named state.

View Source
const (
	LabelDelivery = "hikyo.dev/delivery" // must equal "true"
	LabelInstance = "hikyo.dev/instance" // must equal the HikyoInstance name

	// LabelDeliveryValue is the required value of LabelDelivery.
	LabelDeliveryValue = "true"
)

Designation labels — both required on the bootstrap Secret and on the ServiceAccount (§ 0.2). The instance label must equal the CR's instanceRef.name. Naming a credential is not authority to use it.

View Source
const (
	StampRootSecretName = "hikyo-operator-stamp-root"
	StampRootKey        = "root"
)

StampRootSecretName is the operator-namespace Secret holding the 32-byte random stamp root; StampRootKey is its data key (§ 0.2).

View Source
const AnnotationWorkloadSecrets = "hikyo.dev/secrets"

AnnotationWorkloadSecrets is the workload opt-in: a comma-separated list of managed Secret names the Deployment/StatefulSet/DaemonSet consumes and consents to be rolled for (§ 0.2). Consent lives on the workload.

View Source
const BootstrapTokenKey = "hikyo-token"

BootstrapTokenKey is the data key in a bootstrap Secret holding the bearer credential (§ 0.2).

View Source
const OrphanFinalizer = "hikyo.dev/orphan"

OrphanFinalizer strips the managed Secret's controller ownerRef on CR deletion under creationPolicy: Orphan, so the Secret survives unowned (§ 0.2).

View Source
const StampAnnotationPrefix = "stamp.hikyo.dev/"

StampAnnotationPrefix + target name is the pod-template annotation the operator patches with the per-target stamp (`stamp.hikyo.dev/<target>`). The key-name part is ≤ 63 chars, which is why target.name is bounded there.

Variables

View Source
var AddToScheme = SchemeBuilder.AddToScheme

AddToScheme adds the operator's types to a scheme. The manager wiring and the tests both call it.

View Source
var GroupVersion = schema.GroupVersion{Group: "hikyo.dev", Version: "v1alpha1"}

GroupVersion is hikyo.dev/v1alpha1 (§ 0.2).

View Source
var SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

SchemeBuilder registers the operator's types with a runtime scheme.

Functions

This section is empty.

Types

type AuthRef

type AuthRef struct {
	// SecretRef names a bootstrap Secret in the CR's namespace whose data key
	// `hikyo-token` holds a bearer credential.
	//
	// +optional
	SecretRef *LocalObjectRef `json:"secretRef,omitempty"`

	// ServiceAccountRef names a ServiceAccount in the CR's namespace; the
	// operator mints a short-lived audience-bound token via TokenRequest and
	// presents it under the oidc-federation kind. The instance must declare an
	// audience.
	//
	// +optional
	ServiceAccountRef *LocalObjectRef `json:"serviceAccountRef,omitempty"`
}

AuthRef is exactly one of a bootstrap-Secret credential or a ServiceAccount for federation (ADR § Identity: two credential kinds). The referenced object must additionally carry the designation labels — naming a credential is not authority to use it.

+kubebuilder:validation:XValidation:rule="[has(self.secretRef), has(self.serviceAccountRef)].filter(x, x).size() == 1",message="auth must set exactly one of secretRef or serviceAccountRef"

func (*AuthRef) DeepCopy

func (in *AuthRef) DeepCopy() *AuthRef

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

func (*AuthRef) DeepCopyInto

func (in *AuthRef) DeepCopyInto(out *AuthRef)

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

type CreationPolicy

type CreationPolicy string

CreationPolicy governs the managed Secret's fate on CR deletion.

+kubebuilder:validation:Enum=Owner;Orphan

const (
	// CreationPolicyOwner (default) garbage-collects the managed Secret with
	// its CR via the ownerReference.
	CreationPolicyOwner CreationPolicy = "Owner"
	// CreationPolicyOrphan keeps the controller ownerRef during the CR's life
	// (so the authority test stays one rule) and a finalizer strips it on
	// deletion — the Secret survives, unowned. The explicit opt-in for GitOps
	// handover.
	CreationPolicyOrphan CreationPolicy = "Orphan"
)

type HikyoInstance

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

	Spec   HikyoInstanceSpec   `json:"spec"`
	Status HikyoInstanceStatus `json:"status,omitempty"`
}

HikyoInstance is a cluster-scoped connection target. Creation is RBAC-gated to the cluster admin; a namespace tenant cannot bring their own instance without one being created (ADR § The API objects, accepted consequence).

+kubebuilder:object:root=true +kubebuilder:resource:scope=Cluster,shortName=hkinst +kubebuilder:subresource:status +kubebuilder:printcolumn:name="URL",type=string,JSONPath=`.spec.url`

func (*HikyoInstance) DeepCopy

func (in *HikyoInstance) DeepCopy() *HikyoInstance

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

func (*HikyoInstance) DeepCopyInto

func (in *HikyoInstance) DeepCopyInto(out *HikyoInstance)

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

func (*HikyoInstance) DeepCopyObject

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

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

type HikyoInstanceList

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

+kubebuilder:object:root=true

func (*HikyoInstanceList) DeepCopy

func (in *HikyoInstanceList) DeepCopy() *HikyoInstanceList

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

func (*HikyoInstanceList) DeepCopyInto

func (in *HikyoInstanceList) DeepCopyInto(out *HikyoInstanceList)

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

func (*HikyoInstanceList) DeepCopyObject

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

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

type HikyoInstanceSpec

type HikyoInstanceSpec struct {
	// URL is the Hikyo server origin. HTTPS is mandatory and unconditional —
	// there is no insecure-skip-verify field and never will be (ADR § The API
	// objects). Server certificate verification against caBundle (or system
	// roots) is unconditional.
	//
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=2048
	// +kubebuilder:validation:XValidation:rule="self.startsWith('https://')",message="url must be an https:// origin"
	URL string `json:"url"`

	// CABundle is an optional base64-encoded PEM bundle of trust anchors. Absent
	// means the operator verifies against the host's system roots.
	//
	// +optional
	// +kubebuilder:validation:MaxLength=1048576
	CABundle string `json:"caBundle,omitempty"`

	// Audience is the per-instance TokenRequest audience for the federation
	// path — required whenever a referencing HikyoSecret uses a
	// serviceAccountRef. It is never the API-server default audience (ADR §
	// Identity: mandatory, non-default audience). Absent is valid only for
	// instances used exclusively via bootstrap-Secret credentials.
	//
	// +optional
	// +kubebuilder:validation:MaxLength=512
	Audience string `json:"audience,omitempty"`
}

HikyoInstanceSpec is non-secret connection configuration only: where the Hikyo server is and how to trust it. It NEVER carries a credential, and there is deliberately no field that could hold one (ADR § The API objects). The whole spec is immutable — changing the URL or CA means creating a new HikyoInstance, so "where do credentials and trust point" has an audit-visible identity and a mutated object cannot silently redirect every referencing CR.

+kubebuilder:validation:XValidation:rule="self == oldSelf",message="HikyoInstance spec is immutable; create a new HikyoInstance to change the endpoint or trust anchors"

func (*HikyoInstanceSpec) DeepCopy

func (in *HikyoInstanceSpec) DeepCopy() *HikyoInstanceSpec

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

func (*HikyoInstanceSpec) DeepCopyInto

func (in *HikyoInstanceSpec) DeepCopyInto(out *HikyoInstanceSpec)

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

type HikyoInstanceStatus

type HikyoInstanceStatus struct {
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

HikyoInstanceStatus is intentionally minimal: HikyoInstance has an immutable spec and no reconciler, so there is no derived state to report beyond what controller-runtime records for object identity.

func (*HikyoInstanceStatus) DeepCopy

func (in *HikyoInstanceStatus) DeepCopy() *HikyoInstanceStatus

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

func (*HikyoInstanceStatus) DeepCopyInto

func (in *HikyoInstanceStatus) DeepCopyInto(out *HikyoInstanceStatus)

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

type HikyoSecret

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

	Spec   HikyoSecretSpec   `json:"spec"`
	Status HikyoSecretStatus `json:"status,omitempty"`
}

HikyoSecret is a namespaced delivery request: it fetches under the identity it names (the operator holds none) and writes the result into a native Secret it owns.

+kubebuilder:object:root=true +kubebuilder:resource:scope=Namespaced,shortName=hksec +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Instance",type=string,JSONPath=`.spec.instanceRef.name` +kubebuilder:printcolumn:name="Target",type=string,JSONPath=`.spec.target.name` +kubebuilder:printcolumn:name="Lifecycle",type=string,JSONPath=`.status.lifecycle` +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`

func (*HikyoSecret) DeepCopy

func (in *HikyoSecret) DeepCopy() *HikyoSecret

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

func (*HikyoSecret) DeepCopyInto

func (in *HikyoSecret) DeepCopyInto(out *HikyoSecret)

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

func (*HikyoSecret) DeepCopyObject

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

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

type HikyoSecretList

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

+kubebuilder:object:root=true

func (*HikyoSecretList) DeepCopy

func (in *HikyoSecretList) DeepCopy() *HikyoSecretList

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

func (*HikyoSecretList) DeepCopyInto

func (in *HikyoSecretList) DeepCopyInto(out *HikyoSecretList)

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

func (*HikyoSecretList) DeepCopyObject

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

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

type HikyoSecretSpec

type HikyoSecretSpec struct {
	// Parameters supplies public config identifiers for the immutable fetched
	// snapshot contract. Values are recorded in Hikyo audit events; never use secrets.
	// +optional
	// +kubebuilder:validation:MaxProperties=32
	// +kubebuilder:validation:XValidation:rule="self.all(k, k.matches('^[A-Z][A-Z0-9_]{0,63}$') && size(bytes(self[k])) <= 256)",message="parameter names must be uppercase identifiers and values at most 256 UTF-8 bytes"
	Parameters map[string]ParameterValue `json:"parameters,omitempty"`

	InstanceRef InstanceRef `json:"instanceRef"`
	Auth        AuthRef     `json:"auth"`
	Scope       Scope       `json:"scope"`

	// AllKeys selects every key in this identity's authorized environment
	// manifest, retaining its source name. It is mutually exclusive with a
	// nonempty Mapping and supports only Opaque targets.
	//
	// +optional
	AllKeys bool `json:"allKeys,omitempty"`

	// Mapping is required unless AllKeys is true. Its effective secretKeys are unique. The
	// uniqueness rule uses the effective key (secretKey when set, else key) so
	// two sources cannot silently collide on one destination.
	//
	// +optional
	// +kubebuilder:validation:MaxItems=256
	// +kubebuilder:validation:XValidation:rule="self.all(m1, self.exists_one(m2, (has(m2.secretKey) ? m2.secretKey : m2.key) == (has(m1.secretKey) ? m1.secretKey : m1.key)))",message="mapping secretKeys (effective) must be unique"
	Mapping []Mapping `json:"mapping,omitempty"`

	Target Target `json:"target"`

	// +optional
	// +kubebuilder:default=full
	Projection Projection `json:"projection,omitempty"`

	// AcknowledgedLoaderKeys lists exactly the mapped destination keys on the
	// loader-control baseline that the CR author consents to deliver (§ 0.6).
	// Sent verbatim as `acknowledged_keys` on every fetch so the server records
	// it. With explicit mapping, extra names not among the mapped keys are a
	// refusal. With AllKeys, exact baseline names may be acknowledged before
	// they appear in the manifest; non-baseline names and wildcards are refused.
	//
	// +optional
	// +kubebuilder:validation:MaxItems=64
	AcknowledgedLoaderKeys []KeyName `json:"acknowledgedLoaderKeys,omitempty"`

	// ResyncInterval is the success-path requeue cadence (ops-spec default 5m).
	// A Go duration string; the operator parses it.
	//
	// +optional
	// +kubebuilder:default="5m"
	// +kubebuilder:validation:Pattern=`^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$`
	// +kubebuilder:validation:XValidation:rule="duration(self) >= duration('30s')",message="resyncInterval must be at least 30s"
	ResyncInterval string `json:"resyncInterval,omitempty"`
}

HikyoSecretSpec carries everything with authority or effect (ADR § The API objects): the auth ref, the instance ref, the scope, the mapping, the managed Secret target and policy, the projection and the loader-control acknowledgement.

+kubebuilder:validation:XValidation:rule="(has(self.allKeys) && self.allKeys) != (has(self.mapping) && size(self.mapping) > 0)",message="set exactly one of allKeys: true or a nonempty mapping" +kubebuilder:validation:XValidation:rule="!has(self.allKeys) || !self.allKeys || !has(self.target.type) || self.target.type == 'Opaque'",message="allKeys requires an Opaque target; native Secret types require explicit mapping"

func (*HikyoSecretSpec) DeepCopy

func (in *HikyoSecretSpec) DeepCopy() *HikyoSecretSpec

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

func (*HikyoSecretSpec) DeepCopyInto

func (in *HikyoSecretSpec) DeepCopyInto(out *HikyoSecretSpec)

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

type HikyoSecretStatus

type HikyoSecretStatus struct {
	// +optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Cursor is the opaque server cursor for the last successfully delivered
	// state — non-secret by construction. Empty forces a full authorized fetch.
	//
	// +optional
	Cursor string `json:"cursor,omitempty"`

	// CursorBinding is the hex digest of the local binding tuple (§ 0.5). The
	// cursor is presented only while this still matches the CR's current
	// referenced-credential identity, scope, projection, mapping and target.
	//
	// +optional
	CursorBinding string `json:"cursorBinding,omitempty"`

	// Stamp is the last delivered per-target stamp (`v1:<hex>`), recomputed and
	// compared to the managed Secret's content to prove the recorded delivery is
	// still in effect before the cursor may be presented.
	//
	// +optional
	Stamp string `json:"stamp,omitempty"`

	// +optional
	ManagedSecretUID string `json:"managedSecretUID,omitempty"`

	// +optional
	ManagedSecretResourceVersion string `json:"managedSecretResourceVersion,omitempty"`

	// +optional
	Lifecycle Lifecycle `json:"lifecycle,omitempty"`

	// CredentialExpiresAt mirrors the delivery response's credential_expires_at
	// when finite; surfaced ahead of time as the CredentialExpiry condition.
	//
	// +optional
	CredentialExpiresAt *metav1.Time `json:"credentialExpiresAt,omitempty"`

	// +optional
	LastFetch *metav1.Time `json:"lastFetch,omitempty"`

	// +optional
	LastDelivery *metav1.Time `json:"lastDelivery,omitempty"`
}

HikyoSecretStatus is the reconciler's durable record. The cursor fields are written LAST (§ 0.5) and never advanced after a failed or refused sync.

func (*HikyoSecretStatus) DeepCopy

func (in *HikyoSecretStatus) DeepCopy() *HikyoSecretStatus

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

func (*HikyoSecretStatus) DeepCopyInto

func (in *HikyoSecretStatus) DeepCopyInto(out *HikyoSecretStatus)

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

type InstanceRef

type InstanceRef struct {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`
}

InstanceRef names the cluster-scoped HikyoInstance this CR fetches against. The name is immutable: retargeting the endpoint is delete-and-recreate, so a mutated ref cannot silently redirect a live credential to another server.

+kubebuilder:validation:XValidation:rule="self.name == oldSelf.name",message="instanceRef.name is immutable"

func (*InstanceRef) DeepCopy

func (in *InstanceRef) DeepCopy() *InstanceRef

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

func (*InstanceRef) DeepCopyInto

func (in *InstanceRef) DeepCopyInto(out *InstanceRef)

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

type KeyName

type KeyName string

KeyName mirrors the server's OpenAPI `KeyName` grammar (uppercase ASCII, digits, underscore, no leading digit) — the canonical key-name grammar every delivery surface assumes. Used for mapped source keys and acknowledged loader keys so a comma-bearing or otherwise malformed name cannot change meaning when serialized into `acknowledged_keys`.

+kubebuilder:validation:MinLength=1 +kubebuilder:validation:MaxLength=128 +kubebuilder:validation:Pattern=`^[A-Z_][A-Z0-9_]*$`

func (KeyName) Valid

func (k KeyName) Valid() bool

Valid mirrors KeyName admission for runtime selectors and response validation.

type Lifecycle

type Lifecycle string

Lifecycle is the coarse managed-Secret state, distinct from the fine-grained conditions.

+kubebuilder:validation:Enum=Synced;Retained;Scrubbed;Refused;Unreconciled

const (
	LifecycleSynced       Lifecycle = "Synced"
	LifecycleRetained     Lifecycle = "Retained"
	LifecycleScrubbed     Lifecycle = "Scrubbed"
	LifecycleRefused      Lifecycle = "Refused"
	LifecycleUnreconciled Lifecycle = "Unreconciled"
)

type LocalObjectRef

type LocalObjectRef struct {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`
}

LocalObjectRef names an object in the CR's OWN namespace (there is never a namespace field — same-namespace confinement stops cross-namespace theft, ADR § Identity).

func (*LocalObjectRef) DeepCopy

func (in *LocalObjectRef) DeepCopy() *LocalObjectRef

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

func (*LocalObjectRef) DeepCopyInto

func (in *LocalObjectRef) DeepCopyInto(out *LocalObjectRef)

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

type Mapping

type Mapping struct {
	// Key is the Hikyo source key name, under the canonical KeyName grammar.
	Key KeyName `json:"key"`

	// SecretKey is the managed Secret's data key. Defaults to Key; the operator
	// applies the default, not the API server, because it also validates it
	// against the loader-control baseline (§ 0.6). Kubernetes Secret data keys
	// obey `[-._a-zA-Z0-9]+`.
	//
	// +optional
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Pattern=`^[-._a-zA-Z0-9]+$`
	SecretKey string `json:"secretKey,omitempty"`
}

Mapping is one delivered key routed to one managed-Secret data key. The source `key` is the Hikyo key name; `secretKey` is the destination data key, defaulting to `key`. A renamed destination changes delivery without changing the source set, which is why the mapping digest binds both (cursor eligibility § 0.5).

func (*Mapping) DeepCopy

func (in *Mapping) DeepCopy() *Mapping

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

func (*Mapping) DeepCopyInto

func (in *Mapping) DeepCopyInto(out *Mapping)

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

func (Mapping) EffectiveSecretKey

func (m Mapping) EffectiveSecretKey() string

EffectiveSecretKey is the destination data key: SecretKey when set, else Key.

type ParameterValue

type ParameterValue string

ParameterValue is a public delivery input. The character bound constrains admission's CEL cost estimate; the map's CEL rule enforces the byte bound. +kubebuilder:validation:MaxLength=256

type Projection

type Projection string

Projection is the delivery projection — a server-side authorized term, never a client-side filter (ADR § Loader-control keys). config-only receives the config projection as its authorized manifest and is bound into the cursor.

+kubebuilder:validation:Enum=full;config-only

const (
	ProjectionFull       Projection = "full"
	ProjectionConfigOnly Projection = "config-only"
)

type Scope

type Scope struct {
	Org         ScopeID `json:"org"`
	Project     ScopeID `json:"project"`
	Environment ScopeID `json:"environment"`
}

Scope is the Hikyo (org, project, environment) selector, as the API takes them in the request path.

func (*Scope) DeepCopy

func (in *Scope) DeepCopy() *Scope

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

func (*Scope) DeepCopyInto

func (in *Scope) DeepCopyInto(out *Scope)

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

type ScopeID

type ScopeID string

ScopeID mirrors the server's OpenAPI `ID` grammar — a prefixed UUIDv7, the exact shape the delivery path takes for org/project/environment. Enforcing it at admission stops an invalid CR from entering endless failed reconciles (finding: scope ids must mirror the server grammar).

+kubebuilder:validation:MinLength=3 +kubebuilder:validation:MaxLength=64 +kubebuilder:validation:Pattern=`^[a-z]{2,8}_[0-9a-fA-F-]{36}$`

type Target

type Target struct {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
	Name string `json:"name"`

	// Type is the native Kubernetes Secret type. Changing it while the target
	// exists is refused; the operator never recreates a Secret to change type.
	//
	// +optional
	// +kubebuilder:default=Opaque
	// +kubebuilder:validation:Enum=Opaque;kubernetes.io/dockerconfigjson;kubernetes.io/tls;kubernetes.io/basic-auth;kubernetes.io/ssh-auth
	Type corev1.SecretType `json:"type,omitempty"`

	// +optional
	// +kubebuilder:default=Owner
	CreationPolicy CreationPolicy `json:"creationPolicy,omitempty"`
}

Target is the managed Secret this CR owns. The name is immutable and ≤ 63 chars: retargeting is delete-and-recreate (so a retarget cannot orphan-then-capture), and the 63-char bound is the pod-template stamp annotation's key-name limit (`stamp.hikyo.dev/<target.name>`, § 0.2).

+kubebuilder:validation:XValidation:rule="self.name == oldSelf.name",message="target.name is immutable" +kubebuilder:validation:XValidation:rule="(has(self.creationPolicy) ? self.creationPolicy : 'Owner') == (has(oldSelf.creationPolicy) ? oldSelf.creationPolicy : 'Owner')",message="target.creationPolicy is immutable"

func (*Target) DeepCopy

func (in *Target) DeepCopy() *Target

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

func (*Target) DeepCopyInto

func (in *Target) DeepCopyInto(out *Target)

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