Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply-config --dry-run does not show a diff for multidoc config #8885

Closed
Tracked by #8484
TimJones opened this issue Jun 10, 2024 · 0 comments · Fixed by #8946
Closed
Tracked by #8484

apply-config --dry-run does not show a diff for multidoc config #8885

TimJones opened this issue Jun 10, 2024 · 0 comments · Fixed by #8946
Assignees

Comments

@TimJones
Copy link
Member

Bug Report

Description

When changing multi-doc type config (in this specific case NetworkDefaultActionConfig and NetworkRuleConfig) and applying to a node using talosctl apply-config --dry-run no output diff is shown even when there are changes to be made.

Logs

❯ talosctl get nftableschain ingress -o yaml
1 error occurred:
        * rpc error: code = NotFound desc = resource NfTablesChains.net.talos.dev(network/ingress@undefined) doesn't exist

❯ talosctl apply-config --file machine-config.yaml --dry-run
Dry run summary:
Applied configuration without a reboot (skipped in dry-run).
Config diff:
No changes.

❯ talosctl apply-config --file machine-config.yaml
Applied configuration without a reboot

❯ talosctl -n 10.150.0.18 get nftableschain ingress -o yaml
node: xxx
metadata:
    namespace: network
    type: NfTablesChains.net.talos.dev
    id: ingress
    version: 1
    owner: network.NfTablesChainConfigController
    phase: running
    created: 2024-06-10T09:21:06Z
    updated: 2024-06-10T09:21:06Z
spec:
    type: filter
    hook: input
    priority: filter
    policy: accept
    rules:
        - matchIIfName:
            interfaceName:
                - lo
                - siderolink
                - kubespan
            operator: ==
          anonymousCounter: true
          verdict: accept
        - matchSourceAddress:
            ...

Environment

  • Talos version: v1.7.2
  • Kubernetes version: v1.30.1
  • Platform: bare metal
@DmitriyMV DmitriyMV self-assigned this Jun 27, 2024
DmitriyMV added a commit to DmitriyMV/talos that referenced this issue Jun 27, 2024
Before this PR diff generator only diffed the v1alpha1 config and nothing else. With this PR it also takes
separate docs into the account.

```shell
~ > <editor> controlplane.yaml
~ > talosctl -n talos-default-controlplane-1  apply-config --file controlplane.yaml --dry-run
Dry run summary:
Applied configuration without a reboot (skipped in dry-run).
Config diff:
No changes.
Documents diff:
[]config.Document{
+	&runtime.KmsgLogV1Alpha1{
+		Meta:       meta.Meta{MetaAPIVersion: "v1alpha1", MetaKind: "KmsgLogConfig"},
+		MetaName:   "omni-kmsg",
+		KmsgLogURL: s"tcp://[fdae:41e4:649b:9303::1]:8092",
+	},
}
~ > talosctl -n talos-default-controlplane-1  apply-config --file controlplane.yaml
Applied configuration without a reboot
~ >
~ >
~ >
~ > <editor> controlplane.yaml
~ > talosctl -n talos-default-controlplane-1  apply-config --file controlplane.yaml --dry-run
Dry run summary:
Applied configuration without a reboot (skipped in dry-run).
Config diff:
No changes.
Documents diff:
[]config.Document{
	&runtime.KmsgLogV1Alpha1{Meta: {MetaAPIVersion: "v1alpha1", MetaKind: "KmsgLogConfig"}, MetaName: "omni-kmsg", KmsgLogURL: {URL: &{Scheme: "tcp", Host: "[fdae:41e4:649b:9303::1]:8092"}}},
+	&network.DefaultActionConfigV1Alpha1{
+		Meta:    meta.Meta{MetaAPIVersion: "v1alpha1", MetaKind: "NetworkDefaultActionConfig"},
+		Ingress: s"block",
+	},
}
```

Closes siderolabs#8885

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants