Allow fetching specific devfile stack version (#6429)

* Ask for stack version in the interactive mode; downloading still doesn't work as expected

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Download the versioned Devfile for interactive mode

* Download the versioned Devfile for flag mode

* Download the versioned Devfile for the alizer mode

* Add support for 'latest' stack

* Update init automation message with devfile-version

* Mark the default version in interactive mode

* Fix interactive tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add integration tests for odo init flag mode

* Fix unit and validation tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add to the documentation

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add information about the default version

Signed-off-by: Parthvi Vala <pvala@redhat.com>
This commit is contained in:
Parthvi Vala
2022-12-21 19:44:40 +05:30
committed by GitHub
parent 46abd92226
commit 0d392ef5bd
21 changed files with 274 additions and 56 deletions

View File

@@ -270,7 +270,8 @@ func (o RegistryClient) retrieveDevfileDataFromRegistry(ctx context.Context, reg
registries := o.preferenceClient.RegistryList()
var reg preference.Registry
registryOptions := segment.GetRegistryOptions(ctx)
registryOptions.NewIndexSchema = true
// Get the file and save it to the temporary file
// Why do we do that?
// 1. We need to get the file from the registry
@@ -279,7 +280,7 @@ func (o RegistryClient) retrieveDevfileDataFromRegistry(ctx context.Context, reg
// 4. We need to read the file from the temporary file, unmarshal it and then return the devfile data
for _, reg = range registries {
if reg.Name == registryName {
err = o.PullStackFromRegistry(reg.URL, devfileName, tmpFile, segment.GetRegistryOptions(ctx))
err = o.PullStackFromRegistry(reg.URL, devfileName, tmpFile, registryOptions)
if err != nil {
return api.DevfileData{}, err
}