Skip to content

Commit

Permalink
define version and group for entities
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Jul 8, 2024
1 parent b263478 commit 6ef83f2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion models/meshmodel/core/v1alpha2/relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"gorm.io/gorm/clause"
)

const SchemaVersion = "core.meshery.io/v1alpha2"
const RelationshipSchemaVersion = "relationships.meshery.io/v1alpha2"

type RelationshipDefinition struct {
ID uuid.UUID `json:"id"`
Expand Down
2 changes: 2 additions & 0 deletions models/meshmodel/core/v1beta1/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const (
JSON ComponentFormat = "JSON"
YAML ComponentFormat = "YAML"
CUE ComponentFormat = "CUE"

ComponentSchemaVersion = "components.meshery.io/v1beta1"
)

// Contains information as extracted from the core underlying component eg: Pod's apiVersion, kind and schema
Expand Down
2 changes: 1 addition & 1 deletion models/meshmodel/core/v1beta1/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"gorm.io/gorm/clause"
)

const SchemaVersion = "core.meshery.io/v1beta1"
const ModelSchemaVersion = "models.meshery.io/v1beta1"

var modelCreationLock sync.Mutex //Each component/relationship will perform a check and if the model already doesn't exist, it will create a model. This lock will make sure that there are no race conditions.

Expand Down
2 changes: 1 addition & 1 deletion utils/component/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var Configs = []CuePathConfig{DefaultPathConfig, DefaultPathConfig2}

func Generate(crd string) (v1beta1.ComponentDefinition, error) {
component := v1beta1.ComponentDefinition{}
component.SchemaVersion = v1beta1.SchemaVersion
component.SchemaVersion = v1beta1.ComponentSchemaVersion

component.Metadata = make(map[string]interface{})
crdCue, err := utils.YamlToCue(crd)
Expand Down

0 comments on commit 6ef83f2

Please sign in to comment.