Skip to content

Commit

Permalink
Fix: Delayed start services for support- services fail (#4159)
Browse files Browse the repository at this point in the history
Delayed start is not working for support services.
Among other problems, for support services,
the service key is support-servicename,
but the service key in docker-compose is just servicename.

Update pre-seeding script to account for this.

Signed-off-by: Bryon Nevis <bryon.nevis@intel.com>

Signed-off-by: Bryon Nevis <bryon.nevis@intel.com>
  • Loading branch information
bnevis-i committed Sep 19, 2022
1 parent c6c7d77 commit 726ff50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/security-spire-config/seed_builtin_entries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ echo "SPIFFE_SERVER_SOCKET=${SPIFFE_SERVER_SOCKET}"
echo "SPIFFE_EDGEX_SVID_BASE=${SPIFFE_EDGEX_SVID_BASE}"

# add pre-authorized services into spire server entry
for dockerservice in security-spiffe-token-provider notifications scheduler \
for dockerservice in security-spiffe-token-provider support-notifications support-scheduler \
device-bacnet device-camera device-grove device-modbus device-mqtt device-rest device-snmp \
device-virtual device-rfid-llrp device-coap device-gpio \
app-service-http-export app-service-mqtt-export app-service-sample app-rfid-llrp-inventory \
app-service-external-mqtt-trigger; do
# Temporary workaround because service name in dockerfile is not consistent with service key.
# TAF scripts depend on legacy docker-compose service name. Fix in EdgeX 3.0.
service=`echo -n ${dockerservice} | sed -e 's/app-service-/app-/'`
service=`echo -n ${dockerservice} | sed -e 's/app-service-/app-/'`
# support- services have the opposite problem. service key is right, service name in docker isn't
dockerservice=`echo -n ${dockerservice} | sed -e 's/support-//'`
spire-server entry create -socketPath "${SPIFFE_SERVER_SOCKET}" -parentID "${local_agent_svid}" -dns "edgex-${service}" -spiffeID "${SPIFFE_EDGEX_SVID_BASE}/${service}" -selector "docker:label:com.docker.compose.service:${dockerservice}"
done

Expand Down

0 comments on commit 726ff50

Please sign in to comment.