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

update to library 2.0.1 #145

Merged
merged 2 commits into from
Oct 18, 2022
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions index/generator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/devfile/registry-support/index/generator
go 1.14

require (
github.com/devfile/api/v2 v2.0.0-20220117162434-6e6e6a8bc14c
github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de
github.com/devfile/api/v2 v2.2.0
github.com/devfile/library/v2 v2.0.1
github.com/go-git/go-git/v5 v5.4.2
github.com/mitchellh/go-homedir v1.1.0
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249
github.com/spf13/cobra v1.1.1
github.com/spf13/viper v1.7.1
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/apiextensions-apiserver v0.21.3
Expand Down
709 changes: 682 additions & 27 deletions index/generator/go.sum

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions index/generator/library/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"path"
"path/filepath"

devfileParser "github.com/devfile/library/pkg/devfile"
"github.com/devfile/library/pkg/devfile/parser"
devfileParser "github.com/devfile/library/v2/pkg/devfile"
"github.com/devfile/library/v2/pkg/devfile/parser"
"github.com/devfile/registry-support/index/generator/schema"
"gopkg.in/yaml.v2"
)
Expand Down Expand Up @@ -299,10 +299,12 @@ func parseStackDevfile(devfileDirPath string, stackName string, force bool, vers
if fileExists(devfileHiddenPath) {
devfilePath = devfileHiddenPath
}

convertUri := false
if !force {
// Devfile validation
devfileObj, _, err := devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath})
devfileObj, _, err := devfileParser.ParseDevfileAndValidate(parser.ParserArgs{
ConvertKubernetesContentInUri: &convertUri,
Path: devfilePath})
if err != nil {
return fmt.Errorf("%s devfile is not valid: %v", devfileDirPath, err)
}
Expand Down Expand Up @@ -447,9 +449,11 @@ func parseExtraDevfileEntries(registryDirPath string, force bool) ([]schema.Sche
// This error shouldn't occur since we check for the devfile's existence during registry build, but check for it regardless
return nil, fmt.Errorf("%s devfile sample does not have a devfile.yaml: %v", indexComponent.Name, err)
}

convertUri := false
// Validate the sample devfile
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath})
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{
ConvertKubernetesContentInUri: &convertUri,
Path: devfilePath})
if err != nil {
return nil, fmt.Errorf("%s sample devfile is not valid: %v", devfileEntry.Name, err)
}
Expand All @@ -461,9 +465,10 @@ func parseExtraDevfileEntries(registryDirPath string, force bool) ([]schema.Sche
// This error shouldn't occur since we check for the devfile's existence during registry build, but check for it regardless
return nil, fmt.Errorf("%s devfile sample does not have a devfile.yaml: %v", indexComponent.Name, err)
}

convertUri := false
// Validate the sample devfile
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath})
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath,
ConvertKubernetesContentInUri: &convertUri})
if err != nil {
return nil, fmt.Errorf("%s sample devfile is not valid: %v", devfileEntry.Name, err)
}
Expand Down
4 changes: 2 additions & 2 deletions index/generator/library/library_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
devfilepkg "github.com/devfile/api/v2/pkg/devfile"
"github.com/devfile/library/pkg/devfile/parser"
v2 "github.com/devfile/library/pkg/devfile/parser/data/v2"
"github.com/devfile/library/v2/pkg/devfile/parser"
v2 "github.com/devfile/library/v2/pkg/devfile/parser/data/v2"
"github.com/devfile/registry-support/index/generator/schema"
"github.com/nsf/jsondiff"
"github.com/stretchr/testify/assert"
Expand Down
4 changes: 2 additions & 2 deletions index/generator/library/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"strings"
"syscall"

"github.com/devfile/library/pkg/testingutil/filesystem"
dfutil "github.com/devfile/library/pkg/util"
"github.com/devfile/library/v2/pkg/testingutil/filesystem"
dfutil "github.com/devfile/library/v2/pkg/util"
"github.com/devfile/registry-support/index/generator/schema"
gitpkg "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading