Skip to content

Specifying unknown arguments in Cilium Agent config-dir #42781

@andy176631

Description

@andy176631

I was using Cilium 1.15 with the derive-masquerade-ip-addr-from-device argument. After upgrading to 1.16 via Helm, I noticed that this argument no longer works, as it was renamed to derive-masq-ip-addr-from-device (commit). This change was not mentioned in the 1.16 Upgrade Guide.

In the code below, when validateConfigMap is called, it appears that unknown arguments are ignored (execution continue). It might be helpful to log a warning when an unknown argument is detected, or alternatively, apply a strict validation policy that causes an immediate failure, ensuring users are notified promptly. Thanks in advance!

cilium/pkg/option/config.go

Lines 3483 to 3497 in 7a206aa

func validateConfigMap(cmd *cobra.Command, m map[string]any) error {
flags := cmd.Flags()
for key, value := range m {
flag := flags.Lookup(key)
if flag == nil {
continue
}
err := validateConfigMapFlag(flag, key, value)
if err != nil {
return fmt.Errorf("option %s: %w", key, err)
}
}
return nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentCilium agent related.area/cliImpacts the command line interface of any command in the repository.good-first-issueGood starting point for new developers, which requires minimal understanding of Cilium.help-wantedYou can help! Post a detailed plan on the issue or create a PR to solve this issue.kind/enhancementThis would improve or streamline existing functionality.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions