Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registry option to download commands #893

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
7 changes: 5 additions & 2 deletions tests/update_eve_image/testdata/update_eve_image_http.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Default EVE version to update
{{$eve_ver := "8.7.0"}}
{{$eve_ver := "9.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
7 changes: 5 additions & 2 deletions tests/update_eve_image/testdata/update_eve_image_oci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Default EVE version to update
{{$eve_ver := "8.6.0"}}
{{$eve_ver := "9.6.0"}}

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

# Obtain EVE version from environment variable EVE_VERSION
{{$env := EdenGetEnv "EVE_VERSION"}}
Expand Down Expand Up @@ -32,7 +35,7 @@ eden controller edge-node update --config timer.test.baseimage.update=30

# Send command to update eveimage from OCI image
message 'EVE update request'
eden -t 10m controller edge-node eveimage-update oci://docker.io/lfedge/eve:{{$eve_ver}}-{{$eve_hv}}-{{$eve_arch}} -m adam://
eden -t 10m controller edge-node eveimage-update oci://docker.io/{{$eve_registry}}:{{$eve_ver}}-{{$eve_hv}}-{{$eve_arch}} -m adam://

# Check stderr, it must be empty
! stderr .
Expand Down