internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// lastDeployedReleaseVersion is the version annotation put into Cluster CR to
	// define which Giant Swarm release version was last successfully deployed
	// during cluster creation or upgrade. Versions are defined as semver version
	// without the "v" prefix, e.g. 14.1.0, which means that cluster was created
	// with or upgraded to Giant Swarm release v14.1.0.
	LastDeployedReleaseVersion = "release.giantswarm.io/last-deployed-version"

	// UpgradingToNodePools is set to True during the first cluster upgrade to node pools release.
	UpgradingToNodePools = "release.giantswarm.io/upgrading-to-node-pools"
)

Variables

View Source
var (

	// AddMockToScheme is used by the generated client.
	AddMockToScheme = schemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   group,
	Version: version,
}

SchemeGroupVersion is group version used to register these objects

Functions

func AreEqualWithIgnoringLastTransitionTime added in v0.1.2

func AreEqualWithIgnoringLastTransitionTime(c1, c2 *capi.Condition) bool

AreEqualWithIgnoringLastTransitionTime is checking if two conditions are have all fields equal, except LastTransitionTime.

func EnsureCRExist

func EnsureCRExist(ctx context.Context, t *testing.T, client ctrl.Client, manifestPath string) error

func GetTestedCluster

func GetTestedCluster(ctx context.Context, t *testing.T, client ctrl.Client, manifestPath string) (*capi.Cluster, error)

func ListMachinePoolsByClusterID

func ListMachinePoolsByClusterID(ctx context.Context, c client.Client, clusterNamespace, clusterID string) (*capiexp.MachinePoolList, error)

func ListMachinePoolsByMetadata

func ListMachinePoolsByMetadata(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*capiexp.MachinePoolList, error)

func LoadCR

func LoadCR(manifestPath string) (ctrl.Object, error)

func NewFakeClient

func NewFakeClient(addToSchemeFuncs ...func(s *runtime.Scheme) error) ctrl.Client

func SprintComparedCondition

func SprintComparedCondition(condition *capi.Condition) string

Types

type Handler

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

func NewHandler

func NewHandler(config HandlerConfig) (*Handler, error)

func (*Handler) EnsureCreated

func (h *Handler) EnsureCreated(ctx context.Context, object conditions.Object) (err error)

func (*Handler) EnsureDeleted

func (h *Handler) EnsureDeleted(_ context.Context, _ conditions.Object) (err error)

type HandlerConfig

type HandlerConfig struct {
	CtrlClient ctrl.Client
	Logger     micrologger.Logger

	UpdateStatus      bool
	ConditionType     capi.ConditionType
	EnsureCreatedFunc func(ctx context.Context, object conditions.Object) error
	EnsureDeletedFunc func(ctx context.Context, object conditions.Object) error
}

type MockProviderCluster

type MockProviderCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MockProviderClusterSpec   `json:"spec,omitempty"`
	Status MockProviderClusterStatus `json:"status,omitempty"`
}

MockProviderCluster is the Schema for the mockproviderclusters API

func (*MockProviderCluster) DeepCopyInto

func (c *MockProviderCluster) DeepCopyInto(out *MockProviderCluster)

func (*MockProviderCluster) DeepCopyObject

func (c *MockProviderCluster) DeepCopyObject() runtime.Object

func (*MockProviderCluster) GetConditions

func (c *MockProviderCluster) GetConditions() capi.Conditions

GetConditions returns the list of conditions for an MockProviderCluster API object.

func (*MockProviderCluster) GetObjectKind

func (c *MockProviderCluster) GetObjectKind() schema.ObjectKind

func (*MockProviderCluster) GroupVersionKind

func (c *MockProviderCluster) GroupVersionKind() schema.GroupVersionKind

func (*MockProviderCluster) SetConditions

func (c *MockProviderCluster) SetConditions(conditions capi.Conditions)

SetConditions will set the given conditions on an MockProviderCluster object

type MockProviderClusterList

type MockProviderClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []MockProviderCluster `json:"items"`
}

func (*MockProviderClusterList) DeepCopyObject

func (c *MockProviderClusterList) DeepCopyObject() runtime.Object

func (*MockProviderClusterList) GetObjectKind

func (c *MockProviderClusterList) GetObjectKind() schema.ObjectKind

func (*MockProviderClusterList) GroupVersionKind

func (c *MockProviderClusterList) GroupVersionKind() schema.GroupVersionKind

type MockProviderClusterSpec

type MockProviderClusterSpec struct{}

MockProviderClusterSpec defines the desired state of MockProviderCluster

type MockProviderClusterStatus

type MockProviderClusterStatus struct {
	Conditions capi.Conditions `json:"conditions,omitempty"`
}

MockProviderClusterStatus defines the observed state of MockProviderCluster

Jump to

Keyboard shortcuts

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