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

fixes list and workon for site names containing dashes #34

Merged
merged 3 commits into from
Mar 1, 2017

Conversation

tannerjfco
Copy link
Contributor

@tannerjfco tannerjfco commented Feb 27, 2017

The Problem:

#30 - ProcessContainer() processed the container name by splitting into a slice by dashes. This approach doesn't work if the site name contains a dash.

The Fix:

This implements docker labels to provide the data we're after for dev list in a cleaner way.
This also updates the string parsing in dev workon to more reliably separate site name and environment.

Both fixes should allow ddev to handle sitenames containing dashes successfully.

The Test:

  • Add a site in ddev that has a dash in it, such as drud-d8 production.
  • Run ddev list and see the site listed as expected

Automation Overview:

I updated the primary test app to be drud-d8, one of the sites containing a dash in the name. That's really all that's needed to validate this fix.

Related Issue Link(s):

#30

Release/Deployment notes:

Does this affect anything else, or are there ramifications for other code? Does anything have to be done on deployment?

This should address the remaining test issues currently in #24

@rfay
Copy link
Member

rfay commented Feb 27, 2017

Just reading through this, it seems "OK", but do we actually need to parse our own container to figure out what it contains? Is there any other way we could do that? It seems like we ought to have a much easier way to figure out what it is we have.

@beeradb
Copy link
Contributor

beeradb commented Feb 27, 2017

Could possibly achieve that via container labels.

https://docs.docker.com/compose/compose-file/#/labels-1

@tannerjfco
Copy link
Contributor Author

labels could work, and seems like a reasonable effort. I'll see where it goes.

@tannerjfco tannerjfco changed the title improves container name processing so app names with dashes dont break it fixes list and workon for site names containing dashes Feb 28, 2017
@rfay
Copy link
Member

rfay commented Feb 28, 2017

Please update the OP with the new strategy for resolving, explaining exactly the approach you've taken with labels and any implications of that.

I've just taken a scan through the code, but will finish my review when the internet works again. Thanks!

labels:
com.drud.site-name: {{ .site_name }}
com.drud.site-env: {{ .site_env }}
com.drud.container-type: db
Copy link
Contributor

Choose a reason for hiding this comment

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

So glad you added these too.

Copy link
Contributor

@beeradb beeradb left a comment

Choose a reason for hiding this comment

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

These changes work for me. Tests also pass. Code looks solid.

I'm 👍

@tannerjfco tannerjfco merged commit 7cd22a6 into ddev:master Mar 1, 2017
@tannerjfco tannerjfco deleted the ddev-30-dev-list-dash branch March 1, 2017 22:50
mootari added a commit to mootari/ddev that referenced this pull request Sep 9, 2021
Fixes breaking readthedocs builds due to removal of Python 2 support in setuptools 58.
PR: tikitu/jsmin#34
rfay pushed a commit that referenced this pull request Sep 9, 2021
Fixes breaking readthedocs builds due to removal of Python 2 support in setuptools 58.
PR: tikitu/jsmin#34
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