Documentation
¶
Overview ¶
Package diff compares two rendered manifests the way an operator needs to see them before an upgrade or a rollback: what is added, removed or changed, and which changes Kubernetes cannot apply in place. Secret values are compared but never shown.
The blocking rules match the chart's own render-diff gate, so a change the chart's CI calls breaking is one ntctl refuses to apply silently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct {
Kind string `json:"kind"`
Name string `json:"name"`
Op Op `json:"op"`
// Blocking says why Kubernetes cannot apply the change in place, or why
// it loses data. Empty when the change is safe.
Blocking []string `json:"blocking,omitempty"`
// Kept says a removed resource carries helm.sh/resource-policy: keep, so
// Helm leaves it in the cluster, no longer managed by the release.
Kept bool `json:"kept,omitempty"`
// Unread says a removed Secret is named by nothing: no other object of
// either release, nor any object outside it the check could see.
Unread bool `json:"unread,omitempty"`
// Secret keys added, removed or with a new value. Values are never kept.
SecretKeys *SecretKeys `json:"secretKeys,omitempty"`
// Images are the containers whose image changes.
Images []ImageChange `json:"images,omitempty"`
// Unified is the diff of the resource, with Secret values hidden.
Unified string `json:"-"`
}
Change is one resource that differs.
type ImageChange ¶ added in v0.10.0
type ImageChange struct {
Container string `json:"container"`
From string `json:"from"`
To string `json:"to"`
}
ImageChange is one container's image before and after.
func (ImageChange) String ¶ added in v0.10.0
func (i ImageChange) String() string
String names the image once and shows the tag change, or both references when the repository changes too.
type Referrer ¶ added in v0.17.0
Referrer names an object outside the release that still uses the Secret called name, such as an operator's own Gateway serving the release's certificate, or returns "" when none does.
type Result ¶
type Result struct {
Changes []Change `json:"changes"`
}
Result is every change between two manifests.
func CompareUsing ¶ added in v0.17.0
CompareUsing is Compare, with outside naming what in the cluster still uses a Secret the release stops rendering. A removed Secret named by nothing in either release, nor by outside, is safe to drop: it holds nothing anything reads. Without outside, every removed Secret the releases do not name still blocks, since nothing beyond the manifests was checked.
func (Result) Components ¶ added in v0.10.0
func (r Result) Components() []ImageChange
Components returns each image whose version changes, once however many workloads run it: what an upgrade moves, independent of how many releases it spans. Images of added or removed workloads are not counted.
type SecretKeys ¶
type SecretKeys struct {
Added []string `json:"added,omitempty"`
Removed []string `json:"removed,omitempty"`
Changed []string `json:"changed,omitempty"`
// Unread are the removed keys no workload of the target release reads,
// and Empty those that held an empty value: dropping either is safe.
Unread []string `json:"unread,omitempty"`
Empty []string `json:"empty,omitempty"`
}
SecretKeys summarises a Secret's change by key.
func (*SecretKeys) String ¶
func (k *SecretKeys) String() string