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

container detection is specific to docker #231

Closed
qingchoulove opened this issue Jun 26, 2023 · 5 comments · Fixed by #232
Closed

container detection is specific to docker #231

qingchoulove opened this issue Jun 26, 2023 · 5 comments · Fixed by #232
Labels
question Further information is requested

Comments

@qingchoulove
Copy link
Collaborator

containerd as the container runtime, but the container detection method used in #225 is not working anymore.

FileNotFoundError: [Errno 2] No such file or directory: '/.config/source_provider.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/kubespider/app.py", line 8, in <module>
    main()
  File "/app/kubespider/app.py", line 5, in main
    runner.run_with_config_handler()
  File "/app/kubespider/core/runner.py", line 34, in run_with_config_handler
    config_handler.prepare_config()
  File "/app/kubespider/core/config_handler.py", line 177, in prepare_config
    raise Exception(str('failed to copy %s to %s:%s', template_cfg, target_cfg)) from err
TypeError: decoding str is not supported

@qingchoulove qingchoulove added the question Further information is requested label Jun 26, 2023
@ljtnono
Copy link
Contributor

ljtnono commented Jun 26, 2023

@qingchoulove 这里可能是我思路有问题,不应该这样判断是开发环境还是容器运行环境。后面想了下,是不是可以通过判断.git文件夹是否存在来判断是开发还是容器运行环境?

@qingchoulove
Copy link
Collaborator Author

@qingchoulove 这里可能是我思路有问题,不应该这样判断是开发环境还是容器运行环境。后面想了下,是不是可以通过判断.git文件夹是否存在来判断是开发还是容器运行环境?

我在dockerfile手动创建了 /.dockerenv,这样来保证容器运行环境可以正确检测,稍候发出PR辛苦大佬也看下。

@ljtnono
Copy link
Contributor

ljtnono commented Jun 26, 2023

@qingchoulove 我觉得用.git文件夹判断更好吧,containerd不知道啥情况,额外增加一个无意义的.dockerenv文件不太合适吧。

@qingchoulove
Copy link
Collaborator Author

.git目录可能也是一样的问题,.dockerenv就是一个flag,可以保证在咱们打包的镜像中存在。或者换一个其他的环境变量,在dockerfile中指明,毕竟dockerfile对我们是可控的。

@ljtnono
Copy link
Contributor

ljtnono commented Jun 26, 2023

.git目录可能也是一样的问题,.dockerenv就是一个flag,可以保证在咱们打包的镜像中存在。或者换一个其他的环境变量,在dockerfile中指明,毕竟dockerfile对我们是可控的。

嗯,也有道理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants