Skip to content

Commit

Permalink
Merge pull request #57 from gboutry/fix/os-exporter
Browse files Browse the repository at this point in the history
Create configuration folder as _daemon_ owned
  • Loading branch information
hemanthnakkina authored Jun 3, 2024
2 parents 4968105 + f957a57 commit 8ede68d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions rocks/openstack-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ it will help ensure that all layers of the image are imported
into docker (this is just the top layer).

```bash
> skopeo --insecure-policy copy oci-archive:openstack-exporter_1.6.0-7533071_amd64.rock docker-daemon:openstack-exporter:1.6.0-7533071
> skopeo --insecure-policy copy oci-archive:openstack-exporter_1.7.0_amd64.rock docker-daemon:openstack-exporter:1.7.0
```

If you are interested in giving it a go in Microk8s, you can
export the image from your docker registry and then into the
microk8s registry:

```bash
> docker save openstack-exporter:1.6.0-7533071 > ./openstack-exporter_1.6.0-7533071.tar
> microk8s ctr image import ./openstack-exporter_1.6.0-7533071.tar
> docker save openstack-exporter:1.7.0 > ./openstack-exporter_1.7.0.tar
> microk8s ctr image import ./openstack-exporter_1.7.0.tar
# Try with sunbeam
> juju attach-resource openstack-exporter openstack-exporter-image=openstack-exporter:1.6.0-7533071
> juju attach-resource openstack-exporter openstack-exporter-image=openstack-exporter:1.7.0
```
10 changes: 9 additions & 1 deletion rocks/openstack-exporter/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ parts:
- CGO_ENABLED: "0"
- GOFLAGS: -mod=readonly -ldflags=-s
build-snaps:
- go/1.21/stable
- go/1.22/stable
override-prime: |
craftctl default
folders=(/etc/os-exporter /usr/local/share/ca-certificates)
for folder in "${folders[@]}"; do
mkdir -p $CRAFT_PRIME/$folder
chown 584792:584792 $CRAFT_PRIME/$folder
chmod 750 $CRAFT_PRIME/$folder
done

0 comments on commit 8ede68d

Please sign in to comment.