resources

package
v0.0.0-...-d6b22fe Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package resources works directly with k8s resources.

Index

Constants

View Source
const (
	EventNormal  = "Normal"
	EventWarning = "Warning"
)

constants for event types. its a bit odd that this isn't already in one of the k8s pkgs

View Source
const (
	ReasonCreatedPersistentVolumeClaim = "CreatedPersistentVolumeClaim"
	ReasonCreatedDeployment            = "CreatedDeployment"
	ReasonCreatedStatefulSet           = "CreatedStatefulSet"
	ReasonInvalidConfiguration         = "InvalidConfiguration"
)

constants for event reasons.

View Source
const (

	// ConfigJSONKey is the name of the key our json is under.
	ConfigJSONKey = "config.json"
)

Variables

View Source
var (
	// Done represents a result that is complete.
	Done = Result{}
	// Requeue is a result that needs to be re-queued.
	Requeue = Result{/* contains filtered or unexported fields */}
)

Functions

func IsOpenShiftCluster

func IsOpenShiftCluster(ctx context.Context,
	reader rtclient.Reader,
	cfg *conf.OperatorConfig) bool

IsOpenShiftCluster checks if operator is running on OpenShift cluster based on its self-pod annotations.

Types

type Logger

type Logger interface {
	Info(string, ...interface{})
	Error(error, string, ...interface{})
}

Logger interfaces are used to provide logging to the resources package.

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result encapsulates the result of the work performed by a resource update.

func (Result) Err

func (r Result) Err() error

Err returns any error associated with the result.

func (Result) Requeue

func (r Result) Requeue() bool

Requeue returns true if a requeue is needed.

func (Result) Yield

func (r Result) Yield() bool

Yield returns true if current processing should be discontinued.

type SmbShareManager

type SmbShareManager struct {
	// contains filtered or unexported fields
}

SmbShareManager is used to manage SmbShare resources.

func NewSmbShareManager

func NewSmbShareManager(
	client rtclient.Client,
	scheme *runtime.Scheme,
	recorder record.EventRecorder,
	logger Logger) *SmbShareManager

NewSmbShareManager creates a SmbShareManager.

func (*SmbShareManager) Finalize

func (m *SmbShareManager) Finalize(
	ctx context.Context,
	instance *sambaoperatorv1alpha1.SmbShare) Result

Finalize should be called when there's a finalizer on the resource and we need to do some cleanup.

func (*SmbShareManager) Process

func (m *SmbShareManager) Process(
	ctx context.Context,
	nsname types.NamespacedName) Result

Process is called by the controller on any type of reconciliation.

func (*SmbShareManager) Update

Update should be called when a SmbShare resource changes.

Jump to

Keyboard shortcuts

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