Skip to content

Commit f33d298

Browse files
authored
Update API Go module to add version to module path (#280)
Updates the Go module path of the Devfile API to add the major version to its path, allowing v2 (and higher) versions of the module to be published. Signed-off-by: John Collier <[email protected]>
1 parent 071eeca commit f33d298

35 files changed

+39
-37
lines changed

generator/overrides/gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (g Generator) Generate(ctx *genall.GenerationContext) error {
127127
genutils.WriteFormattedSourceFile(fileNamePart, ctx, root, func(buf *bytes.Buffer) {
128128
buf.WriteString(`
129129
import (
130-
attributes "github.com/devfile/api/pkg/attributes"
130+
attributes "github.com/devfile/api/v2/pkg/attributes"
131131
)
132132
133133
`)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/devfile/api
1+
module github.com/devfile/api/v2
22

33
go 1.13
44

pkg/apis/addtoscheme_workspaces_v1alpha2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package apis
22

33
import (
4-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
4+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
55
)
66

77
func init() {

pkg/apis/workspaces/v1alpha1/attributes_conversion.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package v1alpha1
22

33
import (
44
"fmt"
5-
"github.com/devfile/api/pkg/attributes"
5+
6+
"github.com/devfile/api/v2/pkg/attributes"
67
)
78

89
func convertAttributesTo_v1alpha2(src map[string]string, dest *attributes.Attributes) {

pkg/apis/workspaces/v1alpha1/commands_conversion.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package v1alpha1
22

33
import (
44
"encoding/json"
5-
"github.com/devfile/api/pkg/attributes"
65

7-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
6+
"github.com/devfile/api/v2/pkg/attributes"
7+
8+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
89
)
910

1011
func convertCommandTo_v1alpha2(src *Command, dest *v1alpha2.Command) error {

pkg/apis/workspaces/v1alpha1/commands_conversion_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package v1alpha1
33
import (
44
"testing"
55

6-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
6+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
77
"github.com/google/go-cmp/cmp"
88
fuzz "github.com/google/gofuzz"
99
"github.com/stretchr/testify/assert"

pkg/apis/workspaces/v1alpha1/components_conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package v1alpha1
33
import (
44
"encoding/json"
55

6-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
6+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
77
)
88

99
func convertComponentTo_v1alpha2(src *Component, dest *v1alpha2.Component) error {

pkg/apis/workspaces/v1alpha1/components_conversion_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package v1alpha1
33
import (
44
"testing"
55

6-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
6+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
77
"github.com/google/go-cmp/cmp"
88
fuzz "github.com/google/gofuzz"
99
"github.com/stretchr/testify/assert"

pkg/apis/workspaces/v1alpha1/conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package v1alpha1
22

33
import (
4-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
4+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
55
)
66

77
func convertDevWorkspaceTo_v1alpha2(src *DevWorkspace, dest *v1alpha2.DevWorkspace) error {

pkg/apis/workspaces/v1alpha1/conversion_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package v1alpha1
33
import (
44
"testing"
55

6-
"github.com/devfile/api/pkg/apis/workspaces/v1alpha2"
6+
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
77
"github.com/google/go-cmp/cmp"
88
fuzz "github.com/google/gofuzz"
99
"github.com/stretchr/testify/assert"

0 commit comments

Comments
 (0)