Documentation ¶
Index ¶
- Constants
- Variables
- func CombineErrors(errs ...error) error
- func IsPersistentError(err error) bool
- func SecretResetStringDataFromData(secret *corev1.Secret)
- type PersistentError
- type System
- func (s *System) CheckServiceStatus(srv *corev1.Service, status *nbv1.ServiceStatus, portName string)
- func (s *System) CheckSpecImage() error
- func (s *System) Complete() error
- func (s *System) GetObject(name string, obj runtime.Object) error
- func (s *System) InitNooBaaClient() error
- func (s *System) Load()
- func (s *System) Own(obj metav1.Object)
- func (s *System) Reconcile() (reconcile.Result, error)
- func (s *System) ReconcileObject(obj runtime.Object, desiredFunc func()) error
- func (s *System) ReconcileSecretAdmin() error
- func (s *System) ReconcileSecretOp() error
- func (s *System) ReconcileSecretServer() error
- func (s *System) ReconcileSystem() error
- func (s *System) SetDesiredCoreApp()
- func (s *System) SetDesiredServiceMgmt()
- func (s *System) SetDesiredServiceS3()
- func (s *System) SetPhase(phase nbv1.SystemPhase)
- func (s *System) UpdateSystemStatus() error
Constants ¶
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 ¶
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 ¶
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 ¶
IsPersistentError checks if the provided error is persistent.
func SecretResetStringDataFromData ¶
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 ¶
CheckSpecImage checks the System.Spec.Image property, and sets System.Status.ActualImage
func (*System) InitNooBaaClient ¶
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) Reconcile ¶
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 ¶
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 ¶
ReconcileSecretAdmin creates the admin secret
func (*System) ReconcileSecretOp ¶
ReconcileSecretOp creates a new system in the noobaa server if not created yet.
func (*System) ReconcileSecretServer ¶
ReconcileSecretServer creates a secret needed for the server pod
func (*System) ReconcileSystem ¶
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 ¶
UpdateSystemStatus updates the system status in kubernetes from the memory