Skip to content

Commit df96d34

Browse files
authored
Merge pull request #145 from yangcao77/get-library200
update to library 2.0.1
2 parents 83052e3 + f6b97b7 commit df96d34

File tree

1,076 files changed

+136882
-15596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,076 files changed

+136882
-15596
lines changed

index/generator/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module github.com/devfile/registry-support/index/generator
33
go 1.14
44

55
require (
6-
github.com/devfile/api/v2 v2.0.0-20220117162434-6e6e6a8bc14c
7-
github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de
6+
github.com/devfile/api/v2 v2.2.0
7+
github.com/devfile/library/v2 v2.0.1
88
github.com/go-git/go-git/v5 v5.4.2
99
github.com/mitchellh/go-homedir v1.1.0
1010
github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249
11-
github.com/spf13/cobra v1.1.1
12-
github.com/spf13/viper v1.7.1
11+
github.com/spf13/cobra v1.2.1
12+
github.com/spf13/viper v1.8.1
1313
github.com/stretchr/testify v1.7.0
1414
gopkg.in/yaml.v2 v2.4.0
1515
k8s.io/apiextensions-apiserver v0.21.3

index/generator/go.sum

Lines changed: 682 additions & 27 deletions
Large diffs are not rendered by default.

index/generator/library/library.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323
"path"
2424
"path/filepath"
2525

26-
devfileParser "github.com/devfile/library/pkg/devfile"
27-
"github.com/devfile/library/pkg/devfile/parser"
26+
devfileParser "github.com/devfile/library/v2/pkg/devfile"
27+
"github.com/devfile/library/v2/pkg/devfile/parser"
2828
"github.com/devfile/registry-support/index/generator/schema"
2929
"gopkg.in/yaml.v2"
3030
)
@@ -299,10 +299,12 @@ func parseStackDevfile(devfileDirPath string, stackName string, force bool, vers
299299
if fileExists(devfileHiddenPath) {
300300
devfilePath = devfileHiddenPath
301301
}
302-
302+
convertUri := false
303303
if !force {
304304
// Devfile validation
305-
devfileObj, _, err := devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath})
305+
devfileObj, _, err := devfileParser.ParseDevfileAndValidate(parser.ParserArgs{
306+
ConvertKubernetesContentInUri: &convertUri,
307+
Path: devfilePath})
306308
if err != nil {
307309
return fmt.Errorf("%s devfile is not valid: %v", devfileDirPath, err)
308310
}
@@ -447,9 +449,11 @@ func parseExtraDevfileEntries(registryDirPath string, force bool) ([]schema.Sche
447449
// This error shouldn't occur since we check for the devfile's existence during registry build, but check for it regardless
448450
return nil, fmt.Errorf("%s devfile sample does not have a devfile.yaml: %v", indexComponent.Name, err)
449451
}
450-
452+
convertUri := false
451453
// Validate the sample devfile
452-
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath})
454+
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{
455+
ConvertKubernetesContentInUri: &convertUri,
456+
Path: devfilePath})
453457
if err != nil {
454458
return nil, fmt.Errorf("%s sample devfile is not valid: %v", devfileEntry.Name, err)
455459
}
@@ -461,9 +465,10 @@ func parseExtraDevfileEntries(registryDirPath string, force bool) ([]schema.Sche
461465
// This error shouldn't occur since we check for the devfile's existence during registry build, but check for it regardless
462466
return nil, fmt.Errorf("%s devfile sample does not have a devfile.yaml: %v", indexComponent.Name, err)
463467
}
464-
468+
convertUri := false
465469
// Validate the sample devfile
466-
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath})
470+
_, _, err = devfileParser.ParseDevfileAndValidate(parser.ParserArgs{Path: devfilePath,
471+
ConvertKubernetesContentInUri: &convertUri})
467472
if err != nil {
468473
return nil, fmt.Errorf("%s sample devfile is not valid: %v", devfileEntry.Name, err)
469474
}

index/generator/library/library_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424

2525
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
2626
devfilepkg "github.com/devfile/api/v2/pkg/devfile"
27-
"github.com/devfile/library/pkg/devfile/parser"
28-
v2 "github.com/devfile/library/pkg/devfile/parser/data/v2"
27+
"github.com/devfile/library/v2/pkg/devfile/parser"
28+
v2 "github.com/devfile/library/v2/pkg/devfile/parser/data/v2"
2929
"github.com/devfile/registry-support/index/generator/schema"
3030
"github.com/nsf/jsondiff"
3131
"github.com/stretchr/testify/assert"

index/generator/library/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import (
2929
"strings"
3030
"syscall"
3131

32-
"github.com/devfile/library/pkg/testingutil/filesystem"
33-
dfutil "github.com/devfile/library/pkg/util"
32+
"github.com/devfile/library/v2/pkg/testingutil/filesystem"
33+
dfutil "github.com/devfile/library/v2/pkg/util"
3434
"github.com/devfile/registry-support/index/generator/schema"
3535
gitpkg "github.com/go-git/go-git/v5"
3636
"github.com/go-git/go-git/v5/plumbing"

index/generator/vendor/github.com/Azure/go-ansiterm/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index/generator/vendor/github.com/Azure/go-ansiterm/README.md

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index/generator/vendor/github.com/Azure/go-ansiterm/constants.go

Lines changed: 188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index/generator/vendor/github.com/Azure/go-ansiterm/context.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index/generator/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)