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

Add an Extras field on the compose config types. #1126

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

vdemeester
Copy link
Collaborator

That field is automaticaly populated with any x-* field in the yaml.
And marshalling the compose config struct put them back into place.

This make it possible to get those extra fields without re-inventing
the wheel (i.e. reimplementing 80% of the cli/compose/* packages.

Will be very useful for experiments in docker/app 👼

Signed-off-by: Vincent Demeester vincent@sbr.pm

@simonferquel
Copy link
Contributor

Should'nt we generalize that on every object (including portsconfig etc.) ?

@vdemeester
Copy link
Collaborator Author

@simonferquel in this PR, it's only on object that are allowed to have x-* — i.e. top-level, a service, a network, a volume, a secret and a config. And I really think we don't need more x-* field.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

ping @silvin-lubecki @dnephin PTAL

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

return serviceConfig, nil
}

func handleExtras(name string, source map[string]interface{}) map[string]interface{} {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: loadExtras might be more consistent with existing naming

That field is automaticaly populated with any `x-*` field in the yaml.
And marshalling the compose config struct put them back into place.

This make it possible to get those extra fields without re-inventing
the wheel (i.e. reimplementing 80% of the `cli/compose/*` packages.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants