diff --git a/go.mod b/go.mod index ba929fab..d413cafa 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index b46f0531..d2feebea 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/models/patterns/pattern.go b/models/patterns/pattern.go index e3f5a5bc..4b76a22b 100644 --- a/models/patterns/pattern.go +++ b/models/patterns/pattern.go @@ -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 == "" { @@ -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) diff --git a/validator/validate_test.go b/validator/validate_test.go index 6afc9f56..5db1ec85 100644 --- a/validator/validate_test.go +++ b/validator/validate_test.go @@ -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 { @@ -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, },