Skip to content

Commit

Permalink
bump schemas to v0.7.9
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Jul 3, 2024
1 parent 4fb3efa commit b630388
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/google/uuid v1.5.0
github.com/kubernetes/kompose v1.31.1
github.com/layer5io/meshery-operator v0.7.0
github.com/meshery/schemas v0.7.8
github.com/meshery/schemas v0.7.9
github.com/nats-io/nats.go v1.31.0
github.com/open-policy-agent/opa v0.57.1
github.com/opencontainers/image-spec v1.1.0-rc6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvls
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/meshery/kompose v1.0.1 h1:lg8B/pkLh6762jeFsQATD8UJZZwXZf/aviC3/dzw78A=
github.com/meshery/kompose v1.0.1/go.mod h1:TWhWTEMbJBUzENf4JTEtBmZRFm/r8n0nS6v4/nSD2vA=
github.com/meshery/schemas v0.7.8 h1:OZwGhIWsKr+L7C6ZelZoOFx2Rz+Cu7swF1VVy/Dx4ks=
github.com/meshery/schemas v0.7.8/go.mod h1:ZsfoE5HvlqJvUvBlqS2rHoNQoDJ+eYuly5w5m+qIQSM=
github.com/meshery/schemas v0.7.9 h1:7rA9RfRfbYRGONYMUbfgen2j+jsKgfjqHPuUYOhjwyA=
github.com/meshery/schemas v0.7.9/go.mod h1:ZsfoE5HvlqJvUvBlqS2rHoNQoDJ+eYuly5w5m+qIQSM=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
Expand Down
10 changes: 5 additions & 5 deletions models/patterns/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package patterns
import (
"github.com/Masterminds/semver/v3"
"github.com/layer5io/meshkit/utils"
"github.com/meshery/schemas/models/patterns"
"github.com/meshery/schemas/models/v1alpha2"
"gopkg.in/yaml.v2"
)

func GetNextVersion(p *patterns.PatternFile) (string, error) {
func GetNextVersion(p *v1alpha2.PatternFile) (string, error) {
// Existing patterns do not have version hence when trying to assign next version for such patterns, it will fail the validation.
// Hence, if version is not present, start versioning for those afresh.
if p.Version == "" {
Expand All @@ -24,12 +24,12 @@ func GetNextVersion(p *patterns.PatternFile) (string, error) {
return nextVersion, nil
}

func AssignVersion(p *patterns.PatternFile) {
func AssignVersion(p *v1alpha2.PatternFile) {
p.Version = semver.New(0, 0, 1, "", "").String()
}

func GetPatternFormat(patternFile string) (*patterns.PatternFile, error) {
pattern := patterns.PatternFile{}
func GetPatternFormat(patternFile string) (*v1alpha2.PatternFile, error) {
pattern := v1alpha2.PatternFile{}
err := yaml.Unmarshal([]byte(patternFile), &pattern)
if err != nil {
err = utils.ErrDecodeYaml(err)
Expand Down
6 changes: 3 additions & 3 deletions validator/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/layer5io/meshkit/models/catalog/v1alpha1"
"github.com/layer5io/meshkit/models/meshmodel/core/v1beta1"
"github.com/meshery/schemas/models/patterns"
"github.com/meshery/schemas/models/v1alpha2"
)

type ValidationCases struct {
Expand All @@ -20,9 +20,9 @@ func TestValidator(t *testing.T) {
tests := []ValidationCases{
{
Path: "design",
Resource: patterns.PatternFile{
Resource: v1alpha2.PatternFile{
Name: "test-design",
Services: make(map[string]*patterns.Service),
Services: make(map[string]*v1alpha2.Service),
},
ShouldPass: true,
},
Expand Down

0 comments on commit b630388

Please sign in to comment.