From 41da1a39ce926ee6942975b8a0a0625d0a6d500a Mon Sep 17 00:00:00 2001 From: Andrew Scribner Date: Thu, 18 Jan 2024 17:10:16 -0500 Subject: [PATCH 1/2] explicitly set workingdir for workload in charm.py --- src/charm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/charm.py b/src/charm.py index b34a774..042c862 100755 --- a/src/charm.py +++ b/src/charm.py @@ -117,6 +117,12 @@ def _oidc_layer(self): "command": "/home/authservice/oidc-authservice", "environment": self.service_environment, "startup": "enabled", + # working-dir is required to interchangeably support docker images and rocks. + # Rocks always set their entrypoint working-dir to "/" because pebble is the + # entrypoint, so we need to be explicit. This was not needed for running + # the upstream docker image because that image has a entrypoint working-dir + # of "/home/authservice", which is used if working-dir is not set here. + "working-dir": "/home/authservice", } }, } From bccdde6acf5a2a7cec451f762e566d8859fb240e Mon Sep 17 00:00:00 2001 From: Andrew Scribner Date: Fri, 19 Jan 2024 11:27:20 -0500 Subject: [PATCH 2/2] Update src/charm.py --- src/charm.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/charm.py b/src/charm.py index 042c862..f32922a 100755 --- a/src/charm.py +++ b/src/charm.py @@ -117,11 +117,8 @@ def _oidc_layer(self): "command": "/home/authservice/oidc-authservice", "environment": self.service_environment, "startup": "enabled", - # working-dir is required to interchangeably support docker images and rocks. - # Rocks always set their entrypoint working-dir to "/" because pebble is the - # entrypoint, so we need to be explicit. This was not needed for running - # the upstream docker image because that image has a entrypoint working-dir - # of "/home/authservice", which is used if working-dir is not set here. + # See https://github.com/canonical/oidc-gatekeeper-operator/pull/128 + # for context on why we need working-dir set here. "working-dir": "/home/authservice", } },