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"`
// 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 Result ¶
type Result struct {
Changes []Change `json:"changes"`
}
Result is every change between two manifests.
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"`
}
SecretKeys summarises a Secret's change by key.
func (*SecretKeys) String ¶
func (k *SecretKeys) String() string