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

fix: remove empty field in the releaser configuration. #1837

Merged
merged 1 commit into from Nov 9, 2023

Conversation

jvanz
Copy link
Member

@jvanz jvanz commented Nov 8, 2023

The setup command is writing a file with the releaser.os and releaser.arch fields as empty lists. This is causing problems in the merge of the default configuration and the configuration generated by the command. During the merge the fields from the files are considered different types causing a failure. As the generate file should be used to overwrite the default values does not make sense to write a file with a invalid field value (empty list). Therefore, this commit change the setup command to remove the mentioned field from the file when they are empty.

Fix #1829

@jvanz jvanz force-pushed the skip-empty-field branch 2 times, most recently from e8eb18d to 5798023 Compare November 9, 2023 12:53
For some reason the configuration merge function is called with the src
and dest "inverted". In other words, the dest map contains the defaults
values defined as the first file in the -c command line argument of the
command. As result, the merge function fails because it detects this as
incompatible types to be merged. This commit fixes that by removing the
slice len check.

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
@jvanz
Copy link
Member Author

jvanz commented Nov 9, 2023

Instead of changing the --setup command the merge function has been updated to properly merge the configs when an empty slice is found.

Copy link
Member

@kralicky kralicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@kralicky kralicky merged commit d52446f into rancher:main Nov 9, 2023
1 check failed
@jvanz jvanz deleted the skip-empty-field branch November 9, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail to build locally
2 participants