Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ init.yaml
controlplane.yaml
join.yaml
worker.yaml
machineconfig.yaml
talosconfig
/kubeconfig
hack/test/libvirt/matchbox/assets/*
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ require (
github.com/siderolabs/go-debug v0.6.1
github.com/siderolabs/go-kmsg v0.1.4
github.com/siderolabs/go-kubeconfig v0.1.1
github.com/siderolabs/go-kubernetes v0.2.30
github.com/siderolabs/go-kubernetes v0.2.31
github.com/siderolabs/go-loadbalancer v0.5.0
github.com/siderolabs/go-pcidb v0.3.2
github.com/siderolabs/go-pointer v1.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ github.com/siderolabs/go-kmsg v0.1.4 h1:RLAa90O9bWuhA3pXPAYAdrI+kzcqTshZASRA5yso
github.com/siderolabs/go-kmsg v0.1.4/go.mod h1:BLkt2N2DHT0wsFMz32lMw6vNEZL90c8ZnBjpIUoBb/M=
github.com/siderolabs/go-kubeconfig v0.1.1 h1:tZlgpelj/OqrcHVUwISPN0NRgObcflpH9WtE41mtQZ0=
github.com/siderolabs/go-kubeconfig v0.1.1/go.mod h1:QaGp4i9L95oDbcU7jDn30aw4gnREkb3O5otgxw8imOk=
github.com/siderolabs/go-kubernetes v0.2.30 h1:sqOulDpkdTRtqTIn7odFAe5tz8ea12kZgNz0BOnxUb0=
github.com/siderolabs/go-kubernetes v0.2.30/go.mod h1:D6b6O6oVFXPUBTN+euLTF3llSw5GmUqP749brODKF5s=
github.com/siderolabs/go-kubernetes v0.2.31 h1:pAYVti2SUnUzXlGAMmZZPqhq2+V8ifg7zhFku4iqeTQ=
github.com/siderolabs/go-kubernetes v0.2.31/go.mod h1:D6b6O6oVFXPUBTN+euLTF3llSw5GmUqP749brODKF5s=
github.com/siderolabs/go-loadbalancer v0.5.0 h1:0v7E6GrxoONyqwcmHiA+J0vIDPWbkTmevHGCFb4tjdc=
github.com/siderolabs/go-loadbalancer v0.5.0/go.mod h1:tRVouZ9i2R/TRbNUF9MqyBlV2wsjX0cxkYTjPXcI9P0=
github.com/siderolabs/go-pcidb v0.3.2 h1:18KMjsc+AO2r6/pl0KLBR9xOXO0ULLCXwmGhIukoAbw=
Expand Down
53 changes: 14 additions & 39 deletions pkg/cluster/kubernetes/talos_managed.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,48 +508,23 @@ func syncManifestsSSA(ctx context.Context, objects []*unstructured.Unstructured,
return err
}

ssaOptions := manifests.SSAOptions{
FieldManagerName: constants.KubernetesFieldManagerName,
InventoryNamespace: constants.KubernetesInventoryNamespace,
InventoryName: constants.KubernetesBootstrapManifestsInventoryName,
SSApplyBehaviorOptions: manifests.SSApplyBehaviorOptions{
DryRun: options.DryRun,
InventoryPolicy: options.InventoryPolicy,
ReconcileTimeout: options.ReconcileTimeout,
PruneTimeout: options.PruneTimeout,
ForceConflicts: options.ForceConflicts,
NoPrune: options.NoPrune,
},
}

options.Log("comparing with live objects")

result, err := manifests.DiffSSA(ctx, objects, config, ssaOptions)
if err != nil {
return err
}

if len(result) == 0 {
options.Log("< no changes detected")
}

for _, r := range result {
objPath := fmt.Sprintf("%s %s/%s", r.Object.GroupVersionKind().Kind, r.Object.GetNamespace(), r.Object.GetName())
if r.Object.GetNamespace() == "" {
objPath = fmt.Sprintf("%s %s", r.Object.GroupVersionKind().Kind, r.Object.GetName())
}

options.Log("< %s %s", r.Action, objPath)
options.Log("%s", r.Diff)
}

options.Log("applying manifests")

return manifests.SyncWithLogSSA(
return manifests.SyncAndDiffWithLogSSA(
ctx,
objects,
config,
ssaOptions,
manifests.SSAOptions{
FieldManagerName: constants.KubernetesFieldManagerName,
InventoryNamespace: constants.KubernetesInventoryNamespace,
InventoryName: constants.KubernetesBootstrapManifestsInventoryName,
SSApplyBehaviorOptions: manifests.SSApplyBehaviorOptions{
DryRun: options.DryRun,
InventoryPolicy: options.InventoryPolicy,
ReconcileTimeout: options.ReconcileTimeout,
PruneTimeout: options.PruneTimeout,
ForceConflicts: options.ForceConflicts,
NoPrune: options.NoPrune,
},
},
options.Log,
)
}
Expand Down
Loading