mirror of
https://github.com/trailofbits/buttercup
synced 2026-06-21 14:11:39 +00:00
deployment: fix CRS/Service instance IDs usage (#137)
This commit is contained in:
committed by
GitHub
parent
6f4b0118ac
commit
2d85829b08
@@ -25,8 +25,7 @@ opentelemetry.attributes._clean_attribute = _clean_attribute_wrapper
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
# NOTE: we made the mistake of using SERVICE_INSTANCE_ID as CRS_INSTANCE_ID, so we're keeping it for now
|
||||
crs_instance_id = os.getenv("SERVICE_INSTANCE_ID", str(uuid.uuid4()))
|
||||
crs_instance_id = os.getenv("CRS_INSTANCE_ID", str(uuid.uuid4()))
|
||||
service_instance_id = str(uuid.uuid4())
|
||||
|
||||
|
||||
|
||||
@@ -113,16 +113,16 @@ up() {
|
||||
--from-literal=username="$GHCR_USERNAME" \
|
||||
--from-literal=scantron_github_pat="$SCANTRON_GITHUB_PAT" || echo -e "${GRN}ghcr secret already exists${NC}"
|
||||
|
||||
echo -e "${BLU}Creating SERVICE_INSTANCE_ID${NC}"
|
||||
SERVICE_INSTANCE_ID=$(echo $RANDOM | md5sum | head -c 20)
|
||||
kubectl create configmap service-instance-id \
|
||||
echo -e "${BLU}Creating CRS_INSTANCE_ID${NC}"
|
||||
CRS_INSTANCE_ID=$(echo $RANDOM | md5sum | head -c 20)
|
||||
kubectl create configmap crs-instance-id \
|
||||
--namespace "$BUTTERCUP_NAMESPACE" \
|
||||
--from-literal=service-instance-id="$SERVICE_INSTANCE_ID" || echo -e "${GRN}service-instance-id configmap already exists${NC}"
|
||||
--from-literal=crs-instance-id="$CRS_INSTANCE_ID" || echo -e "${GRN}crs-instance-id configmap already exists${NC}"
|
||||
|
||||
SERVICE_INSTANCE_ID=$(kubectl get configmap service-instance-id \
|
||||
CRS_INSTANCE_ID=$(kubectl get configmap crs-instance-id \
|
||||
--namespace "$BUTTERCUP_NAMESPACE" \
|
||||
-o jsonpath='{.data.service-instance-id}')
|
||||
echo -e "${GRN}SERVICE_INSTANCE_ID is $SERVICE_INSTANCE_ID${NC}"
|
||||
-o jsonpath='{.data.crs-instance-id}')
|
||||
echo -e "${GRN}CRS_INSTANCE_ID is $CRS_INSTANCE_ID${NC}"
|
||||
|
||||
kubectl create secret docker-registry docker-auth \
|
||||
--namespace "$BUTTERCUP_NAMESPACE" \
|
||||
|
||||
@@ -91,11 +91,11 @@ Define Docker Host environment variable for Unix socket
|
||||
value: "Authorization=Basic {{ .Values.global.otel.token }}"
|
||||
- name: OTEL_EXPORTER_OTLP_PROTOCOL
|
||||
value: "{{ .Values.global.otel.protocol | default "grpc" }}"
|
||||
- name: SERVICE_INSTANCE_ID
|
||||
- name: CRS_INSTANCE_ID
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: service-instance-id
|
||||
key: service-instance-id
|
||||
name: crs-instance-id
|
||||
key: crs-instance-id
|
||||
{{- end }}
|
||||
|
||||
{{- define "buttercup.env.timeouts" }}
|
||||
|
||||
Reference in New Issue
Block a user