-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add k8s sidecar docker dir * fix license * remove depguard from go-clilint * update golang-cli-lint version * ignore dot imports in tests
- Loading branch information
Showing
8 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,6 @@ linters: | |
disable-all: true | ||
enable: | ||
- bodyclose | ||
- depguard | ||
- dogsled | ||
- dupl | ||
- errcheck | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM alpine | ||
|
||
RUN apk add bash jq | ||
RUN apk add bash tar | ||
|
||
COPY resources/opa.tar.gz /opa.tar.gz | ||
|
||
RUN tar -xzf /opa.tar.gz -C /bin/ --remove-files | ||
|
||
RUN chmod +x /bin/opa | ||
|
||
COPY k8s-sidecar/start.sh / | ||
|
||
COPY k8s-sidecar/config-template.json / | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"bundles": { | ||
($instanceID): { | ||
"polling": { | ||
"min_delay_seconds": 10, | ||
"max_delay_seconds": 20 | ||
}, | ||
"service": "bundle_storage", | ||
"resource": $instanceResource, | ||
"signing": null, | ||
"persist": false, | ||
"size_limit_bytes": 0 | ||
} | ||
}, | ||
"services": { | ||
"bundle_storage": { | ||
"url": $bundleUrl, | ||
"credentials": { | ||
"client_tls": { | ||
"cert": $iasCertPath, | ||
"private_key": $iasKeyPath | ||
} | ||
} | ||
} | ||
}, | ||
"plugins": { | ||
"dcl": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
if ! ls /etc/secrets/sapbtp/identity; then | ||
>&2 echo "Error: No identity service found at /etc/secrets/sapbtp/identity" | ||
exit 1 | ||
fi | ||
files=(/etc/secrets/sapbtp/identity/*) | ||
if [ ${#files[@]} -gt 1 ]; then | ||
>&2 echo "Error: More than one identity service found at /etc/secrets/sapbtp/identity" | ||
exit 1 | ||
fi | ||
|
||
bundle_url=$(cat "${files[0]}/url")/bundle-gateway | ||
instance_id=$(cat "${files[0]}/authorization_instance_id") | ||
ias_cert_path=$(pwd -P)/"${files[0]}/certificate" | ||
ias_key_path=$(pwd -P)/"${files[0]}/key" | ||
|
||
jq -n --arg bundleUrl "$bundle_url" --arg iasCertPath "$ias_cert_path" --arg iasKeyPath "$ias_key_path" --arg instanceResource "$instance_id.tar.gz" --arg instanceID "$instance_id" -f config-template.json >config.yml | ||
|
||
>&2 echo "INFO: " "$(cat config.yml)" | ||
|
||
opa run -s -c config.yml --addr=[]:8181 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package supply_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
"github.com/onsi/ginkgo" | ||
"github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestSupply(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Supply Suite") | ||
gomega.RegisterFailHandler(ginkgo.Fail) | ||
ginkgo.RunSpecs(t, "Supply Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters