diff --git a/index/generator/library/library.go b/index/generator/library/library.go index a629d3ac..b7798327 100644 --- a/index/generator/library/library.go +++ b/index/generator/library/library.go @@ -295,12 +295,11 @@ func parseDevfileRegistry(registryDirPath string, force bool) ([]schema.Schema, } } } else { // if stack.yaml not exist, old stack repo struct, directly lookfor & parse devfile.yaml - versionComponent := schema.Version{} + versionComponent := schema.Version{Default: true} err := parseStackDevfile(stackFolderPath, stackFolderDir.Name(), force, &versionComponent, &indexComponent) if err != nil { return nil, err } - versionComponent.Default = true indexComponent.Versions = append(indexComponent.Versions, versionComponent) } indexComponent.Type = schema.StackDevfileType @@ -441,9 +440,11 @@ func parseStackDevfile(devfileDirPath string, stackName string, force bool, vers versionComponent.StarterProjects = append(versionComponent.StarterProjects, starterProject.Name) } - for _, tag := range versionComponent.Tags { - if !inArray(indexComponent.Tags, tag) { - indexComponent.Tags = append(indexComponent.Tags, tag) + if versionComponent.Default { + for _, tag := range versionComponent.Tags { + if !inArray(indexComponent.Tags, tag) { + indexComponent.Tags = append(indexComponent.Tags, tag) + } } } diff --git a/index/generator/tests/registry/index_main.json b/index/generator/tests/registry/index_main.json index 1c7db163..53cfb7bc 100644 --- a/index/generator/tests/registry/index_main.json +++ b/index/generator/tests/registry/index_main.json @@ -4,7 +4,7 @@ "displayName": "Go Runtime", "description": "Stack with the latest Go version", "type": "stack", - "tags": ["testtag", "Go"], + "tags": ["Go"], "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg", "projectType": "go", "language": "go", diff --git a/index/generator/tests/registry/index_registry.json b/index/generator/tests/registry/index_registry.json index d2804653..802f6b9a 100644 --- a/index/generator/tests/registry/index_registry.json +++ b/index/generator/tests/registry/index_registry.json @@ -4,7 +4,7 @@ "displayName": "Go Runtime", "description": "Stack with the latest Go version", "type": "stack", - "tags": ["testtag", "Go"], + "tags": ["Go"], "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg", "projectType": "go", "language": "go",