-
Notifications
You must be signed in to change notification settings - Fork 44
feat: replace hardcoded artifact image constants with CLI-configurable values #322
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
Conversation
03265ce to
2aecfd0
Compare
|
Hello! Is this PR ready for review? There's some kind of error in the workflow, I don't know what to do with it. |
|
the workflow won't run unless one of the maintainers reviews and approves the workflow, this will be looked at probably next week |
Okay, thank you! |
cmd/image-factory/cmd/options.go
Outdated
| SecureBoot SecureBootOptions | ||
|
|
||
| // Organization or platform within an organization. | ||
| Organization string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this please, it makes things too complicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed it at the last commit
cmd/image-factory/cmd/options.go
Outdated
| TalosctlImage string | ||
|
|
||
| // Path to YAML file with extension name aliases. | ||
| ExtensionNameAlias string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split this into separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! PR #323
internal/artifacts/artifacts.go
Outdated
|
|
||
| // Various images. | ||
| const ( | ||
| var ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should stay as constants/default values, or be removed completely. setting variables via config is a bad idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I won't touch it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarifying myself: patching variables in a module is a bad development practice.
We can keep those as constants and initialize config values from it (or skip it).
But we should use config values where we previously used these constants.
smira
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems non-functional now? as these config values are not consumed anywhere?
Aren't we passing parameters in this line to the main.go file: |
we do, but nothing "reads" from these new variables/options unless I'm missing something |
Ah, okay, I get it. This brings us back to the point that the most convenient way to use these values in code is to replace constants with variables and change them using these parameters. That's exactly why I want to add flags. |
|
No, please - we need to pass config options to the places where it's going to be consumed. |
Okay, undestand you. |
…e values Adds CLI flags that replace hardcoded image constants Signed-off-by: Aleksandr Gamzin <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]>
smira
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, I did some changes to the PR
|
/m |
Thank you! |
This pull request adds new flags that replace hardcoded image constants. These are needed to ensure flexibility and reusability of image-factory across different environments and organizations.