status

package
v1.29.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateStatusCondition added in v1.28.0

func UpdateStatusCondition(statuscondition []metav1.Condition, conditions []operator.TigeraStatusCondition) []metav1.Condition

UpdateStatusCondition updates CR's status conditions from tigerastatus conditions.

Types

type MockStatus added in v1.4.0

type MockStatus struct {
	mock.Mock
}

TODO use mockery to generate mock

func (*MockStatus) AddCertificateSigningRequests added in v1.14.0

func (m *MockStatus) AddCertificateSigningRequests(name string, labels map[string]string)

func (*MockStatus) AddCronJobs added in v1.4.0

func (m *MockStatus) AddCronJobs(cjs []types.NamespacedName)

func (*MockStatus) AddDaemonsets added in v1.4.0

func (m *MockStatus) AddDaemonsets(dss []types.NamespacedName)

func (*MockStatus) AddDeployments added in v1.4.0

func (m *MockStatus) AddDeployments(deps []types.NamespacedName)

func (*MockStatus) AddStatefulSets added in v1.4.0

func (m *MockStatus) AddStatefulSets(sss []types.NamespacedName)

func (*MockStatus) ClearDegraded added in v1.4.0

func (m *MockStatus) ClearDegraded()

func (*MockStatus) IsAvailable added in v1.4.0

func (m *MockStatus) IsAvailable() bool

func (*MockStatus) IsDegraded added in v1.4.0

func (m *MockStatus) IsDegraded() bool

func (*MockStatus) IsProgressing added in v1.4.0

func (m *MockStatus) IsProgressing() bool

func (*MockStatus) OnCRFound added in v1.4.0

func (m *MockStatus) OnCRFound()

func (*MockStatus) OnCRNotFound added in v1.4.0

func (m *MockStatus) OnCRNotFound()

func (*MockStatus) ReadyToMonitor added in v1.18.0

func (m *MockStatus) ReadyToMonitor()

func (*MockStatus) RemoveCertificateSigningRequests added in v1.14.0

func (m *MockStatus) RemoveCertificateSigningRequests(label string)

func (*MockStatus) RemoveCronJobs added in v1.4.0

func (m *MockStatus) RemoveCronJobs(cjs ...types.NamespacedName)

func (*MockStatus) RemoveDaemonsets added in v1.4.0

func (m *MockStatus) RemoveDaemonsets(dss ...types.NamespacedName)

func (*MockStatus) RemoveDeployments added in v1.4.0

func (m *MockStatus) RemoveDeployments(dps ...types.NamespacedName)

func (*MockStatus) RemoveStatefulSets added in v1.4.0

func (m *MockStatus) RemoveStatefulSets(sss ...types.NamespacedName)

func (*MockStatus) Run added in v1.4.0

func (m *MockStatus) Run(context.Context)

func (*MockStatus) SetDegraded added in v1.4.0

func (m *MockStatus) SetDegraded(reason operator.TigeraStatusReason, msg string, err error, log logr.Logger)

func (*MockStatus) SetMetaData added in v1.28.0

func (m *MockStatus) SetMetaData(meta *metav1.ObjectMeta)

func (*MockStatus) SetWindowsUpgradeStatus added in v1.23.0

func (m *MockStatus) SetWindowsUpgradeStatus(pending, inProgress, completed []string, err error)

func (*MockStatus) WasCalled added in v1.23.1

func (m *MockStatus) WasCalled(method string, arguments ...interface{}) bool

type StatusManager

type StatusManager interface {
	Run(ctx context.Context)
	OnCRFound()
	OnCRNotFound()
	AddDaemonsets(dss []types.NamespacedName)
	AddDeployments(deps []types.NamespacedName)
	AddStatefulSets(sss []types.NamespacedName)
	AddCronJobs(cjs []types.NamespacedName)
	AddCertificateSigningRequests(name string, labels map[string]string)
	RemoveDaemonsets(dss ...types.NamespacedName)
	RemoveDeployments(dps ...types.NamespacedName)
	RemoveStatefulSets(sss ...types.NamespacedName)
	RemoveCronJobs(cjs ...types.NamespacedName)
	RemoveCertificateSigningRequests(name string)
	SetWindowsUpgradeStatus(pending, inProgress, completed []string, err error)
	SetDegraded(reason operator.TigeraStatusReason, msg string, err error, log logr.Logger)
	ClearDegraded()
	IsAvailable() bool
	IsProgressing() bool
	IsDegraded() bool
	ReadyToMonitor()
	SetMetaData(meta *metav1.ObjectMeta)
}

StatusManager manages the status for a single controller and component, and reports the status via a TigeraStatus API object. The status manager uses the following conditions/states to represent the component's current status:

  • Available: The component is successfully running. All pods launched by the component are healthy. An upgrade may or may not be occurring.
  • Progressing: A state change is occurring. It may be that the component is being installed for the first time, or being upgraded to a new configuration or version.
  • Degraded: The component is not running the desired state and is not progressing towards it. Either the component has not been installed, has been updated with invalid configuration, or has crashed.

Each of these states can be set independently of each other. For example, a component can be both available and degraded if it is running successfully but a configuration change has resulted in a configuration that cannot be actioned.

func New

func New(client client.Client, component string, kubernetesVersion *common.VersionInfo) StatusManager

Jump to

Keyboard shortcuts

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