在我的 python 代码中,我面临以下问题:
Traceback (most recent call last):
File "/tmp/mod_wsgi-localhost:5000:0/handler.wsgi", line 94, in <module>
recorder_directory=recorder_directory)
File "/usr/lib64/python3.6/site-packages/mod_wsgi/server/__init__.py", line 1400, in __init__
exec(code, self.module.__dict__)
File "/app/scripts/core.wsgi", line 1, in <module>
from core_nbi import core_ws as application
File "/app/core_if_nbi.py", line 357, in <module>
coreApi.start()
File "/app/core.py", line 250, in wrapper
return func(self, *args, **kwargs)
File "/app/core.py", line 646, in start
self.otkHandler.loadCertificate()
File "/app/core.py", line 294, in loadCertificate
default_backend())
File "/usr/lib64/python3.6/site-packages/cryptography/x509/base.py", line 50, in load_pem_x509_certificate
return backend.load_pem_x509_certificate(data)
File "/usr/lib64/python3.6/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 1143, in load_pem_x509_certificate …Run Code Online (Sandbox Code Playgroud) 有没有办法通过python从舵图中提取docker图像?
我想避免任何:
helm install --dry-run helm-chart > log
bash 脚本来提取此信息。
如果舵图包含两个图像(例如),我想提取这些图像
例子:
image: repo/image1:1.0 image1.yaml file
image: repo/image2:1.0 image2.yaml file
Run Code Online (Sandbox Code Playgroud) 有没有办法排除测试目标期间使用的依赖项?例如,我想避免将所有*:testsjar 打印出来mvn dependency:tree。
[INFO] Building test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test ---
[INFO] com.test.test:jar:1.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.13:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.specs2:specs2-core_2.13:jar:4.8.3:test
[INFO] | +- org.specs2:specs2-matcher_2.13:jar:4.8.3:test
[INFO] | +- org.specs2:specs2-common_2.13:jar:4.8.3:test
[INFO] | | +- org.specs2:specs2-fp_2.13:jar:4.8.3:test
[INFO] | | \- org.scala-lang.modules:scala-parser-combinators_2.13:jar:1.1.2:compile
[INFO] | \- org.scala-sbt:test-interface:jar:1.0:test
[INFO] +- org.scalatest:scalatest_2.13:jar:3.1.0:test
[INFO] | +- org.scalactic:scalactic_2.13:jar:3.1.0:test
[INFO] | +- org.scala-lang:scala-reflect:jar:2.13.1:test
[INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile
Run Code Online (Sandbox Code Playgroud)
许多 jar 在编译阶段使用,而其他在测试阶段使用。我正在寻找:
mvn dependency:tree -Dexcludes=org.apache.maven*
Run Code Online (Sandbox Code Playgroud)
所以我想知道是否可以*tests通过命令行直接排除所有。
我的项目具有以下结构:
??? api
? ??? api.go
? ??? api_test.go
? ??? other_files...
??? cmd
? ??? main.go
Run Code Online (Sandbox Code Playgroud)
在 cmd/main.go 下,我有我的 Go 项目的入口点。
由于我还创建了一些测试文件,因此我还有其他类用于测试目的。
我的 go.mod 就像:
require (
github.com/gorilla/mux v1.8.0
github.com/stretchr/testify v1.6.1 <-used for test
gotest.tools v2.2.0+incompatible <-used for test
k8s.io/api v0.19.0
k8s.io/apimachinery v0.19.0
k8s.io/client-go v0.19.0
)
Run Code Online (Sandbox Code Playgroud)
我的疑问与构建阶段有关:
在做 时go build ./cmd/main.go,我是否只选择了正确的模块main.go以及他在代码中的所有引用,不包括go.mod用于测试类的未使用模块?
是否有任何ldd命令可以确保我只链接所需的模块?
我认为 Go 已经过优化,可以做到这一点,但我想确定这一点。
certificate ×1
cryptography ×1
docker ×1
docker-image ×1
extract ×1
go ×1
jar ×1
maven ×1
pem ×1
python ×1
python-3.x ×1
x509 ×1