Skip to content

Change docker-compose yaml to insert networks stanza, fixes #3587 - #3620

Merged
rfay merged 4 commits into
ddev:masterfrom
rfay:20220222_add_networks
Feb 24, 2022
Merged

rfay merged 4 commits into
ddev:masterfrom
rfay:20220222_add_networks

Conversation

@rfay

@rfay rfay commented Feb 22, 2022 •

Copy link
Copy Markdown
Member

The Problem/Issue/Bug:

Because the requirement of the networks stanza in ddev v1.19 is pretty intrusive, requiring existing docker-compose.*.yaml all to be edited, this PR unmarshalls in the fully normalized yaml text into a golang map, replaces the networks array, and then marshalls the yaml back out to .ddev/.ddev-docker-compose-full.yaml.

Manual Testing Instructions:

  • Try it out with recipes from ddev-contrib that haven't had the networks stanza added
  • Try it out with recipes that do have the networks stanza.

TODO

  • Remove the docs that ask for the networks stanza

Automated Testing Overview:

I'm just hoping that all existing pass.

  • Add a test with a 3rd-party service that does not have networks

Release/Deployment notes:

  • Release notes can remove the worry about the networks stanza.

@rfay
rfay requested a review from jonaseberle February 22, 2022 23:36
@rfay

rfay commented Feb 22, 2022

Copy link
Copy Markdown
Member Author

@jonaseberle , @LionsAd would love to have your review of this approach, the code, and manual testing. It could remove some significant friction from the release of v1.19.

Can be tested with gitpod, https://gitpod.io/#https://github.com/drud/ddev/pull/3620
This first push artifacts are at https://github.com/drud/ddev/actions/runs/1884541571

@jonaseberle

Copy link
Copy Markdown
Member

It'll take me some time to test, probably next week. But I'll run it productively and test with services I come across.

@rfay
rfay merged commit 0f18fd6 into ddev:master Feb 24, 2022
@rfay
rfay deleted the 20220222_add_networks branch February 24, 2022 01:30
}
}
// Make sure all services have our networks stanza
serviceMap["networks"] = map[interface{}]interface{}{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not too familiar with this code - can you still override this with your own networks stanza?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for taking a look!
No, this replaces the networks stanza unconditionally. Agreed it's a weakness; I tried not to and failed. I haven't ever heard of anybody needing to alter networks though.

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.

3 participants