system

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerImageOrg is the org of the default image url
	ContainerImageOrg = "noobaa"
	// ContainerImageRepo is the repo of the default image url
	ContainerImageRepo = "noobaa-core"
	// ContainerImageTag is the tag of the default image url
	ContainerImageTag = "5"
	// ContainerImageConstraintSemver is the contraints of supported image versions
	ContainerImageConstraintSemver = ">=5, <6"
	// ContainerImageName is the default image name without the tag/version
	ContainerImageName = ContainerImageOrg + "/" + ContainerImageRepo
	// ContainerImage is the full default image url
	ContainerImage = ContainerImageName + ":" + ContainerImageTag
	// MongoImage is the default mongodb image url
	MongoImage = "centos/mongodb-36-centos7"

	// AdminAccountEmail is the default email used for admin account
	AdminAccountEmail = "admin@noobaa.io"
)

Variables

View Source
var (
	// ContainerImageConstraint is the instantiated semver contraints used for image verification
	ContainerImageConstraint, _ = semver.NewConstraint(ContainerImageConstraintSemver)

	// NooBaaType is and empty noobaa struct used for passing the object type
	NooBaaType = &nbv1.NooBaa{}
)

Functions

func CombineErrors

func CombineErrors(errs ...error) error

CombineErrors takes a list of errors and combines them to one. Generally it will return the first non-nil error, but if a persistent error is found it will be returned instead of non-persistent errors.

func IsPersistentError

func IsPersistentError(err error) bool

IsPersistentError checks if the provided error is persistent.

func SecretResetStringDataFromData

func SecretResetStringDataFromData(secret *corev1.Secret)

SecretResetStringDataFromData reads the secret data into string data to streamline the paths that use the secret values as strings.

Types

type PersistentError

type PersistentError struct {
	E error
}

PersistentError is an error type that tells the reconcile to avoid requeueing.

func NewPersistentError

func NewPersistentError(err error) *PersistentError

NewPersistentError returns a new persistent error.

func (*PersistentError) Error

func (e *PersistentError) Error() string

Error function makes PersistentError implement error interface

type System

type System struct {
	Request  types.NamespacedName
	Client   client.Client
	Scheme   *runtime.Scheme
	Ctx      context.Context
	Logger   *logrus.Entry
	Recorder record.EventRecorder
	NBClient nb.Client

	NooBaa       *nbv1.NooBaa
	CoreApp      *appsv1.StatefulSet
	ServiceMgmt  *corev1.Service
	ServiceS3    *corev1.Service
	SecretServer *corev1.Secret
	SecretOp     *corev1.Secret
	SecretAdmin  *corev1.Secret
}

System is the context for loading or reconciling a noobaa system

func New

func New(req types.NamespacedName, client client.Client, scheme *runtime.Scheme, recorder record.EventRecorder) *System

New initializes a system to be used for loading or reconciling a noobaa system

func (*System) CheckServiceStatus

func (s *System) CheckServiceStatus(srv *corev1.Service, status *nbv1.ServiceStatus, portName string)

CheckServiceStatus populates the status of a service by detecting all of its addresses

func (*System) CheckSpecImage

func (s *System) CheckSpecImage() error

CheckSpecImage checks the System.Spec.Image property, and sets System.Status.ActualImage

func (*System) Complete

func (s *System) Complete() error

Complete populates the noobaa status at the end of reconcile.

func (*System) GetObject

func (s *System) GetObject(name string, obj runtime.Object) error

GetObject gets an object by name from the request namespace.

func (*System) InitNooBaaClient

func (s *System) InitNooBaaClient() error

InitNooBaaClient initializes the noobaa client for making calls to the server.

func (*System) Load

func (s *System) Load()

Load reads the state of the kubernetes objects of the system

func (*System) Own

func (s *System) Own(obj metav1.Object)

Own sets the object owner references to the noobaa system

func (*System) Reconcile

func (s *System) Reconcile() (reconcile.Result, error)

Reconcile reads that state of the cluster for a System object, and makes changes based on the state read and what is in the System.Spec. The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

func (*System) ReconcileObject

func (s *System) ReconcileObject(obj runtime.Object, desiredFunc func()) error

ReconcileObject is a generic call to reconcile a kubernetes object desiredFunc can be passed to modify the object before create/update. Currently we ignore enforcing a desired state, but it might be needed on upgrades.

func (*System) ReconcileSecretAdmin

func (s *System) ReconcileSecretAdmin() error

ReconcileSecretAdmin creates the admin secret

func (*System) ReconcileSecretOp

func (s *System) ReconcileSecretOp() error

ReconcileSecretOp creates a new system in the noobaa server if not created yet.

func (*System) ReconcileSecretServer

func (s *System) ReconcileSecretServer() error

ReconcileSecretServer creates a secret needed for the server pod

func (*System) ReconcileSystem

func (s *System) ReconcileSystem() error

ReconcileSystem runs the reconcile flow and populates System.Status.

func (*System) SetDesiredCoreApp

func (s *System) SetDesiredCoreApp()

SetDesiredCoreApp updates the CoreApp as desired for reconciling

func (*System) SetDesiredServiceMgmt

func (s *System) SetDesiredServiceMgmt()

SetDesiredServiceMgmt updates the ServiceMgmt as desired for reconciling

func (*System) SetDesiredServiceS3

func (s *System) SetDesiredServiceS3()

SetDesiredServiceS3 updates the ServiceS3 as desired for reconciling

func (*System) SetPhase added in v1.0.1

func (s *System) SetPhase(phase nbv1.SystemPhase)

SetPhase updates the status phase and conditions

func (*System) UpdateSystemStatus

func (s *System) UpdateSystemStatus() error

UpdateSystemStatus updates the system status in kubernetes from the memory

Jump to

Keyboard shortcuts

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