Documentation ¶
Index ¶
- func CreateList(prefix string, helper storage.Interface, list runtime.Object) error
- func CreateObjList(prefix string, helper storage.Interface, items []runtime.Object) error
- func DeepEqualSafePodSpec() example.PodSpec
- func ExpectContains(t *testing.T, msg string, expectedList []interface{}, got interface{})
- func RunOptionalTestProgressNotify(ctx context.Context, t *testing.T, store storage.Interface)
- func RunSendInitialEventsBackwardCompatibility(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestClusterScopedWatch(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestConditionalDelete(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestConsistentList(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestCount(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestCreate(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestCreateWithKeyExist(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestCreateWithTTL(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestDelayedWatchDelivery(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestDeleteTriggerWatch(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestDeleteWithConflict(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestDeleteWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestDeleteWithSuggestionAndConflict(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestDeleteWithSuggestionOfDeletedObject(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestGet(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestGetListNonRecursive(ctx context.Context, t *testing.T, compaction Compaction, ...)
- func RunTestGetListRecursivePrefix(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestGuaranteedUpdate(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer, ...)
- func RunTestGuaranteedUpdateChecksStoredData(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
- func RunTestGuaranteedUpdateWithConflict(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestGuaranteedUpdateWithSuggestionAndConflict(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestGuaranteedUpdateWithTTL(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestList(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestListContinuation(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestListContinuationWithFilter(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestListInconsistentContinuation(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestListPaginationRareObject(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestListResourceVersionMatch(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
- func RunTestNamespaceScopedWatch(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestOptionalWatchBookmarksWithCorrectResourceVersion(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestPreconditionalDeleteWithOnlySuggestionPass(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestPreconditionalDeleteWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestTransformationFailure(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
- func RunTestUnconditionalDelete(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestValidateDeletionWithOnlySuggestionValid(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestValidateDeletionWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestWatch(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestWatchContextCancel(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestWatchDeleteEventObjectHaveLatestRV(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestWatchDispatchBookmarkEvents(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestWatchError(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
- func RunTestWatchFromNonZero(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestWatchFromZero(ctx context.Context, t *testing.T, store storage.Interface, ...)
- func RunTestWatchInitializationSignal(ctx context.Context, t *testing.T, store storage.Interface)
- func RunTestWatcherTimeout(ctx context.Context, t *testing.T, store storage.Interface)
- func RunWatchSemanticInitialEventsExtended(ctx context.Context, t *testing.T, store storage.Interface)
- func RunWatchSemantics(ctx context.Context, t *testing.T, store storage.Interface)
- type CallsValidation
- type Compaction
- type InterfaceWithPrefixTransformer
- type KeyValidation
- type PrefixTransformer
- func (p *PrefixTransformer) GetReadsAndReset() uint64
- func (p *PrefixTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error)
- func (p *PrefixTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error)
- type PrefixTransformerModifier
- type StorageInjectingListErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateList ¶
CreateList will properly create a list using the storage interface.
func CreateObjList ¶
CreateObjList will create a list from the array of objects.
func DeepEqualSafePodSpec ¶ added in v0.16.4
DeepEqualSafePodSpec returns an example.PodSpec safe for deep-equal operations.
func ExpectContains ¶ added in v0.26.0
func RunOptionalTestProgressNotify ¶ added in v0.26.0
RunOptionalTestProgressNotify tests ProgressNotify feature of ListOptions. Given this feature is currently not explicitly used by higher layers of Kubernetes (it rather is used by wrappers of storage.Interface to implement its functionalities) this test is currently considered optional.
func RunSendInitialEventsBackwardCompatibility ¶ added in v0.28.0
func RunSendInitialEventsBackwardCompatibility(ctx context.Context, t *testing.T, store storage.Interface)
RunSendInitialEventsBackwardCompatibility test backward compatibility when SendInitialEvents option is set against various implementations. Backward compatibility is defined as RV = "" || RV = "O" and AllowWatchBookmark is set to false. In that case we expect a watch request to be established.
func RunTestClusterScopedWatch ¶ added in v0.28.0
It tests watches of cluster-scoped resources.
func RunTestConditionalDelete ¶ added in v0.25.0
func RunTestConsistentList ¶ added in v0.26.0
func RunTestCount ¶ added in v0.25.0
func RunTestCreate ¶ added in v0.25.0
func RunTestCreateWithKeyExist ¶ added in v0.25.0
func RunTestCreateWithTTL ¶ added in v0.25.0
func RunTestDelayedWatchDelivery ¶ added in v0.28.0
func RunTestDeleteTriggerWatch ¶ added in v0.25.0
func RunTestDeleteWithConflict ¶ added in v0.29.0
RunTestDeleteWithConflict tests the case when another conflicting update happened before the delete completed.
func RunTestDeleteWithSuggestion ¶ added in v0.25.0
func RunTestDeleteWithSuggestionAndConflict ¶ added in v0.25.0
func RunTestDeleteWithSuggestionOfDeletedObject ¶ added in v0.25.0
func RunTestGet ¶ added in v0.25.0
func RunTestGetListNonRecursive ¶ added in v0.25.0
func RunTestGetListRecursivePrefix ¶ added in v0.31.0
RunTestGetListRecursivePrefix tests how recursive parameter works for object keys that are prefixes of each other.
func RunTestGuaranteedUpdate ¶ added in v0.26.0
func RunTestGuaranteedUpdate(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer, validation KeyValidation)
func RunTestGuaranteedUpdateChecksStoredData ¶ added in v0.26.0
func RunTestGuaranteedUpdateChecksStoredData(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
func RunTestGuaranteedUpdateWithConflict ¶ added in v0.25.0
func RunTestGuaranteedUpdateWithSuggestionAndConflict ¶ added in v0.25.0
func RunTestGuaranteedUpdateWithTTL ¶ added in v0.25.0
func RunTestList ¶ added in v0.25.0
func RunTestListContinuation ¶ added in v0.26.0
func RunTestListContinuationWithFilter ¶ added in v0.26.0
func RunTestListInconsistentContinuation ¶ added in v0.26.0
func RunTestListPaginationRareObject ¶ added in v0.26.0
func RunTestListResourceVersionMatch ¶ added in v0.30.0
func RunTestListResourceVersionMatch(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
func RunTestNamespaceScopedWatch ¶ added in v0.28.0
It tests watch of namespace-scoped resources.
func RunTestOptionalWatchBookmarksWithCorrectResourceVersion ¶ added in v0.28.0
func RunTestOptionalWatchBookmarksWithCorrectResourceVersion(ctx context.Context, t *testing.T, store storage.Interface)
RunOptionalTestWatchBookmarksWithCorrectResourceVersion tests whether bookmark events are sent with correct resource versions. This feature is currently implemented in watch cache layer, so this is optional.
TODO(#109831): ProgressNotify feature is effectively implementing the same
functionality, so we should refactor this functionality to share the same input.
func RunTestPreconditionalDeleteWithOnlySuggestionPass ¶ added in v0.29.0
func RunTestPreconditionalDeleteWithOnlySuggestionPass(ctx context.Context, t *testing.T, store storage.Interface)
RunTestPreconditionalDeleteWithOnlySuggestionPass tests the case of delete with preconditions, when the suggested cachedExistingObject passes the preconditions while the current version does not pass the preconditions.
func RunTestPreconditionalDeleteWithSuggestion ¶ added in v0.25.0
func RunTestTransformationFailure ¶ added in v0.26.0
func RunTestTransformationFailure(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
func RunTestUnconditionalDelete ¶ added in v0.25.0
func RunTestValidateDeletionWithOnlySuggestionValid ¶ added in v0.29.0
func RunTestValidateDeletionWithOnlySuggestionValid(ctx context.Context, t *testing.T, store storage.Interface)
RunTestValidateDeletionWithOnlySuggestionValid tests the case of delete with validateDeletion function, when the suggested cachedExistingObject passes the validate function while the current version does not pass the validate function.
func RunTestValidateDeletionWithSuggestion ¶ added in v0.25.0
func RunTestWatch ¶ added in v0.25.0
func RunTestWatchContextCancel ¶ added in v0.25.0
func RunTestWatchDeleteEventObjectHaveLatestRV ¶ added in v0.26.0
func RunTestWatchDispatchBookmarkEvents ¶ added in v0.28.0
func RunTestWatchDispatchBookmarkEvents(ctx context.Context, t *testing.T, store storage.Interface, expectedWatchBookmarks bool)
RunOptionalTestWatchDispatchBookmarkEvents tests whether bookmark events are sent. This feature is currently implemented in watch cache layer, so this is optional.
TODO(#109831): ProgressNotify feature is effectively implementing the same
functionality, so we should refactor this functionality to share the same input.
func RunTestWatchError ¶ added in v0.26.0
func RunTestWatchError(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)
func RunTestWatchFromNonZero ¶ added in v0.28.0
func RunTestWatchFromZero ¶ added in v0.26.0
func RunTestWatchFromZero(ctx context.Context, t *testing.T, store storage.Interface, compaction Compaction)
RunTestWatchFromZero tests that
- watch from 0 should sync up and grab the object added before
- For testing with etcd, watch from 0 is able to return events for objects whose previous version has been compacted. If testing with cacher, we expect compaction to be nil.
func RunTestWatchInitializationSignal ¶ added in v0.25.0
func RunTestWatcherTimeout ¶ added in v0.28.0
func RunWatchSemanticInitialEventsExtended ¶ added in v0.29.0
func RunWatchSemanticInitialEventsExtended(ctx context.Context, t *testing.T, store storage.Interface)
RunWatchSemanticInitialEventsExtended checks if the bookmark event marking the end of the list stream contains the global RV.
note that this scenario differs from the one in RunWatchSemantics by adding the pod to a different ns to advance the global RV
func RunWatchSemantics ¶ added in v0.29.0
RunWatchSemantics test the following cases:
+-----------------+---------------------+-------------------+ | ResourceVersion | AllowWatchBookmarks | SendInitialEvents | +=================+=====================+===================+ | Unset | true/false | true/false | | 0 | true/false | true/false | | 1 | true/false | true/false | | Current | true/false | true/false | +-----------------+---------------------+-------------------+ where: - false indicates the value of the param was set to "false" by a test case - true indicates the value of the param was set to "true" by a test case
Types ¶
type CallsValidation ¶ added in v0.26.0
type Compaction ¶ added in v0.26.0
type InterfaceWithPrefixTransformer ¶ added in v0.26.0
type InterfaceWithPrefixTransformer interface { storage.Interface UpdatePrefixTransformer(PrefixTransformerModifier) func() }
type KeyValidation ¶ added in v0.25.0
type PrefixTransformer ¶ added in v0.26.0
type PrefixTransformer struct {
// contains filtered or unexported fields
}
PrefixTransformer adds and verifies that all data has the correct prefix on its way in and out.
func NewPrefixTransformer ¶ added in v0.26.0
func NewPrefixTransformer(prefix []byte, stale bool) *PrefixTransformer
func (*PrefixTransformer) GetReadsAndReset ¶ added in v0.26.0
func (p *PrefixTransformer) GetReadsAndReset() uint64
func (*PrefixTransformer) TransformFromStorage ¶ added in v0.26.0
func (*PrefixTransformer) TransformToStorage ¶ added in v0.26.0
type PrefixTransformerModifier ¶ added in v0.26.0
type PrefixTransformerModifier func(*PrefixTransformer) value.Transformer
type StorageInjectingListErrors ¶ added in v0.27.0
type StorageInjectingListErrors struct { storage.Interface Errors int // contains filtered or unexported fields }
StorageInjectingListErrors injects a dummy error for first N GetList calls.
func (*StorageInjectingListErrors) ErrorsConsumed ¶ added in v0.27.0
func (s *StorageInjectingListErrors) ErrorsConsumed() (bool, error)