Documentation
¶
Index ¶
- Variables
- func CheckGroveError(t *testing.T, expectedError *groveerr.GroveError, actualErr error)
- func CreateDefaultFakeClient(existingObjects []client.Object) client.Client
- func CreateFakeClientForObjects(getErr, createErr, patchErr, deleteErr *apierrors.StatusError, ...)
- func CreateFakeClientForObjectsMatchingLabels(deleteErr, listErr *apierrors.StatusError, namespace string, ...) client.Client
- func SetupFakeClient(objects ...client.Object) client.WithWatch
- type ClientMethod
- type FakeManager
- type PCLQOption
- func WithPCLQAvailable() PCLQOption
- func WithPCLQCurrentPCSGenerationHash(pcsGenerationHash string) PCLQOption
- func WithPCLQMinAvailableBreached() PCLQOption
- func WithPCLQNoConditions() PCLQOption
- func WithPCLQNotScheduled() PCLQOption
- func WithPCLQReplicaReadyStatus(ready int32) PCLQOption
- func WithPCLQScheduledAndAvailable() PCLQOption
- func WithPCLQScheduledButBreached() PCLQOption
- func WithPCLQTerminating() PCLQOption
- type PCSGOption
- type PCSOption
- type PodBuilder
- func (b *PodBuilder) Build() *corev1.Pod
- func (b *PodBuilder) MarkForTermination() *PodBuilder
- func (b *PodBuilder) WithCondition(cond corev1.PodCondition) *PodBuilder
- func (b *PodBuilder) WithLabels(labels map[string]string) *PodBuilder
- func (b *PodBuilder) WithOwner(ownerName string) *PodBuilder
- func (b *PodBuilder) WithPhase(phase corev1.PodPhase) *PodBuilder
- type PodCliqueBuilder
- func (b *PodCliqueBuilder) Build() *grovecorev1alpha1.PodClique
- func (b *PodCliqueBuilder) WithAutoScaleMaxReplicas(maximum int32) *PodCliqueBuilder
- func (b *PodCliqueBuilder) WithLabels(labels map[string]string) *PodCliqueBuilder
- func (b *PodCliqueBuilder) WithOptions(opts ...PCLQOption) *PodCliqueBuilder
- func (b *PodCliqueBuilder) WithOwnerReference(kind, name string, uid types.UID) *PodCliqueBuilder
- func (b *PodCliqueBuilder) WithReplicas(replicas int32) *PodCliqueBuilder
- func (b *PodCliqueBuilder) WithStartsAfter(pclqTemplateNames []string) *PodCliqueBuilder
- type PodCliqueScalingGroupBuilder
- func (b *PodCliqueScalingGroupBuilder) Build() *grovecorev1alpha1.PodCliqueScalingGroup
- func (b *PodCliqueScalingGroupBuilder) WithCliqueNames(cliqueNames []string) *PodCliqueScalingGroupBuilder
- func (b *PodCliqueScalingGroupBuilder) WithLabels(labels map[string]string) *PodCliqueScalingGroupBuilder
- func (b *PodCliqueScalingGroupBuilder) WithMinAvailable(minAvailable int32) *PodCliqueScalingGroupBuilder
- func (b *PodCliqueScalingGroupBuilder) WithOptions(opts ...PCSGOption) *PodCliqueScalingGroupBuilder
- func (b *PodCliqueScalingGroupBuilder) WithOwnerReference(kind, name, uid string) *PodCliqueScalingGroupBuilder
- func (b *PodCliqueScalingGroupBuilder) WithReplicas(replicas int32) *PodCliqueScalingGroupBuilder
- type PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) Build() *grovecorev1alpha1.PodCliqueSet
- func (b *PodCliqueSetBuilder) WithCliqueStartupType(startupType *grovecorev1alpha1.CliqueStartupType) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithPodCliqueParameters(name string, replicas int32, startsAfter []string) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithPodCliqueScalingGroupConfig(config grovecorev1alpha1.PodCliqueScalingGroupConfig) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithPodCliqueSetGenerationHash(pcsGenerationHash *string) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithPodCliqueTemplateSpec(pclq *grovecorev1alpha1.PodCliqueTemplateSpec) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithPriorityClassName(priorityClassName string) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithReplicas(replicas int32) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithScalingGroup(name string, cliqueNames []string) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithScalingGroupConfig(name string, cliqueNames []string, replicas, minAvailable int32) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithStandaloneClique(name string) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithStandaloneCliqueReplicas(name string, replicas int32) *PodCliqueSetBuilder
- func (b *PodCliqueSetBuilder) WithTerminationDelay(duration time.Duration) *PodCliqueSetBuilder
- type PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) Build() *grovecorev1alpha1.PodCliqueTemplateSpec
- func (b *PodCliqueTemplateSpecBuilder) WithAutoScaleMaxReplicas(maximum int32) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithAutoScaleMinReplicas(minimum int32) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithLabels(labels map[string]string) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithMinAvailable(minAvailable int32) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithPodSpec(podSpec corev1.PodSpec) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithReplicas(replicas int32) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithRoleName(roleName string) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithScaleConfig(minReplicas *int32, maxReplicas int32) *PodCliqueTemplateSpecBuilder
- func (b *PodCliqueTemplateSpecBuilder) WithStartsAfter(startsAfter []string) *PodCliqueTemplateSpecBuilder
- type TestClientBuilder
- func (b *TestClientBuilder) Build() client.Client
- func (b *TestClientBuilder) RecordErrorForObjects(method ClientMethod, err *apierrors.StatusError, ...) *TestClientBuilder
- func (b *TestClientBuilder) RecordErrorForObjectsMatchingLabels(method ClientMethod, objectKey client.ObjectKey, ...) *TestClientBuilder
- func (b *TestClientBuilder) WithClient(cl client.Client) *TestClientBuilder
- func (b *TestClientBuilder) WithObjects(objects ...client.Object) *TestClientBuilder
Constants ¶
This section is empty.
Variables ¶
var ( // TestAPIInternalErr is an API internal server error meant to be used to mimic HTTP response code 500 for tests. TestAPIInternalErr = apierrors.NewInternalError(errors.New("fake internal error")) )
Functions ¶
func CheckGroveError ¶
func CheckGroveError(t *testing.T, expectedError *groveerr.GroveError, actualErr error)
CheckGroveError checks that an actual error is a Grove error and further checks its underline cause, error code and operation.
func CreateDefaultFakeClient ¶
CreateDefaultFakeClient creates a default client.Client without any configured reactions to errors.
func CreateFakeClientForObjects ¶
func CreateFakeClientForObjects(getErr, createErr, patchErr, deleteErr *apierrors.StatusError, existingObjects []client.Object)
CreateFakeClientForObjects creates a fake client.Client with initial set of existing objects along with any expected errors for the Get, Create, Patch, and Delete client methods.
func CreateFakeClientForObjectsMatchingLabels ¶
func CreateFakeClientForObjectsMatchingLabels(deleteErr, listErr *apierrors.StatusError, namespace string, targetObjectsGVK schema.GroupVersionKind, matchingLabels map[string]string, existingObjects ...client.Object) client.Client
CreateFakeClientForObjectsMatchingLabels creates a fake client.Client with initial set of existing objects along with any expected list and/or deleteAll errors for objects matching the given matching labels for the given GVK. If the matchingLabels is nil or empty then the deleteAll/list error will be recorded for all objects matching the GVK in the given namespace.
Types ¶
type ClientMethod ¶
type ClientMethod string
ClientMethod is a name of the method on client.Client for which an error is recorded.
const ( // ClientMethodGet is the name of the Get method on client.Client. ClientMethodGet ClientMethod = "Get" // ClientMethodList is the name of the List method on client.Client. ClientMethodList ClientMethod = "List" // ClientMethodCreate is the name of the Create method on client.Client. ClientMethodCreate ClientMethod = "Create" // ClientMethodDelete is the name of the Delete method on client.Client. ClientMethodDelete ClientMethod = "Delete" // ClientMethodDeleteAll is the name of the DeleteAllOf method on client.Client. ClientMethodDeleteAll ClientMethod = "DeleteAll" // ClientMethodPatch is the name of the Patch method on client.Client. ClientMethodPatch ClientMethod = "Patch" // ClientMethodUpdate is the name of the Update method on client.Client. ClientMethodUpdate ClientMethod = "Update" // ClientMethodStatus is the name of the Status method on client.Client.StatusClient. ClientMethodStatus ClientMethod = "Status" )
type FakeManager ¶
type FakeManager struct {
manager.Manager
Client client.Client
Scheme *runtime.Scheme
Logger logr.Logger
}
FakeManager is a fake controller-runtime manager
func (*FakeManager) GetClient ¶
func (f *FakeManager) GetClient() client.Client
GetClient returns the client registered with the fake manager
func (*FakeManager) GetLogger ¶
func (f *FakeManager) GetLogger() logr.Logger
GetLogger returns the logger registered with the fake manager
func (FakeManager) GetScheme ¶
func (f FakeManager) GetScheme() *runtime.Scheme
GetScheme returns the scheme registered with the fake manager
type PCLQOption ¶
type PCLQOption func(*grovecorev1alpha1.PodClique)
PCLQOption is a function that modifies a PodClique for testing.
func WithPCLQAvailable ¶
func WithPCLQAvailable() PCLQOption
WithPCLQAvailable sets the PodClique to a healthy state with MinAvailableBreached=False and PodCliqueScheduled=True.
func WithPCLQCurrentPCSGenerationHash ¶
func WithPCLQCurrentPCSGenerationHash(pcsGenerationHash string) PCLQOption
WithPCLQCurrentPCSGenerationHash sets the CurrentPodCliqueSetGenerationHash in the PodClique status.
func WithPCLQMinAvailableBreached ¶
func WithPCLQMinAvailableBreached() PCLQOption
WithPCLQMinAvailableBreached sets the PodClique to have MinAvailableBreached=True but scheduled.
func WithPCLQNoConditions ¶
func WithPCLQNoConditions() PCLQOption
WithPCLQNoConditions removes all conditions from the PodClique status.
func WithPCLQNotScheduled ¶
func WithPCLQNotScheduled() PCLQOption
WithPCLQNotScheduled sets the PodClique to be not scheduled.
func WithPCLQReplicaReadyStatus ¶
func WithPCLQReplicaReadyStatus(ready int32) PCLQOption
WithPCLQReplicaReadyStatus sets specific ReadyReplicas count for PodClique without touching conditions.
func WithPCLQScheduledAndAvailable ¶
func WithPCLQScheduledAndAvailable() PCLQOption
WithPCLQScheduledAndAvailable sets the PodClique to be both scheduled and available.
func WithPCLQScheduledButBreached ¶
func WithPCLQScheduledButBreached() PCLQOption
WithPCLQScheduledButBreached sets the PodClique to be scheduled but with breached availability.
func WithPCLQTerminating ¶
func WithPCLQTerminating() PCLQOption
WithPCLQTerminating marks the PodClique for termination with a DeletionTimestamp.
type PCSGOption ¶
type PCSGOption func(*grovecorev1alpha1.PodCliqueScalingGroup)
PCSGOption is a function that modifies a PodCliqueScalingGroup for testing.
func WithPCSGAvailableReplicas ¶
func WithPCSGAvailableReplicas(available int32) PCSGOption
WithPCSGAvailableReplicas sets specific AvailableReplicas count for PCSG without touching conditions.
func WithPCSGCurrentPCSGenerationHash ¶
func WithPCSGCurrentPCSGenerationHash(pcsGenerationHash string) PCSGOption
WithPCSGCurrentPCSGenerationHash sets the CurrentPodCliqueSetGenerationHash in the PCSG status.
func WithPCSGMinAvailableBreached ¶
func WithPCSGMinAvailableBreached() PCSGOption
WithPCSGMinAvailableBreached sets the PCSG to have MinAvailableBreached=True.
func WithPCSGObservedGeneration ¶
func WithPCSGObservedGeneration(generation int64) PCSGOption
WithPCSGObservedGeneration sets the PCSG ObservedGeneration to enable status mutations.
func WithPCSGUnknownCondition ¶
func WithPCSGUnknownCondition() PCSGOption
WithPCSGUnknownCondition sets the PCSG to have MinAvailableBreached=Unknown.
type PCSOption ¶
type PCSOption func(*grovecorev1alpha1.PodCliqueSet)
PCSOption is a function that modifies a PodCliqueSet for testing.
type PodBuilder ¶
type PodBuilder struct {
// contains filtered or unexported fields
}
PodBuilder is a builder for Pod objects.
func NewPodBuilder ¶
func NewPodBuilder(name, namespace string) *PodBuilder
NewPodBuilder creates a new PodBuilder with the given name and namespace.
func NewPodWithBuilderWithDefaultSpec ¶
func NewPodWithBuilderWithDefaultSpec(name, namespace string) *PodBuilder
NewPodWithBuilderWithDefaultSpec creates a new PodBuilder with a default spec.
func (*PodBuilder) Build ¶
func (b *PodBuilder) Build() *corev1.Pod
Build builds and returns the Pod.
func (*PodBuilder) MarkForTermination ¶
func (b *PodBuilder) MarkForTermination() *PodBuilder
MarkForTermination sets the DeletionTimestamp on the Pod.
func (*PodBuilder) WithCondition ¶
func (b *PodBuilder) WithCondition(cond corev1.PodCondition) *PodBuilder
WithCondition adds a condition to the Pod's status.
func (*PodBuilder) WithLabels ¶
func (b *PodBuilder) WithLabels(labels map[string]string) *PodBuilder
WithLabels adds labels to the Pod.
func (*PodBuilder) WithOwner ¶
func (b *PodBuilder) WithOwner(ownerName string) *PodBuilder
WithOwner adds an owner reference to the Pod.
func (*PodBuilder) WithPhase ¶
func (b *PodBuilder) WithPhase(phase corev1.PodPhase) *PodBuilder
WithPhase adds a pod phase to the Pod's status.
type PodCliqueBuilder ¶
type PodCliqueBuilder struct {
// contains filtered or unexported fields
}
PodCliqueBuilder is a builder for creating PodClique objects. This should primarily be used for tests.
func NewPCSGPodCliqueBuilder ¶
func NewPCSGPodCliqueBuilder(name, namespace, pcsName, pcsgName string, pcsReplicaIndex, pcsgReplicaIndex int) *PodCliqueBuilder
NewPCSGPodCliqueBuilder creates a PodClique that belongs to a PodCliqueScalingGroup.
func NewPodCliqueBuilder ¶
func NewPodCliqueBuilder(pcsName string, pcsUID types.UID, pclqTemplateName, namespace string, pcsReplicaIndex int32) *PodCliqueBuilder
NewPodCliqueBuilder creates a new PodCliqueBuilder.
func (*PodCliqueBuilder) Build ¶
func (b *PodCliqueBuilder) Build() *grovecorev1alpha1.PodClique
Build creates a PodClique object.
func (*PodCliqueBuilder) WithAutoScaleMaxReplicas ¶
func (b *PodCliqueBuilder) WithAutoScaleMaxReplicas(maximum int32) *PodCliqueBuilder
WithAutoScaleMaxReplicas sets the maximum replicas in ScaleConfig for the PodClique.
func (*PodCliqueBuilder) WithLabels ¶
func (b *PodCliqueBuilder) WithLabels(labels map[string]string) *PodCliqueBuilder
WithLabels merges the passed labels with default labels. Passed in labels will overwrite default labels with the same keys.
func (*PodCliqueBuilder) WithOptions ¶
func (b *PodCliqueBuilder) WithOptions(opts ...PCLQOption) *PodCliqueBuilder
WithOptions applies option functions to customize the PodClique.
func (*PodCliqueBuilder) WithOwnerReference ¶
func (b *PodCliqueBuilder) WithOwnerReference(kind, name string, uid types.UID) *PodCliqueBuilder
WithOwnerReference sets the owner reference for the PodClique from individual values.
func (*PodCliqueBuilder) WithReplicas ¶
func (b *PodCliqueBuilder) WithReplicas(replicas int32) *PodCliqueBuilder
WithReplicas sets the number of replicas for the PodClique. Default is set to 1.
func (*PodCliqueBuilder) WithStartsAfter ¶
func (b *PodCliqueBuilder) WithStartsAfter(pclqTemplateNames []string) *PodCliqueBuilder
WithStartsAfter sets the StartsAfter field for the PodClique.
type PodCliqueScalingGroupBuilder ¶
type PodCliqueScalingGroupBuilder struct {
// contains filtered or unexported fields
}
PodCliqueScalingGroupBuilder provides a fluent interface for building test PodCliqueScalingGroup objects.
func NewPodCliqueScalingGroupBuilder ¶
func NewPodCliqueScalingGroupBuilder(name, namespace, pcsName string, pcsReplicaIndex int) *PodCliqueScalingGroupBuilder
NewPodCliqueScalingGroupBuilder creates a new PodCliqueScalingGroupBuilder with basic configuration.
func (*PodCliqueScalingGroupBuilder) Build ¶
func (b *PodCliqueScalingGroupBuilder) Build() *grovecorev1alpha1.PodCliqueScalingGroup
Build returns the constructed PodCliqueScalingGroup.
func (*PodCliqueScalingGroupBuilder) WithCliqueNames ¶
func (b *PodCliqueScalingGroupBuilder) WithCliqueNames(cliqueNames []string) *PodCliqueScalingGroupBuilder
WithCliqueNames sets the CliqueNames field for the PodCliqueScalingGroup.
func (*PodCliqueScalingGroupBuilder) WithLabels ¶
func (b *PodCliqueScalingGroupBuilder) WithLabels(labels map[string]string) *PodCliqueScalingGroupBuilder
WithLabels adds labels to the PodCliqueScalingGroup.
func (*PodCliqueScalingGroupBuilder) WithMinAvailable ¶
func (b *PodCliqueScalingGroupBuilder) WithMinAvailable(minAvailable int32) *PodCliqueScalingGroupBuilder
WithMinAvailable sets the MinAvailable field for the PodCliqueScalingGroup.
func (*PodCliqueScalingGroupBuilder) WithOptions ¶
func (b *PodCliqueScalingGroupBuilder) WithOptions(opts ...PCSGOption) *PodCliqueScalingGroupBuilder
WithOptions applies option functions to customize the PodCliqueScalingGroup.
func (*PodCliqueScalingGroupBuilder) WithOwnerReference ¶
func (b *PodCliqueScalingGroupBuilder) WithOwnerReference(kind, name, uid string) *PodCliqueScalingGroupBuilder
WithOwnerReference adds an owner reference to the PodCliqueScalingGroup.
func (*PodCliqueScalingGroupBuilder) WithReplicas ¶
func (b *PodCliqueScalingGroupBuilder) WithReplicas(replicas int32) *PodCliqueScalingGroupBuilder
WithReplicas sets the number of replicas for the PodCliqueScalingGroup.
type PodCliqueSetBuilder ¶
type PodCliqueSetBuilder struct {
// contains filtered or unexported fields
}
PodCliqueSetBuilder is a builder for PodCliqueSet objects.
func NewPodCliqueSetBuilder ¶
func NewPodCliqueSetBuilder(name, namespace string, uid types.UID) *PodCliqueSetBuilder
NewPodCliqueSetBuilder creates a new PodCliqueSetBuilder.
func (*PodCliqueSetBuilder) Build ¶
func (b *PodCliqueSetBuilder) Build() *grovecorev1alpha1.PodCliqueSet
Build creates a PodCliqueSet object.
func (*PodCliqueSetBuilder) WithCliqueStartupType ¶
func (b *PodCliqueSetBuilder) WithCliqueStartupType(startupType *grovecorev1alpha1.CliqueStartupType) *PodCliqueSetBuilder
WithCliqueStartupType sets the StartupType for the PodCliqueSet.
func (*PodCliqueSetBuilder) WithPodCliqueParameters ¶
func (b *PodCliqueSetBuilder) WithPodCliqueParameters(name string, replicas int32, startsAfter []string) *PodCliqueSetBuilder
WithPodCliqueParameters is a convenience function that creates a PodCliqueTemplateSpec given the parameters and adds it to the PodCliqueSet.
func (*PodCliqueSetBuilder) WithPodCliqueScalingGroupConfig ¶
func (b *PodCliqueSetBuilder) WithPodCliqueScalingGroupConfig(config grovecorev1alpha1.PodCliqueScalingGroupConfig) *PodCliqueSetBuilder
WithPodCliqueScalingGroupConfig adds a PodCliqueScalingGroupConfig to the PodCliqueSet.
func (*PodCliqueSetBuilder) WithPodCliqueSetGenerationHash ¶
func (b *PodCliqueSetBuilder) WithPodCliqueSetGenerationHash(pcsGenerationHash *string) *PodCliqueSetBuilder
WithPodCliqueSetGenerationHash sets the CurrentGenerationHash in the PodCliqueSet status.
func (*PodCliqueSetBuilder) WithPodCliqueTemplateSpec ¶
func (b *PodCliqueSetBuilder) WithPodCliqueTemplateSpec(pclq *grovecorev1alpha1.PodCliqueTemplateSpec) *PodCliqueSetBuilder
WithPodCliqueTemplateSpec sets the PodCliqueTemplateSpec for the PodCliqueSet. Consumers can use PodCliqueBuilder to create a PodCliqueTemplateSpec and then use this method to add it to the PodCliqueSet.
func (*PodCliqueSetBuilder) WithPriorityClassName ¶
func (b *PodCliqueSetBuilder) WithPriorityClassName(priorityClassName string) *PodCliqueSetBuilder
WithPriorityClassName sets the PriorityClassName for the PodCliqueSet.
func (*PodCliqueSetBuilder) WithReplicas ¶
func (b *PodCliqueSetBuilder) WithReplicas(replicas int32) *PodCliqueSetBuilder
WithReplicas sets the number of replicas for the PodCliqueSet.
func (*PodCliqueSetBuilder) WithScalingGroup ¶
func (b *PodCliqueSetBuilder) WithScalingGroup(name string, cliqueNames []string) *PodCliqueSetBuilder
WithScalingGroup adds a scaling group with the specified cliques.
func (*PodCliqueSetBuilder) WithScalingGroupConfig ¶
func (b *PodCliqueSetBuilder) WithScalingGroupConfig(name string, cliqueNames []string, replicas, minAvailable int32) *PodCliqueSetBuilder
WithScalingGroupConfig adds a scaling group with custom replicas and minAvailable.
func (*PodCliqueSetBuilder) WithStandaloneClique ¶
func (b *PodCliqueSetBuilder) WithStandaloneClique(name string) *PodCliqueSetBuilder
WithStandaloneClique adds a standalone clique (not part of any scaling group).
func (*PodCliqueSetBuilder) WithStandaloneCliqueReplicas ¶
func (b *PodCliqueSetBuilder) WithStandaloneCliqueReplicas(name string, replicas int32) *PodCliqueSetBuilder
WithStandaloneCliqueReplicas adds a standalone clique with specific replica count.
func (*PodCliqueSetBuilder) WithTerminationDelay ¶
func (b *PodCliqueSetBuilder) WithTerminationDelay(duration time.Duration) *PodCliqueSetBuilder
WithTerminationDelay sets the TerminationDelay for the PodCliqueSet.
type PodCliqueTemplateSpecBuilder ¶
type PodCliqueTemplateSpecBuilder struct {
// contains filtered or unexported fields
}
PodCliqueTemplateSpecBuilder is a builder for creating PodCliqueTemplateSpec objects.
func NewPodCliqueTemplateSpecBuilder ¶
func NewPodCliqueTemplateSpecBuilder(name string) *PodCliqueTemplateSpecBuilder
NewPodCliqueTemplateSpecBuilder creates a new PodCliqueTemplateSpecBuilder.
func (*PodCliqueTemplateSpecBuilder) Build ¶
func (b *PodCliqueTemplateSpecBuilder) Build() *grovecorev1alpha1.PodCliqueTemplateSpec
Build creates a PodCliqueTemplateSpec object.
func (*PodCliqueTemplateSpecBuilder) WithAutoScaleMaxReplicas ¶
func (b *PodCliqueTemplateSpecBuilder) WithAutoScaleMaxReplicas(maximum int32) *PodCliqueTemplateSpecBuilder
WithAutoScaleMaxReplicas sets the maximum replicas in ScaleConfig for the PodClique.
func (*PodCliqueTemplateSpecBuilder) WithAutoScaleMinReplicas ¶
func (b *PodCliqueTemplateSpecBuilder) WithAutoScaleMinReplicas(minimum int32) *PodCliqueTemplateSpecBuilder
WithAutoScaleMinReplicas sets the minimum replicas in ScaleConfig for the PodClique.
func (*PodCliqueTemplateSpecBuilder) WithLabels ¶
func (b *PodCliqueTemplateSpecBuilder) WithLabels(labels map[string]string) *PodCliqueTemplateSpecBuilder
WithLabels sets the labels for the PodCliqueTemplateSpec.
func (*PodCliqueTemplateSpecBuilder) WithMinAvailable ¶
func (b *PodCliqueTemplateSpecBuilder) WithMinAvailable(minAvailable int32) *PodCliqueTemplateSpecBuilder
WithMinAvailable sets the MinAvailable field for the PodCliqueTemplateSpec.
func (*PodCliqueTemplateSpecBuilder) WithPodSpec ¶
func (b *PodCliqueTemplateSpecBuilder) WithPodSpec(podSpec corev1.PodSpec) *PodCliqueTemplateSpecBuilder
WithPodSpec sets a custom PodSpec for the PodCliqueTemplateSpec.
func (*PodCliqueTemplateSpecBuilder) WithReplicas ¶
func (b *PodCliqueTemplateSpecBuilder) WithReplicas(replicas int32) *PodCliqueTemplateSpecBuilder
WithReplicas sets the number of replicas for the PodCliqueTemplateSpec.
func (*PodCliqueTemplateSpecBuilder) WithRoleName ¶
func (b *PodCliqueTemplateSpecBuilder) WithRoleName(roleName string) *PodCliqueTemplateSpecBuilder
WithRoleName sets the RoleName for the PodCliqueTemplateSpec.
func (*PodCliqueTemplateSpecBuilder) WithScaleConfig ¶
func (b *PodCliqueTemplateSpecBuilder) WithScaleConfig(minReplicas *int32, maxReplicas int32) *PodCliqueTemplateSpecBuilder
WithScaleConfig sets the complete ScaleConfig for the PodCliqueTemplateSpec.
func (*PodCliqueTemplateSpecBuilder) WithStartsAfter ¶
func (b *PodCliqueTemplateSpecBuilder) WithStartsAfter(startsAfter []string) *PodCliqueTemplateSpecBuilder
WithStartsAfter sets the StartsAfter field for the PodCliqueTemplateSpec.
type TestClientBuilder ¶
type TestClientBuilder struct {
// contains filtered or unexported fields
}
TestClientBuilder is a builder for creating a test client.Client which is capable of recording and replaying errors.
func NewTestClientBuilder ¶
func NewTestClientBuilder() *TestClientBuilder
NewTestClientBuilder creates a new TestClientBuilder with a default scheme.
func (*TestClientBuilder) Build ¶
func (b *TestClientBuilder) Build() client.Client
Build creates a test client.Client with the configured reactions to errors.
func (*TestClientBuilder) RecordErrorForObjects ¶
func (b *TestClientBuilder) RecordErrorForObjects(method ClientMethod, err *apierrors.StatusError, objectKeys ...client.ObjectKey) *TestClientBuilder
RecordErrorForObjects records an error for a specific client.Client method and object keys.
func (*TestClientBuilder) RecordErrorForObjectsMatchingLabels ¶
func (b *TestClientBuilder) RecordErrorForObjectsMatchingLabels(method ClientMethod, objectKey client.ObjectKey, targetObjectsGVK schema.GroupVersionKind, matchingLabels map[string]string, err *apierrors.StatusError) *TestClientBuilder
RecordErrorForObjectsMatchingLabels records an error for a specific client.Client method and object keys matching the given labels for a given GVK.
func (*TestClientBuilder) WithClient ¶
func (b *TestClientBuilder) WithClient(cl client.Client) *TestClientBuilder
WithClient sets the delegating client for the TestClientBuilder.
func (*TestClientBuilder) WithObjects ¶
func (b *TestClientBuilder) WithObjects(objects ...client.Object) *TestClientBuilder
WithObjects initializes the delegating fake client builder with objects.