Skip to content

fix(serve): also detect kubernetes containers #2795

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

Merged
merged 1 commit into from
Oct 27, 2018

Conversation

lbogdan
Copy link
Contributor

@lbogdan lbogdan commented Oct 23, 2018

While working on a Vue CLI 3 server / container template for CodeSandbox and having an HMR issue (an invalid webpack socket URL), looking at how HMR is configured in serve.js, I've noticed that serve should be detecting that it's running in a container, but it's not. Looking further at the container detection code, and then at /proc/1/cgroup inside the container, it looks like

12:memory:/kubepods/burstable/pod[redacted]
11:blkio:/kubepods/burstable/pod[redacted]
[...more similar lines...]

, so I added kubepods to the detection regex.

You can see it working at https://codesandbox.io/s/qv463kv6z6 (where I manually changed serve.js inside node_modules/@vue/cli-service).

image

The "access the dev server via http://localhost..." message is still a bit confusing, I could add CodeSandbox container detection if desired (@Akryum: I pinged you on Vue Discord, maybe we can discuss this further there).

@lbogdan
Copy link
Contributor Author

lbogdan commented Oct 23, 2018

Hm, I see the CI failed, is it possible that AppVeyor uses kubernetes containers? 🙂

@haoqunjiang haoqunjiang merged commit 9a64708 into vuejs:dev Oct 27, 2018
@lbogdan lbogdan mentioned this pull request Jul 14, 2020
9 tasks
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