controller

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Overview

Install go-enum by `go get install github.com/searKing/golang/tools/go-enum`

Index

Constants

View Source
const (
	// ConditionTypeAvailable represents the status of the Deployment reconciliation
	ConditionTypeAvailable = "Available"
	// ConditionTypeProgressing represents the status used when the custom resource is being deployed.
	ConditionTypeProgressing = "Progressing"
	// ConditionTypeDegraded represents the status used when the custom resource is deleted and the finalizer operations must occur.
	ConditionTypeDegraded = "Degraded"

	ReasonCreated     = "CreatedDeployment"
	ReasonCreating    = "CreatingDeployment"
	ReasonUpdating    = "UpdatingDeployment"
	ReasonAvailable   = "DeploymentAvailable"
	ReasonUnavailable = "DeploymentUnavailable"
)

Definitions to manage status conditions

Variables

This section is empty.

Functions

func IgnoreDeletingErrors

func IgnoreDeletingErrors(err error) error

func OperationResultSliceContains

func OperationResultSliceContains(enums []OperationResult, sunEnums ...OperationResult) bool

OperationResultSliceContains reports whether sunEnums is within enums.

func OperationResultSliceContainsAny

func OperationResultSliceContainsAny(enums []OperationResult, sunEnums ...OperationResult) bool

OperationResultSliceContainsAny reports whether any sunEnum is within enums.

Types

type ModelRegistryParams

type ModelRegistryParams struct {
	Name      string
	Namespace string
	Spec      modelregistryv1alpha1.ModelRegistrySpec

	// gateway route parameters
	Host           string
	IngressService *corev1.Service
	TLS            *modelregistryv1alpha1.TLSServerSettings
}

ModelRegistryParams is a wrapper for template parameters

type ModelRegistryReconciler

type ModelRegistryReconciler struct {
	client.Client
	Scheme         *runtime.Scheme
	Recorder       record.EventRecorder
	Log            logr.Logger
	Template       *template.Template
	EnableWebhooks bool
	IsOpenShift    bool
	HasIstio       bool
	Audiences      []string
}

ModelRegistryReconciler reconciles a ModelRegistry object

func (*ModelRegistryReconciler) Apply

func (r *ModelRegistryReconciler) Apply(params *ModelRegistryParams, templateName string, object interface{}) error

Apply executes given template name with params

func (*ModelRegistryReconciler) Reconcile

func (r *ModelRegistryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ModelRegistry object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile

func (*ModelRegistryReconciler) SetupWithManager

func (r *ModelRegistryReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type OperationResult

type OperationResult int
const (
	// ResourceUnchanged means that the resource has not been changed.
	ResourceUnchanged OperationResult = iota
	// ResourceCreated means that a new resource is created.
	ResourceCreated
	// ResourceUpdated means that an existing resource is updated.
	ResourceUpdated
)

func OperationResultValues

func OperationResultValues() []OperationResult

OperationResultValues returns all values of the enum

func ParseOperationResultString

func ParseOperationResultString(s string) (OperationResult, error)

ParseOperationResultString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func (OperationResult) MarshalBinary

func (i OperationResult) MarshalBinary() (data []byte, err error)

MarshalBinary implements the encoding.BinaryMarshaler interface for OperationResult

func (OperationResult) MarshalJSON

func (i OperationResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for OperationResult

func (OperationResult) MarshalText

func (i OperationResult) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for OperationResult

func (OperationResult) MarshalYAML

func (i OperationResult) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for OperationResult

func (OperationResult) New

New returns a pointer to a new addr filled with the OperationResult value passed in.

func (OperationResult) Registered

func (i OperationResult) Registered() bool

IsAOperationResult returns "true" if the value is listed in the enum definition. "false" otherwise

func (*OperationResult) Scan

func (i *OperationResult) Scan(value interface{}) error

func (OperationResult) String

func (i OperationResult) String() string

func (*OperationResult) UnmarshalBinary

func (i *OperationResult) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for OperationResult

func (*OperationResult) UnmarshalJSON

func (i *OperationResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OperationResult

func (*OperationResult) UnmarshalText

func (i *OperationResult) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for OperationResult

func (*OperationResult) UnmarshalYAML

func (i *OperationResult) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for OperationResult

func (OperationResult) Value

func (i OperationResult) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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