v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the riskified v1alpha1 API group +kubebuilder:object:generate=true +groupName=riskified.com

Index

Constants

View Source
const (
	// Various life cycle statuses
	Unknown          LifeCycleStatus = "unknown" // The default status
	Initializing     LifeCycleStatus = "initializing"
	Running          LifeCycleStatus = "running"
	Failed           LifeCycleStatus = "failed"
	Missing          LifeCycleStatus = "missing"
	Updating         LifeCycleStatus = "updating"
	Removing         LifeCycleStatus = "removing"
	IgnoredMissingDR LifeCycleStatus = "ignored-missing-destination-rule"
	IgnoredMissingVS LifeCycleStatus = "ignored-missing-virtual-service"

	// Statuses for the global readiness (argocd ready check)
	Degraded   GlobalReadyStatus = "degraded"
	Ready      GlobalReadyStatus = "ready"
	Processing GlobalReadyStatus = "processing"

	// Whether it's a consumer or subset.
	SUBSET   SubsetOrConsumer = iota
	CONSUMER SubsetOrConsumer = iota
)

Variables

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

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

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

Functions

This section is empty.

Types

type ConsumerStatus

type ConsumerStatus struct {
	ResourceStatus `json:",inline"`
	// Hash of the current consumer - for internal use
	Hash int64 `json:"hash,omitempty"`
	// List of errors related to the consumer
	Errors []StatusError `json:"errors,omitempty"`
}

func (*ConsumerStatus) DeepCopy

func (in *ConsumerStatus) DeepCopy() *ConsumerStatus

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

func (*ConsumerStatus) DeepCopyInto

func (in *ConsumerStatus) DeepCopyInto(out *ConsumerStatus)

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

type ContainerOverrides

type ContainerOverrides struct {
	// Container name to override in multiple containers' environment. If not
	//  specified, we will use the first container.
	ContainerName string `json:"containerName"`

	// Docker image name overridden to the desired subset
	// The Docker image found in the original deployment is used if this is not provided.
	// +optional
	Image string `json:"image,omitempty"`

	// Entrypoint array overridden to the desired subset
	// The docker image's ENTRYPOINT is used if this is not provided.
	// +optional
	Command []string `json:"command,omitempty"`

	// Additional environment variable to the given deployment
	// +optional
	Env []v1.EnvVar `json:"env,omitempty"`
}

Defines the details of the container on which changes need to be made and the relevant overrides

func (*ContainerOverrides) DeepCopy

func (in *ContainerOverrides) DeepCopy() *ContainerOverrides

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

func (*ContainerOverrides) DeepCopyInto

func (in *ContainerOverrides) DeepCopyInto(out *ContainerOverrides)

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

func (ContainerOverrides) IsEmpty

func (co ContainerOverrides) IsEmpty() bool

type DynamicEnv

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

	Spec   DynamicEnvSpec   `json:"spec,omitempty"`
	Status DynamicEnvStatus `json:"status,omitempty"`
}

DynamicEnv is the Schema for the dynamicenvs API

func (*DynamicEnv) DeepCopy

func (in *DynamicEnv) DeepCopy() *DynamicEnv

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

func (*DynamicEnv) DeepCopyInto

func (in *DynamicEnv) DeepCopyInto(out *DynamicEnv)

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

func (*DynamicEnv) DeepCopyObject

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

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

func (*DynamicEnv) SetupWebhookWithManager

func (de *DynamicEnv) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*DynamicEnv) ValidateCreate

func (de *DynamicEnv) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*DynamicEnv) ValidateDelete

func (de *DynamicEnv) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*DynamicEnv) ValidateUpdate

func (de *DynamicEnv) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type DynamicEnvList

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

DynamicEnvList contains a list of DynamicEnv

func (*DynamicEnvList) DeepCopy

func (in *DynamicEnvList) DeepCopy() *DynamicEnvList

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

func (*DynamicEnvList) DeepCopyInto

func (in *DynamicEnvList) DeepCopyInto(out *DynamicEnvList)

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

func (*DynamicEnvList) DeepCopyObject

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

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

type DynamicEnvSpec

type DynamicEnvSpec struct {
	// A list of matchers (partly corresponds to IstioMatch). Each match will have a rule of its
	// own (merged with existing rules) ordered by their order here.
	IstioMatches []IstioMatch `json:"istioMatches"`

	// Who should participate in the given dynamic environment
	Subsets []Subset `json:"subsets"`

	// Consumers are like subsets but for deployments that do not open a service but connect to external resources for
	// their work (e.g., offline workers). They are equivalent to subsets in the sense that they launch overriding
	// deployments with custom image and/or settings. However, since they are only consumers, no virtual service or
	// destination route will be pointing to them.
	Consumers []Subset `json:"consumers,omitempty"`
}

DynamicEnvSpec defines the desired state of DynamicEnv

func (*DynamicEnvSpec) DeepCopy

func (in *DynamicEnvSpec) DeepCopy() *DynamicEnvSpec

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

func (*DynamicEnvSpec) DeepCopyInto

func (in *DynamicEnvSpec) DeepCopyInto(out *DynamicEnvSpec)

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

type DynamicEnvStatus

type DynamicEnvStatus struct {
	// A detailed status of each subset
	SubsetsStatus map[string]SubsetStatus `json:"subsetsStatus"`
	// A detailed status of each consumer
	ConsumersStatus map[string]ConsumerStatus `json:"consumersStatus,omitempty"`
	State           GlobalReadyStatus         `json:"state,omitempty"`
	// desired subsets and consumers count
	TotalCount int `json:"totalCount,omitempty"`
	// number of available subsets and consumers
	TotalReady int `json:"totalReady"`
}

DynamicEnvStatus defines the observed state of DynamicEnv

func (*DynamicEnvStatus) DeepCopy

func (in *DynamicEnvStatus) DeepCopy() *DynamicEnvStatus

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

func (*DynamicEnvStatus) DeepCopyInto

func (in *DynamicEnvStatus) DeepCopyInto(out *DynamicEnvStatus)

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

type GlobalReadyStatus

type GlobalReadyStatus string

func ParseGlobalReadyStatus

func ParseGlobalReadyStatus(s string) GlobalReadyStatus

func (GlobalReadyStatus) MarshalJSON

func (s GlobalReadyStatus) MarshalJSON() ([]byte, error)

func (*GlobalReadyStatus) String

func (s *GlobalReadyStatus) String() string

func (*GlobalReadyStatus) UnmarshalJSON

func (s *GlobalReadyStatus) UnmarshalJSON(data []byte) error

type IstioMatch

type IstioMatch struct {
	// Header values are case-sensitive and formatted as follows:<br/>
	// - `exact: "value"` for exact string match<br/>
	// - `prefix: "value"` for prefix-based match<br/>
	// - `regex: "value"` for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	Headers map[string]StringMatch `json:"headers,omitempty"`

	// One or more labels that constrain the applicability of a rule to source (client) workloads
	// with the given labels.
	SourceLabels map[string]string `json:"sourceLabels,omitempty"`
}

specifies a set of criterion to be met in order for the rule to be applied to the HTTP request This field is immutable after creation.

func (*IstioMatch) DeepCopy

func (in *IstioMatch) DeepCopy() *IstioMatch

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

func (*IstioMatch) DeepCopyInto

func (in *IstioMatch) DeepCopyInto(out *IstioMatch)

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

type LifeCycleStatus

type LifeCycleStatus string

func ParseLifeCycleStatus

func ParseLifeCycleStatus(s string) LifeCycleStatus

func (*LifeCycleStatus) IsFailedStatus

func (s *LifeCycleStatus) IsFailedStatus() bool

func (LifeCycleStatus) MarshalJSON

func (s LifeCycleStatus) MarshalJSON() ([]byte, error)

func (LifeCycleStatus) String

func (s LifeCycleStatus) String() string

func (*LifeCycleStatus) UnmarshalJSON

func (s *LifeCycleStatus) UnmarshalJSON(data []byte) error

type ResourceStatus

type ResourceStatus struct {
	// The name of the resource
	Name string `json:"name"`
	// The namespace where the resource is created
	Namespace string `json:"namespace"`
	// The life cycle status of the resource
	Status LifeCycleStatus `json:"status"`
}

ResourceStatus shows the status of each item created/edited by DynamicEnv

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

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

func (ResourceStatus) IsEqual

func (rs ResourceStatus) IsEqual(other ResourceStatus) bool

type StatusError

type StatusError struct {
	// The error message
	Error string `json:"error"`
	// THe last occurrence of the error
	LastOccurrence metav1.Time `json:"lastOccurrence"`
}

StatusError shows an error we want to display in the status with the last time it happened. This *does not* have to be the only time it happened. The idea is that a list of errors should only

contain a single occurrence of an error (just the last).

func NewStatusError

func NewStatusError(error string) StatusError

func (*StatusError) DeepCopy

func (in *StatusError) DeepCopy() *StatusError

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

func (*StatusError) DeepCopyInto

func (in *StatusError) DeepCopyInto(out *StatusError)

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

func (*StatusError) SameError

func (se *StatusError) SameError(other StatusError) bool

func (*StatusError) UpdateTime

func (se *StatusError) UpdateTime()

type StringMatch

type StringMatch struct {
	Exact  string `json:"exact,omitempty"`
	Prefix string `json:"prefix,omitempty"`
	Regex  string `json:"regex,omitempty"`
}

Describes how to match a given string in HTTP headers. Match is case-sensitive. one and only one of the fields needs to be defined (oneof)

func (*StringMatch) DeepCopy

func (in *StringMatch) DeepCopy() *StringMatch

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

func (*StringMatch) DeepCopyInto

func (in *StringMatch) DeepCopyInto(out *StringMatch)

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

type Subset

type Subset struct {
	// Deployment name (without namespace)
	Name string `json:"name"`

	// Namespace where the deployment is deployed
	Namespace string `json:"namespace"`

	// Labels to add to the pods of the deployment launched by this subset. Could be used in
	// conjunction with 'SourceLabels' in the `IstioMatches`.
	PodLabels map[string]string `json:"podLabels,omitempty"`

	// Number of deployment replicas. Default is 1. Note: 0 is *invalid*.
	Replicas *int32 `json:"replicas,omitempty"`

	// A list of container overrides (at least one of Containers or InitContainers must not be empty)
	Containers []ContainerOverrides `json:"containers,omitempty"`

	// A list of init container overrides (at least one of Containers or InitContainers must not be empty)
	InitContainers []ContainerOverrides `json:"initContainers,omitempty"`

	// Default version for this subset (if different then the global default version). This is the
	// version that will get the default route.
	DefaultVersion string `json:"defaultVersion,omitempty"`
}

Subsets define how to generate subsets from existing Deployments

func (*Subset) DeepCopy

func (in *Subset) DeepCopy() *Subset

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

func (*Subset) DeepCopyInto

func (in *Subset) DeepCopyInto(out *Subset)

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

type SubsetErrors

type SubsetErrors struct {
	// Subset's deployment global errors.
	Deployment []StatusError `json:"deployment,omitempty"`
	// Subset's destination-rule global errors.
	DestinationRule []StatusError `json:"destinationRule,omitempty"`
	// Subset's virtual-services global errors.
	VirtualServices []StatusError `json:"virtualServices,omitempty"`
	// Errors related to subset but not to any of the launched resources
	Subset []StatusError `json:"subset,omitempty"`
}

SubsetErrors contains all global errors related to set subset.

func (*SubsetErrors) DeepCopy

func (in *SubsetErrors) DeepCopy() *SubsetErrors

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

func (*SubsetErrors) DeepCopyInto

func (in *SubsetErrors) DeepCopyInto(out *SubsetErrors)

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

type SubsetMessages

type SubsetMessages struct {
	Deployment      []string
	DestinationRule []string
	VirtualService  []string
	GlobalErrors    []string
}

SubsetMessages contains a list of messages (errors) that occurred during Reconcile loop. At the end of each loop, these messages should be synced to the matching subset status.

func (SubsetMessages) AppendDeploymentMsg

func (rls SubsetMessages) AppendDeploymentMsg(format string, a ...interface{}) SubsetMessages

func (SubsetMessages) AppendDestinationRuleMsg

func (rls SubsetMessages) AppendDestinationRuleMsg(format string, a ...interface{}) SubsetMessages

func (SubsetMessages) AppendGlobalMsg

func (rls SubsetMessages) AppendGlobalMsg(format string, a ...interface{}) SubsetMessages

func (SubsetMessages) AppendVirtualServiceMsg

func (rls SubsetMessages) AppendVirtualServiceMsg(format string, a ...interface{}) SubsetMessages

func (*SubsetMessages) DeepCopy

func (in *SubsetMessages) DeepCopy() *SubsetMessages

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

func (*SubsetMessages) DeepCopyInto

func (in *SubsetMessages) DeepCopyInto(out *SubsetMessages)

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

type SubsetOrConsumer

type SubsetOrConsumer int

type SubsetStatus

type SubsetStatus struct {
	// Status of the deployment that belongs to the subset
	Deployment ResourceStatus `json:"deployment,omitempty"`
	// Status of the destination-rule that belongs to the subset
	DestinationRules []ResourceStatus `json:"destinationRules,omitempty"`
	// Status of the virtual-service that belongs to the subset
	VirtualServices []ResourceStatus `json:"virtualServices,omitempty"`
	// A list of global errors related to subset resources
	Errors *SubsetErrors `json:"subsetErrors,omitempty"`
	// Hash of the current subset - for internal use
	Hash int64 `json:"hash,omitempty"`
}

SubsetStatus Contains aggregation of all resource status connected to set subset.

func (*SubsetStatus) DeepCopy

func (in *SubsetStatus) DeepCopy() *SubsetStatus

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

func (*SubsetStatus) DeepCopyInto

func (in *SubsetStatus) DeepCopyInto(out *SubsetStatus)

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