- Refactor usages to []Unstructured to use UnstructuredSet
- Add UnstructuredSet.Equal to handle set equality comparison
- Avoid updating tests to prove reverse compatibility
(except: Graph.SortObj, which returns a list of sets)
improve the performance
Running InventoryPolicyApplyFilter involves getting every object in the
current inventory from the live cluster, which can be expensive if the
inventory includes lots of objects.
If the inventory policy is `AdoptAll`, the current inventory can take
ownership of any objects. Therefore, it is not necessary to run
InventoryPolicyApplyFilter.
- Refactor usages of []ObjMetadata to use ObjMetadataSet
- Move Union, Diff, Contains, Hash, Remove, and Equal into
ObjMetadataSet
- Add ToStringMap and FromStringMap for inventory serialization
- Add GroupedEventsByID to impliment a custom sort algorithm fo use by
tests, to simplify the comparison of otherwise unsorted
apply/prune/delete events in an action group.
- GroupName can be used to identify which ActionGroupEvent the
Apply/Prune/Delete belongs to. This is useful for tracking progress
during a long apply/destroy.
- Make ResourceCache thread-safe
- Make ResourceCache store status and messagei
- Add ResourceCache to baseRunner and TaskContext
- Make Mutator compute resource status for uncached resources
- Share cache between StatusPoller and Mutator
- Move Condition and conditionMet() to its own file
- Simplify WaitTask.checkCondition
- Simplify baseRunner.amendTimeoutError
- Use stringer for all enums (to translate ids into names)
- Remove redundant effect from reason strings
- Use consistent pattern for variables in reason strings.
We can't use structured json, but this is close, while still human
readable.
- Remove copyright on generated files
- Unstructured() added to ResourceReference to aid test operations
- Test artifacts moved into artifacts_test.go
- deploymentManifest and apiserviceManifest replaced with
yaml->unstructured, for consistency with other test artifacts
- Added withReplicas, withNamespace, and withDependsOn for easier inline
mutation of test artifacts
- Added deleteUnstructuredAndWait, assertUnstructuredExists, and
assertUnstructuredDoesNotExist to validate actual cluster state,
not just events. Also reduced flakiness by waiting for delete.
- Removed error check before event validation. The event diff
provides much more context for debugging.
- Replaced typed resources with unstructured and used
testutil.NestedField to extract values.
- Updated prune error test to use full event list comparison and
validate server state.
- Add 2nd resource to continue on error test
- Don't fail early on error from event list
- Fix flakey prune error test
Add wait for pod2 after creation
Add wait for pod2 after deletion
Re-use inventory to ensure prune of pod2 not skipped
- Add optional klog support for e2e tests
- apimachinery yaml.Unmarshal fixes number types to int64 and float64
- Fix inaccurate error message in mutator
- Move YamlStringer to object pkg for reuse by other pkgs
- Fix jsonpath tests parsing y as a bool
- Fix kstatus example_test.go to actually be a test
- Detect `config.kubernetes.io/apply-time-mutation` annotation
- Parse annotation string value as YAML
- Treat source resource as a dependency
- Before applying, apply specified substitutions
- Each mutation may include one or more substitution
- Substitutions may optionally replace a token in the existing
string value, or replace the whole value (e.g. non-strings)
- Source and target fields are specified with JSONPath expressions
- Using github.com/spyzhov/ajson because it supports mutation, and
not just retrieval
- ApplyTimeMutator uses an in-memory ResourceCache to reduce GETs
- Add testutil.Equal to show comparisons with cmp.Diff output
- Add github.com/google/go-cmp for cmp.Equal and cmp.Diff
These comparison tools make debugging easier and properly handle
error comparisons, using cmpopts.EquateErrors()
- Added EventsToExpEvents, EventToExpEvent, and RemoveEqualEvents
to testutil to help with comparing event lists
- Add InitEvent to ExpEvent, to enable validating it exists
- e2e tests have all been upgraded to validate a full list of
events, rather than just a partial list with partial contents.
This should increase confidence that new changes don't break things.
- Move from pkg/object to pkg/object/dependson
- Add DependencySet type to abstract some complexity
- Add Marshal/Unmarshal funcs for ObjMetadata and DependencySet
- Refactor primary API to ReadAnnotation and WriteAnnotation
- Move Write/Marshal behavior from testutil into dependson pkg
- Make constants private to encourage using functions as primary API