@@ -50,15 +50,16 @@ type configOptions struct {
5050 noConsistency bool
5151}
5252
53- func (o * configOptions ) ToProject (ctx context.Context , dockerCli command.Cli , services []string ) (* types.Project , error ) {
54- return o . ProjectOptions . ToProject ( dockerCli , services ,
53+ func (o * configOptions ) ToProject (ctx context.Context , dockerCli command.Cli , services []string , po ... cli. ProjectOptionsFn ) (* types.Project , error ) {
54+ po = append ( po ,
5555 cli .WithInterpolation (! o .noInterpolate ),
5656 cli .WithResolvedPaths (! o .noResolvePath ),
5757 cli .WithNormalization (! o .noNormalize ),
5858 cli .WithConsistency (! o .noConsistency ),
5959 cli .WithDefaultProfiles (o .Profiles ... ),
6060 cli .WithDiscardEnvFile ,
6161 cli .WithContext (ctx ))
62+ return o .ProjectOptions .ToProject (dockerCli , services , po ... )
6263}
6364
6465func configCommand (p * ProjectOptions , dockerCli command.Cli , backend api.Service ) * cobra.Command {
@@ -154,7 +155,7 @@ func runConfig(ctx context.Context, dockerCli command.Cli, backend api.Service,
154155}
155156
156157func runServices (ctx context.Context , dockerCli command.Cli , opts configOptions ) error {
157- project , err := opts .ToProject (ctx , dockerCli , nil )
158+ project , err := opts .ToProject (ctx , dockerCli , nil , cli . WithoutEnvironmentResolution )
158159 if err != nil {
159160 return err
160161 }
@@ -165,7 +166,7 @@ func runServices(ctx context.Context, dockerCli command.Cli, opts configOptions)
165166}
166167
167168func runVolumes (ctx context.Context , dockerCli command.Cli , opts configOptions ) error {
168- project , err := opts .ToProject (ctx , dockerCli , nil )
169+ project , err := opts .ToProject (ctx , dockerCli , nil , cli . WithoutEnvironmentResolution )
169170 if err != nil {
170171 return err
171172 }
@@ -180,7 +181,7 @@ func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) err
180181 if opts .hash != "*" {
181182 services = append (services , strings .Split (opts .hash , "," )... )
182183 }
183- project , err := opts .ToProject (ctx , dockerCli , nil )
184+ project , err := opts .ToProject (ctx , dockerCli , nil , cli . WithoutEnvironmentResolution )
184185 if err != nil {
185186 return err
186187 }
@@ -209,7 +210,7 @@ func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) err
209210
210211func runProfiles (ctx context.Context , dockerCli command.Cli , opts configOptions , services []string ) error {
211212 set := map [string ]struct {}{}
212- project , err := opts .ToProject (ctx , dockerCli , services )
213+ project , err := opts .ToProject (ctx , dockerCli , services , cli . WithoutEnvironmentResolution )
213214 if err != nil {
214215 return err
215216 }
@@ -230,7 +231,7 @@ func runProfiles(ctx context.Context, dockerCli command.Cli, opts configOptions,
230231}
231232
232233func runConfigImages (ctx context.Context , dockerCli command.Cli , opts configOptions , services []string ) error {
233- project , err := opts .ToProject (ctx , dockerCli , services )
234+ project , err := opts .ToProject (ctx , dockerCli , services , cli . WithoutEnvironmentResolution )
234235 if err != nil {
235236 return err
236237 }
0 commit comments