Commit Graph

1 Commits

Author SHA1 Message Date
Hidde Beydals dfebba2783
Add `ObservedRelease` and other release utils
This adds a `release` package which allows to create (minified)
`ObservedRelease` copy of a Helm release object. This
`ObservedRelease` contains sufficient data to detect changes
to the storage object made by Helm actions run manually, and a variety
of malicious changes (but not all, at present).

The data in an `ObservedRelease` can be filtered using a `DataFilter`,
this allows for example to filter out test hooks to prevent the
controller from taking action on a manually run `helm test`.

The consumer can combine the `ObservedRelease` with a Helm storage
observer to take snapshots of the release object as written to the
storage by a Helm action. To record this on a `HelmRelease` v2beta2 API
object, the `ObservedRelease` can be transformed into a
`HelmReleaseInfo` API object which can be recorded as either the
Current or Previous release in the status.

During the transformation, the digests of both the `ObservedRelease`
object and release config are calculated using the canonical algorithm.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2023-11-20 12:06:00 +01:00