Skip to content

Conversation

@ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Sep 14, 2021

interpolation produces the expected UnitBytes type for shm_size and comparable fields
this PR updates transformSize so it is a no-op when type is already correct

close docker/compose#8613

Copy link
Contributor

@mat007 mat007 left a comment

Choose a reason for hiding this comment

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

Should we add a default: and return an error to avoid possible panics in the future?

loader/loader.go Outdated
Comment on lines 1008 to 1009
case int64:
return value, nil
case types.UnitBytes:
return value, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: It think this may work

Suggested change
case int64:
return value, nil
case types.UnitBytes:
return value, nil
case int64, types.UnitBytes:
return value, nil

?

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
Copy link
Collaborator Author

ndeloof commented Sep 14, 2021

That's indeed weird this TransformerFunc uses panic and doesn't just return an error, fixed

Copy link
Contributor

@mat007 mat007 left a comment

Choose a reason for hiding this comment

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

Looks good!

@toniopelo
Copy link

There might still be a problem @ndeloof, see docker/compose#8613 (comment). Might be a regression ?

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.

RC3 fails to up existing RC2 environment with panic: invalid type for size types.UnitBytes due to shm_size: ${VAR}

3 participants