Skip to content

Commit 1464e7c

Browse files
committed
update
1 parent 9632a17 commit 1464e7c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

e2e/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ RUN pip install sourceplusplus-0.1.0.tar.gz
1515

1616
COPY E2ETest.py .
1717

18-
RUN mkdir config
19-
ADD ./spp-probe.yml ./config/
18+
ADD ./spp-probe.yml .
2019

20+
RUN mkdir config
2121
ADD ./config/spp-platform.crt ./config/
2222

2323
CMD ["python", "E2ETest.py"]

sourceplusplus/SourcePlusPlus.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ def get_config_value(self, env, default, true_default):
2727
return true_default
2828

2929
def __init__(self, **kwargs):
30-
probe_config = yaml.full_load(open("config/spp-probe.yml", "r"))
30+
probe_config_file = os.getenv("SPP_PROBE_CONFIG_FILE", "spp-probe.yml")
31+
probe_config = {}
32+
if os.path.exists(probe_config_file):
33+
probe_config = yaml.full_load(open(probe_config_file, "r"))
34+
else:
35+
probe_config["spp"] = {}
36+
probe_config["skywalking"] = {}
37+
probe_config["skywalking"]["collector"] = {}
38+
probe_config["skywalking"]["agent"] = {}
39+
3140
probe_config["spp"]["probe_id"] = self.get_config_value(
3241
"SPP_PROBE_ID", probe_config["spp"].get("probe_id"), str(uuid.uuid4())
3342
)
@@ -70,7 +79,7 @@ def attach(self):
7079

7180
ssl_ctx = ssl.create_default_context(cadata=ca_data)
7281
ssl_ctx.check_hostname = self.probe_config["spp"]["verify_host"]
73-
ssl_ctx.verify_mode = ssl.CERT_NONE
82+
ssl_ctx.verify_mode = ssl.CERT_OPTIONAL # todo: CERT_REQUIRED / load_verify_locations ?
7483
eb = EventBus(
7584
host=self.probe_config["spp"]["platform_host"], port=self.probe_config["spp"]["platform_port"],
7685
ssl_context=ssl_ctx

0 commit comments

Comments
 (0)