Skip to content

Commit

Permalink
Merge 'release-0.9' into main
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Noacco <[email protected]>
  • Loading branch information
noaccOS committed Dec 9, 2024
2 parents d2b42c1 + 97c7032 commit cd77593
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Managed OTA operations expose the update target that created them in graphql ([#356](https://github.com/edgehog-device-manager/edgehog/issues/356).

## [0.9.3] - Unreleased
### Fixed
- Base Image deletion in S3 storage

## [0.9.2] - 2024-12-09
### Changed
- Update the docker-compose configuration to allow both physical and virtual devices
Expand Down
16 changes: 14 additions & 2 deletions backend/lib/edgehog/base_images/bucket_storage.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,20 @@ defmodule Edgehog.BaseImages.BucketStorage do
end

@impl Storage
def delete(%BaseImage{} = scope) do
%BaseImage{url: url} = scope
def delete(%BaseImage{} = base_image) do
%BaseImage{
url: url,
tenant_id: tenant_id,
version: base_image_version,
base_image_collection_id: base_image_collection_id
} = base_image

scope = %{
tenant_id: tenant_id,
base_image_collection_id: base_image_collection_id,
base_image_version: base_image_version
}

Uploaders.BaseImage.delete({url, scope})
end
end
12 changes: 7 additions & 5 deletions backend/priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,20 @@ tenant =
{status, realm_pk} =
read_key!.("SEEDS_REALM_PRIVATE_KEY_FILE", "SEEDS_REALM_ORIGINAL_FILE", "realm_private")

Astarte.create_realm!(
%{cluster_id: cluster.id, name: read_env_var.("SEEDS_REALM"), private_key: realm_pk},
tenant: tenant
)

if status == :default do
"""
You are using the default realm private key. \
This instance will not be able to connect to Astarte.
"""
|> String.trim_trailing("\n")
|> Logger.warning()
else
Edgehog.Tenants.reconcile_tenant(tenant)
end

Astarte.create_realm!(
%{cluster_id: cluster.id, name: read_env_var.("SEEDS_REALM"), private_key: realm_pk},
tenant: tenant
)

:ok
8 changes: 0 additions & 8 deletions doc/pages/tutorials/edgehog_in_5_minutes.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,6 @@ You can finally navigate to `http://edgehog.localhost` in your browser and login
## Test Astarte connection
Astarte connectivity may not work right away, as edgehog has not yet reconciled
its interfaces and triggers with astarte. Without waiting, we can force it to execute
the reconciler using:
```sh
$ docker compose exec edgehog-backend bin/edgehog rpc "Edgehog.Tenants.list_tenants |> Enum.each(&Edgehog.Tenants.reconcile_tenant/1)"
```
If you now connect a device to astarte and open or reload the edgehog web page,
you should see the new device in the appropriate section.
Expand Down

0 comments on commit cd77593

Please sign in to comment.