Documentation
¶
Overview ¶
Package shrink answers one question about a rendered TransformerRegistration: does applying it take a contract away from instances that still demand it (0015:D16)?
The answer is a decision, not an action. The caller decides what to do with a refusal; this package neither reads nor writes anything beyond the two facts it compares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decider ¶
type Decider struct {
// Client lists the instances whose demand is compared. The cached client
// is correct here: demand that is one reconcile stale over-reports, which
// refuses an upgrade that could have proceeded — the direction a guard
// should fail in.
Client client.Reader
// APIReader reads the stored claim, uncached. The comparison against the
// stored provides is the whole verdict, so a cached read that missed the
// last write would compare against a set the cluster no longer holds and
// reach a verdict about nothing.
APIReader client.Reader
}
Decider judges a rendered claim against what the cluster holds.
func (*Decider) Decide ¶
func (d *Decider) Decide( ctx context.Context, rendered *unstructured.Unstructured, ) (Decision, error)
Decide judges one rendered resource.
A resource that is not a claim, a claim the cluster does not hold yet, and a claim whose provides did not shrink all return the zero Decision without listing anything: the common upgrade pays for one uncached read and no more.
type Decision ¶
type Decision struct {
// Claim is the metadata.name of the rendered claim, empty when nothing
// was judged.
Claim string
// Dropped lists the contract FQNs the stored claim provides, the rendered
// one does not, and instances still demand — in FQN order.
Dropped []string
// Dependents names the instances demanding at least one dropped contract,
// as "<namespace>/<name>" in name order.
Dependents []string
}
Decision is the verdict on one rendered TransformerRegistration. The zero value refuses nothing, which is the verdict for every resource that is not a claim.