v1alpha1

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package,register +groupName=authzed.com

Index

Constants

View Source
const (
	ConditionTypeValidating          = "Validating"
	ConditionValidatingFailed        = "ValidatingFailed"
	ConditionTypeMigrating           = "Migrating"
	ConditionTypeConfigWarnings      = "ConfigurationWarning"
	ConditionTypePreconditionsFailed = "PreconditionsFailed"
	ConditionTypeRolling             = "RollingDeployment"
	ConditionTypeRolloutError        = "RolloutError"

	ConditionReasonMissingSecret = "MissingSecret"
)
View Source
const (
	SpiceDBClusterResourceName = "spicedbclusters"
	SpiceDBClusterKind         = "SpiceDBCluster"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: authzed.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func NewConfigWarningCondition

func NewConfigWarningCondition(warning error) metav1.Condition

func NewInvalidConfigCondition

func NewInvalidConfigCondition(secretHash string, err error) metav1.Condition

func NewMigratingCondition

func NewMigratingCondition(engine, headRevision string) metav1.Condition

func NewMigrationFailedCondition

func NewMigrationFailedCondition(engine, headRevision string, err error) metav1.Condition

func NewMissingSecretCondition added in v1.1.0

func NewMissingSecretCondition(nn types.NamespacedName) metav1.Condition

func NewPodErrorCondition added in v1.7.0

func NewPodErrorCondition(message string) metav1.Condition

func NewRollingCondition added in v1.1.0

func NewRollingCondition(message string) metav1.Condition

func NewValidatingConfigCondition

func NewValidatingConfigCondition(secretHash string) metav1.Condition

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ClusterSpec

type ClusterSpec struct {
	// Version is the name of the version of SpiceDB that will be run.
	// The version is usually a simple version string like `v1.13.0`, but the
	// operator is configured with a data source that tells it what versions
	// are allowed, and they may have other names.
	// If omitted, the newest version in the head of the channel will be used.
	// Note that the `config.image` field will take precedence over
	// version/channel, if it is specified
	Version string `json:"version,omitempty"`

	// Channel is a defined series of updates that operator should follow.
	// The operator is configured with a datasource that configures available
	// channels and update paths.
	// If `version` is not specified, then the operator will keep SpiceDB
	// up-to-date with the current head of the channel.
	// If `version` is specified, then the operator will write available updates
	// in the status.
	Channel string `json:"channel,omitempty"`

	// Config values to be passed to the cluster
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Type=object
	Config json.RawMessage `json:"config,omitempty"`

	// SecretName points to a secret (in the same namespace) that holds secret
	// config for the cluster like passwords, credentials, etc.
	// If the secret is omitted, one will be generated
	// +optional
	SecretRef string `json:"secretName,omitempty"`

	// Patches is a list of patches to apply to generated resources.
	// If multiple patches apply to the same object and field, later patches
	// in the list take precedence over earlier ones.
	// +optional
	Patches []Patch `json:"patches,omitempty"`
}

ClusterSpec holds the desired state of the cluster.

func (*ClusterSpec) DeepCopy

func (in *ClusterSpec) DeepCopy() *ClusterSpec

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

func (*ClusterSpec) DeepCopyInto

func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec)

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

type ClusterStatus

type ClusterStatus struct {
	// ObservedGeneration represents the .metadata.generation that has been
	// seen by the controller.
	// +optional
	// +kubebuilder:validation:Minimum=0
	ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`

	// TargetMigrationHash is a hash of the desired migration target and config
	TargetMigrationHash string `json:"targetMigrationHash,omitempty"`

	// CurrentMigrationHash is a hash of the currently running migration target and config.
	// If this is equal to TargetMigrationHash (and there are no conditions) then the datastore
	// is fully migrated.
	CurrentMigrationHash string `json:"currentMigrationHash,omitempty"`

	// SecretHash is a digest of the last applied secret
	SecretHash string `json:"secretHash,omitempty"`

	// Image is the image that is or will be used for this cluster
	Image string `json:"image,omitempty"`

	// Migration is the name of the last migration applied
	Migration string `json:"migration,omitempty"`

	// Phase is the currently running phase (used for phased migrations)
	Phase string `json:"phase,omitempty"`

	// CurrentVersion is a description of the currently selected version from
	// the channel, if an update channel is being used.
	CurrentVersion *SpiceDBVersion `json:"version,omitempty"`

	// AvailableVersions is a list of versions that the currently running
	// version can be updated to. Only applies if using an update channel.
	AvailableVersions []SpiceDBVersion `json:"availableVersions,omitempty"`

	// Conditions for the current state of the Stack.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

ClusterStatus communicates the observed state of the cluster.

func (*ClusterStatus) DeepCopy

func (in *ClusterStatus) DeepCopy() *ClusterStatus

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

func (*ClusterStatus) DeepCopyInto

func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)

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

func (ClusterStatus) Equals added in v1.1.0

func (s ClusterStatus) Equals(other ClusterStatus) bool

type Patch added in v1.2.0

type Patch struct {
	// Kind targets an object by its kubernetes Kind name.
	// +optional
	Kind string `json:"kind,omitempty"`

	// Patch is an inlined representation of a structured merge patch (one that
	// just specifies the structure and fields to be modified) or a an explicit
	// JSON6902 patch operation.
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Type=object
	Patch json.RawMessage `json:"patch"`
}

Patch represents a single change to apply to generated manifests

func (*Patch) DeepCopy added in v1.2.0

func (in *Patch) DeepCopy() *Patch

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

func (*Patch) DeepCopyInto added in v1.2.0

func (in *Patch) DeepCopyInto(out *Patch)

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

type SpiceDBCluster

type SpiceDBCluster struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// +optional
	Spec ClusterSpec `json:"spec,omitempty"`

	// +optional
	Status ClusterStatus `json:"status,omitempty"`
}

SpiceDBCluster defines all options for a full SpiceDB cluster

+crd +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:subresource:status +kubebuilder:resource:categories=authzed,shortName=spicedbs +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:printcolumn:name="Channel",type=string,JSONPath=".spec.channel" +kubebuilder:printcolumn:name="Desired",type=string,JSONPath=".spec.version" +kubebuilder:printcolumn:name="Current",type=string,JSONPath=".status.version.name" +kubebuilder:printcolumn:name="Warnings",type=string,JSONPath=".status.conditions[?(@.type=='ConfigurationWarning')].status" +kubebuilder:printcolumn:name="Migrating",type=string,JSONPath=".status.conditions[?(@.type=='Migrating')].status" +kubebuilder:printcolumn:name="Updating",type=string,JSONPath=".status.conditions[?(@.type=='RollingDeployment')].status" +kubebuilder:printcolumn:name="Invalid",type=string,JSONPath=".status.conditions[?(@.type=='ConditionValidatingFailed')].status" +kubebuilder:printcolumn:name="Paused",type=string,JSONPath=".status.conditions[?(@.type=='Paused')].status"

func (*SpiceDBCluster) DeepCopy

func (in *SpiceDBCluster) DeepCopy() *SpiceDBCluster

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

func (*SpiceDBCluster) DeepCopyInto

func (in *SpiceDBCluster) DeepCopyInto(out *SpiceDBCluster)

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

func (*SpiceDBCluster) DeepCopyObject

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

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

func (*SpiceDBCluster) FindStatusCondition

func (c *SpiceDBCluster) FindStatusCondition(conditionType string) *metav1.Condition

FindStatusCondition finds the conditionType in conditions.

func (*SpiceDBCluster) GetStatusConditions added in v0.3.0

func (c *SpiceDBCluster) GetStatusConditions() *[]metav1.Condition

GetStatusConditions returns all status conditions.

func (*SpiceDBCluster) IsStatusConditionChanged

func (c *SpiceDBCluster) IsStatusConditionChanged(conditionType string, condition *metav1.Condition) bool

IsStatusConditionChanged returns true if the passed in condition is different from the condition of the same type.

func (*SpiceDBCluster) IsStatusConditionFalse

func (c *SpiceDBCluster) IsStatusConditionFalse(conditionType string) bool

IsStatusConditionFalse returns true when the conditionType is present and set to `metav1.ConditionFalse`

func (*SpiceDBCluster) IsStatusConditionPresentAndEqual

func (c *SpiceDBCluster) IsStatusConditionPresentAndEqual(conditionType string, status metav1.ConditionStatus) bool

IsStatusConditionPresentAndEqual returns true when conditionType is present and equal to status.

func (*SpiceDBCluster) IsStatusConditionTrue

func (c *SpiceDBCluster) IsStatusConditionTrue(conditionType string) bool

IsStatusConditionTrue returns true when the conditionType is present and set to `metav1.ConditionTrue`

func (*SpiceDBCluster) NamespacedName

func (c *SpiceDBCluster) NamespacedName() types.NamespacedName

func (*SpiceDBCluster) RemoveStatusCondition

func (c *SpiceDBCluster) RemoveStatusCondition(conditionType string)

RemoveStatusCondition removes the corresponding conditionType from conditions. conditions must be non-nil.

func (*SpiceDBCluster) RolloutInProgress added in v1.2.0

func (c *SpiceDBCluster) RolloutInProgress() bool

RolloutInProgress returns true if the current status indicates a rollout is happening.

func (*SpiceDBCluster) SetStatusCondition

func (c *SpiceDBCluster) SetStatusCondition(condition metav1.Condition)

SetStatusCondition sets the corresponding condition in conditions to newCondition. conditions must be non-nil.

  1. if the condition of the specified type already exists (all fields of the existing condition are updated to newCondition, LastTransitionTime is set to now if the new status differs from the old status)
  2. if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended)

func (*SpiceDBCluster) WithAnnotations added in v1.0.0

func (c *SpiceDBCluster) WithAnnotations(entries map[string]string) *SpiceDBCluster

type SpiceDBClusterList

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

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

SpiceDBClusterList is a list of SpiceDBCluster resources

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*SpiceDBClusterList) DeepCopy

func (in *SpiceDBClusterList) DeepCopy() *SpiceDBClusterList

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

func (*SpiceDBClusterList) DeepCopyInto

func (in *SpiceDBClusterList) DeepCopyInto(out *SpiceDBClusterList)

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

func (*SpiceDBClusterList) DeepCopyObject

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

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

type SpiceDBVersion added in v1.1.0

type SpiceDBVersion struct {
	// Name is the identifier for this version
	Name string `json:"name"`

	// Channel is the name of the channel this version is in
	Channel string `json:"channel"`

	// Attributes is an optional set of descriptors for the update, which
	// carry additional information like whether there will be a migration
	// if this version is selected.
	// +optional
	Attributes []SpiceDBVersionAttributes `json:"attributes,omitempty"`

	// Description a human-readable description of the update.
	// +optional
	Description string `json:"description,omitempty"`
}

func (*SpiceDBVersion) DeepCopy added in v1.1.0

func (in *SpiceDBVersion) DeepCopy() *SpiceDBVersion

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

func (*SpiceDBVersion) DeepCopyInto added in v1.1.0

func (in *SpiceDBVersion) DeepCopyInto(out *SpiceDBVersion)

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

func (*SpiceDBVersion) Equals added in v1.1.0

func (v *SpiceDBVersion) Equals(other *SpiceDBVersion) bool

type SpiceDBVersionAttributes added in v1.1.0

type SpiceDBVersionAttributes string
var (
	SpiceDBVersionAttributesNext                 SpiceDBVersionAttributes = "next"
	SpiceDBVersionAttributesMigration            SpiceDBVersionAttributes = "migration"
	SpiceDBVersionAttributesIncompatibleDispatch SpiceDBVersionAttributes = "incompatibleDispatch"
	SpiceDBVersionAttributesLatest               SpiceDBVersionAttributes = "latest"
	SpiceDBVersionAttributesNotInChannel         SpiceDBVersionAttributes = "notInDesiredChannel"
)

Jump to

Keyboard shortcuts

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