Skip to content

Commit

Permalink
Add registry option to download commands
Browse files Browse the repository at this point in the history
New eden workflows take eve registry and tag as a parameter
and set it up as default. During eve upgrade testing
`eden utils download eve-rootfs` is called which is using
default registry, however intended behaviour would be to
use `lf-edge/eve` registry. Adding this parameter and
setting it in upgrade test makes download util use
lf-edge/eve registry

Signed-off-by: Pavel Abramov <[email protected]>
  • Loading branch information
uncleDecart committed Sep 29, 2023
1 parent 8610724 commit e6d7504
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func newDownloadEVERootFSCmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
downloadEVERootFSCmd.Flags().StringVarP(&cfg.Eve.Tag, "eve-tag", "", defaults.DefaultEVETag, "tag to download")
downloadEVERootFSCmd.Flags().StringVarP(&cfg.Eve.Arch, "eve-arch", "", runtime.GOARCH, "arch of EVE")
downloadEVERootFSCmd.Flags().StringVarP(&cfg.Eve.HV, "eve-hv", "", defaults.DefaultEVEHV, "HV of EVE (kvm or xen)")
downloadEVERootFSCmd.Flags().StringVarP(&cfg.Eve.Registry, "eve-registry", "", defaults.DefaultEveRegistry, "eve registry to download image from (default lf-edge/eve)")
downloadEVERootFSCmd.Flags().StringVarP(&outputDir, "downloader-dist", "d", "", "output directory")

return downloadEVERootFSCmd
Expand All @@ -93,6 +94,7 @@ func newDownloadEVECmd(cfg *openevec.EdenSetupArgs) *cobra.Command {
downloadEVECmd.Flags().StringVarP(&cfg.Eve.ImageFile, "image-file", "i", "", "path for image drive")
downloadEVECmd.Flags().StringVarP(&cfg.Adam.Dist, "adam-dist", "", cfg.Adam.Dist, "adam dist to start")
downloadEVECmd.Flags().IntVar(&cfg.Eve.ImageSizeMB, "image-size", defaults.DefaultEVEImageSize, "Image size of EVE in MB")
downloadEVECmd.Flags().StringVarP(&cfg.Eve.Registry, "eve-registry", "", defaults.DefaultEveRegistry, "eve registry to download image from (default lf-edge/eve)")

return downloadEVECmd
}
5 changes: 4 additions & 1 deletion tests/update_eve_image/testdata/update_eve_image_http.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Default EVE version to update
{{$eve_ver := "8.7.0"}}

# Default EVE registry to update
{{$eve_registry := "lfedge/eve"}}

# Obtain EVE version from environment variable EVE_VERSION
{{$env := EdenGetEnv "EVE_VERSION"}}

Expand All @@ -25,7 +28,7 @@ eden controller edge-node update --config timer.test.baseimage.update=30

# Download EVE rootfs into eve-dist
message 'EVE image download'
eden -t 10m utils download eve-rootfs --eve-tag={{$eve_ver}} --eve-hv={{$eve_hv}} --downloader-dist={{EdenConfigPath "eve.dist"}} -v debug
eden -t 10m utils download eve-rootfs --eve-tag={{$eve_ver}} --eve-hv={{$eve_hv}} --eve-registry={{$eve_registry}} --downloader-dist={{EdenConfigPath "eve.dist"}} -v debug

# Check stdout of previous command. Expected to get full path to squashfs
stdout '{{EdenConfigPath "eve.dist"}}/rootfs-{{ $short_version }}.squashfs'
Expand Down
2 changes: 1 addition & 1 deletion tests/update_eve_image/testdata/update_eve_image_oci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Default EVE version to update
{{$eve_ver := "8.6.0"}}
{{$eve_ver := "8.7.0"}}

# Obtain EVE version from environment variable EVE_VERSION
{{$env := EdenGetEnv "EVE_VERSION"}}
Expand Down

0 comments on commit e6d7504

Please sign in to comment.