generated from snapcrafters/snap-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor to reduce errors * Revert to building classic on core20
- Loading branch information
Showing
4 changed files
with
16 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
#!/bin/sh | ||
|
||
# The classic snap needs to be built on core20 because of libc6 dependency: | ||
# A core22 snap needs glibc 2.32+, but in a 20.04 charm we have glibc 2.31. | ||
sed -i 's/base: core22/base: core20/g' snap/snapcraft.yaml | ||
sed -i 's/confinement: strict/confinement: classic/g' snap/snapcraft.yaml | ||
sed -i 's/CRAFT_PART_INSTALL/SNAPCRAFT_PART_INSTALL/g' snap/snapcraft.yaml | ||
sed -i '/libbpfcc/d' snap/snapcraft.yaml | ||
sed -i '/bpfcc-tools/d' snap/snapcraft.yaml | ||
yq -i 'del(.apps.grafana-agent.plugs) | del(.plugs)' snap/snapcraft.yaml | ||
cat << "EOF" > snap/local/agent-wrapper | ||
#!/bin/sh | ||
exec "${SNAP}/agent" -config.expand-env -config.file "/etc/grafana-agent.yaml" | ||
EOF | ||
sed -i 's/agent-wrapper.strict/agent-wrapper.classic/g' snap/snapcraft.yaml |
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,12 @@ | ||
#!/bin/sh | ||
|
||
if [ "$(snapctl get reporting-enabled)" = "0" ] | ||
then | ||
echo "Launched with reporting disabled" | systemd-cat | ||
REPORTING_ARG="-disable-reporting" | ||
else | ||
echo "Launched with reporting enabled" | systemd-cat | ||
REPORTING_ARG="" | ||
fi | ||
|
||
exec "${SNAP}/agent" -config.expand-env -config.file "/etc/grafana-agent.yaml" "${REPORTING_ARG}" |
File renamed without changes.
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