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

Environment variables in Compose #305

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

fahedouch
Copy link
Member

Compose :

  • support The “.env” file
  • support The env-file flag
  • support finding compose Yaml file in current directory and its parents

related #252
Signed-off-by: fahed dorgaa fahed.dorgaa@gmail.com

@AkihiroSuda AkihiroSuda marked this pull request as draft August 1, 2021 17:14
@fahedouch fahedouch force-pushed the setup-compose-env-file branch 2 times, most recently from c7a5285 to 04e8bba Compare August 2, 2021 16:59
@AkihiroSuda AkihiroSuda added this to the v0.12.0 milestone Aug 3, 2021
@fahedouch fahedouch marked this pull request as ready for review August 3, 2021 17:54
@fahedouch fahedouch changed the title [WIP] Environment variables in Compose Environment variables in Compose Aug 3, 2021
@fahedouch fahedouch force-pushed the setup-compose-env-file branch 2 times, most recently from ee668d7 to e6a213f Compare August 4, 2021 14:46
@fahedouch
Copy link
Member Author

@AkihiroSuda @ktock any idea why most of test-integration fail ?

@fahedouch fahedouch force-pushed the setup-compose-env-file branch 4 times, most recently from d8f4609 to 166864c Compare August 9, 2021 14:49
@fahedouch fahedouch marked this pull request as draft August 11, 2021 15:21
@fahedouch fahedouch force-pushed the setup-compose-env-file branch 2 times, most recently from c0d40a6 to 27b809e Compare August 11, 2021 16:50
@fahedouch fahedouch marked this pull request as ready for review August 11, 2021 23:55
@fahedouch fahedouch force-pushed the setup-compose-env-file branch 2 times, most recently from 68cd9ea to 44c3fa2 Compare August 12, 2021 00:03
@fahedouch
Copy link
Member Author

@AkihiroSuda @ktock need your review :)

}
}

// setDotEnv was inspired from https://github.com/compose-spec/compose-go/blob/de56f4f0cb3c925f41df594221148613534c2cd3/cli/options.go#L174-215
Copy link
Member

Choose a reason for hiding this comment

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

Why not use the compose-go code directly?
What is the difference?

Copy link
Member

Choose a reason for hiding this comment

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

If something is missing in the compose-go, please consider contributing to the compose-go upstream

Copy link
Member Author

@fahedouch fahedouch Aug 12, 2021

Choose a reason for hiding this comment

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

Minor nits, PR opened compose-spec/compose-go#166

@fahedouch fahedouch force-pushed the setup-compose-env-file branch 2 times, most recently from 34e5438 to 69a9323 Compare August 13, 2021 13:28
@fahedouch
Copy link
Member Author

fahedouch commented Aug 13, 2021

as mentioned above compose-go PR : compose-spec/compose-go#166

@AkihiroSuda I did some modifications to use the compose-go directly. I let review again. Thkx

PS: We can merge this it is ok ( this PR is independent of compose-spec PR)

@AkihiroSuda AkihiroSuda mentioned this pull request Aug 18, 2021
2 tasks
Project: clicontext.String("project-name"),
NerdctlCmd: nerdctlCmd,
NerdctlArgs: nerdctlArgs,
DebugPrintFull: clicontext.Bool("debug-full"),
}

if file := clicontext.String("file"); file != "" {
o.ProjectOptions.ConfigPaths = append(o.ProjectOptions.ConfigPaths, file)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be prepended rather than appended? (in theory)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep! append or prepend give the same result since you can only pass a single compose file. But when we are going to accept the passage of several files, the order is important to process an override logic. I made the change

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 1e5e625 into containerd:master Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants