Skip to content

Commit

Permalink
fixed regression bug in vault client
Browse files Browse the repository at this point in the history
  • Loading branch information
xadhatter committed May 15, 2024
1 parent c67f63a commit da654d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export FOX_INFO=true && \
mkdir -p /tmp/kubefox/hello-world && \
cd /tmp/kubefox/hello-world && \
fox init && \
kubectl apply -f ./hack/environments/ -n kubefox-debug
fox publish --wait 5m
fox publish --wait 5m && \
kubectl apply -f ./hack/environments/ -n kubefox-debug ; \
cd -
```

Expand All @@ -142,21 +142,6 @@ info Don't worry, 🦊 Fox can create one for you.
Would you like to create a KubeFox Platform? [Y/n] y
Enter the KubeFox Platform's name (required): debug
Enter the Kubernetes namespace of the KubeFox Platform (default 'kubefox-debug'):
info KubeFox App initialization complete!
environment.kubefox.xigxog.io/prod created
virtualenvironment.kubefox.xigxog.io/prod created
environment.kubefox.xigxog.io/qa created
virtualenvironment.kubefox.xigxog.io/qa created
info Component image 'localhost/kubefox/hello-world/backend:3fbfcb274c2116d4d82271da41074135' exists, skipping build.
info Loading component image 'localhost/kubefox/hello-world/backend:3fbfcb274c2116d4d82271da41074135' into kind cluster 'kind'.
info Component image 'localhost/kubefox/hello-world/frontend:98c75bd20b210d15b456ec92faab2abd' exists, skipping build.
info Loading component image 'localhost/kubefox/hello-world/frontend:98c75bd20b210d15b456ec92faab2abd' into kind cluster 'kind'.
info Waiting for KubeFox Platform 'debug' to be ready...
info Waiting for component 'backend' to be ready...
info Waiting for component 'frontend' to be ready...
```

Great! Now that there is a local instance you just need to enable debug mode and
Expand Down
2 changes: 2 additions & 0 deletions hack/scripts/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/setup.sh"

function teardown {
kill $(jobs -p)
rm -rf /tmp/kubefox

echo
echo "Patching Platform to disable debug..."
Expand Down Expand Up @@ -115,5 +116,6 @@ EOF
echo

echo "🦊🏁🌟 Debug environment ready! 🌟🏁🦊"
echo

wait
2 changes: 1 addition & 1 deletion hack/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# SPDX-License-Identifier: MPL-2.0

set -o xtrace
# set -o xtrace
set -o errexit

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &>/dev/null && pwd -P)"
Expand Down
7 changes: 4 additions & 3 deletions vault/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ func (c *Client) GetData(ctx context.Context, key api.DataKey, data *api.Data) e
resp, err := c.Logical().ReadRawWithDataWithContext(ctx, DataSubPath(key, "data"), nil)
if resp != nil {
defer resp.Body.Close()

if resp.StatusCode == http.StatusNotFound {
return core.ErrNotFound()
}
}
if err != nil {
return err
}
if resp.StatusCode == http.StatusNotFound {
return core.ErrNotFound()
}

secret := &VaultSecret{
Data: &VaultData{
Expand Down

0 comments on commit da654d2

Please sign in to comment.