Skip to content

enflame: resource name flags use the same variable #3016

Description

@Yashbhu

I noticed that these two flags in pkg/device/enflame/config.go are using the same variable:

--enflame-drs-gcu-resource-name
--enflame-vgcu-resource-name

Both are bound to EnflameResourceNameDRSGCU.

So if both flags are passed, the last one wins. tor example, this:

--enflame-drs-gcu-resource-name=custom-a --enflame-vgcu-resource-name=custom-b

gives custom-b, while reversing them gives custom-a.

This is because both flags are registered on the same FlagSet and Go's flag package doesn't care that they're pointing to the same variable.

This could be an issue for users migrating from the old VGCU flag since the final resource name can change just based on argument order.

I also noticed that:

--enflame-vgcu-legacy-resource-name
--enflame-vgcu-percentage-resource-name

seem to be unused. They're assigned in InitEnflameDevice, but I couldn't find anywhere reading those values afterwards.

I think we should define which flag takes precedence here and add a test for it. The unused flags probably also need to be checked to see if they're still needed.

No Enflame hardware should be needed since this can be tested at the config/flag level.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions