Skip to content

Commit

Permalink
Merge pull request #15 from alesstimec/makefile-push-microk8s
Browse files Browse the repository at this point in the history
Makefile push microk8s
  • Loading branch information
alesstimec committed Jul 5, 2023
2 parents 8485b6d + 6a4cd66 commit 9b8e056
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ build-image:
docker build --target build \
--tag openfga:latest \
./images

push-microk8s: build-image
docker tag openfga:latest localhost:32000/openfga:latest
docker push localhost:32000/openfga:latest
5 changes: 5 additions & 0 deletions charms/openfga-k8s/lib/charms/openfga_k8s/v0/openfga.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ def _on_openfga_store_created(self, event: OpenFGAStoreCreateEvent):
secret = self.model.get_secret(id=event.token_secret_id)
content = secret.get_content()
# and get the token with content["token"]
if event.token:
# get the token from event.token
```
As you can see the OpenFGA charm will attempt to use Juju secrets to pass the token
to the requiring charm. However if the Juju version does not support secrets it will
fall back to passing plaintext token via relation fata.
"""

import logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ def _on_openfga_store_created(self, event: OpenFGAStoreCreateEvent):
secret = self.model.get_secret(id=event.token_secret_id)
content = secret.get_content()
# and get the token with content["token"]
if event.token:
# get the token from event.token
```
As you can see the OpenFGA charm will attempt to use Juju secrets to pass the token
to the requiring charm. However if the Juju version does not support secrets it will
fall back to passing plaintext token via relation fata.
"""

import logging
Expand Down

0 comments on commit 9b8e056

Please sign in to comment.