Skip to content

Commit

Permalink
Merge branch 'master' into operator/install
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohd Uzair authored Aug 21, 2024
2 parents 0bc3bc4 + 9fdbc52 commit b729c30
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 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.6.0
github.com/kubernetes/kompose v1.31.1
github.com/layer5io/meshery-operator v0.7.0
github.com/meshery/schemas v0.7.18
github.com/meshery/schemas v0.7.19
github.com/nats-io/nats.go v1.31.0
github.com/open-policy-agent/opa v0.67.1
github.com/opencontainers/image-spec v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
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.18 h1:gXHDiPmlLKywfaE3nm5YRdjhWRMTUEsfVvZlJjB93Ug=
github.com/meshery/schemas v0.7.18/go.mod h1:UfiO+zm92yLkaJP0aroNwVnjuozoh793AWDXrKDYmT0=
github.com/meshery/schemas v0.7.19 h1:HS+PCZ3ZXbs7cv0JSUNW3kYnbypt3WqZjQ7fMQPy8uo=
github.com/meshery/schemas v0.7.19/go.mod h1:UfiO+zm92yLkaJP0aroNwVnjuozoh793AWDXrKDYmT0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=
github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk=
Expand Down
4 changes: 2 additions & 2 deletions models/meshmodel/core/policies/rego_policy_relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ func (r *Rego) RegoPolicyHandler(designFile pattern.PatternFile, regoQueryString
return evaluationResponse, ErrEval(fmt.Errorf("evaluation results are empty"))
}

evaluatedPatternFile, err := utils.MarshalAndUnmarshal[interface{}, pattern.PatternFile](evalResults)
evaluationResponse, err = utils.MarshalAndUnmarshal[interface{}, pattern.EvaluationResponse](evalResults)
if err != nil {
return evaluationResponse, err
}
evaluationResponse.Design = evaluatedPatternFile

return evaluationResponse, nil

}
4 changes: 0 additions & 4 deletions models/meshmodel/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ func (rm *RegistryManager) GetEntities(f entity.Filter) ([]entity.Entity, int64,
return f.Get(rm.db)
}

func (rm *RegistryManager) GetEntityById(f entity.Filter) (entity.Entity, error) {
return f.GetById(rm.db)
}

func HostnameToPascalCase(input string) string {
parts := strings.Split(input, ".")
caser := cases.Title(language.English)
Expand Down
6 changes: 4 additions & 2 deletions models/meshmodel/registry/v1beta1/model_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func countUniqueModels(models []model.ModelDefinition) int {
}
return len(set)
}

func (mf *ModelFilter) GetById(db *database.Handler) (entity.Entity, error) {
m := &model.ModelDefinition{}

Expand Down Expand Up @@ -102,6 +101,9 @@ func (mf *ModelFilter) Get(db *database.Handler) ([]entity.Entity, int64, int, e
var includeComponents, includeRelationships bool

if mf.Greedy {
if mf.Id != "" {
finder = finder.First("model_dbs.id = ?", mf.Id)
}
if mf.Name != "" && mf.DisplayName != "" {
finder = finder.Where("model_dbs.name LIKE ? OR model_dbs.display_name LIKE ?", "%"+mf.Name+"%", "%"+mf.DisplayName+"%")
} else if mf.Name != "" {
Expand Down Expand Up @@ -180,7 +182,7 @@ func (mf *ModelFilter) Get(db *database.Handler) ([]entity.Entity, int64, int, e
if includeComponents {
var components []component.ComponentDefinition
finder := db.Model(&component.ComponentDefinition{}).
Select("component_definition_dbs.id, component_definition_dbs.component, component_definition_dbs.display_name, component_definition_dbs.metadata, component_definition_dbs.schema_version, component_definition_dbs.version").
Select("component_definition_dbs.id, component_definition_dbs.component, component_definition_dbs.display_name, component_definition_dbs.metadata, component_definition_dbs.schema_version, component_definition_dbs.version,component_definition_dbs.styles").
Where("component_definition_dbs.model_id = ?", _modelDB.Id)
if err := finder.Scan(&components).Error; err != nil {
return nil, 0, 0, err
Expand Down
2 changes: 1 addition & 1 deletion models/registration/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

/*
RegistrationErrorStore stores all the errors that does not break the registration process, but have to be reported nevertheless.
RegistrationErrorStore stores all the errors that does not break the registration process, but have to be reported nevertheless.
*/
type RegistrationErrorStore interface {
AddInvalidDefinition(string, error)
Expand Down
2 changes: 1 addition & 1 deletion models/registration/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (rh *RegistrationHelper) register(pkg packagingUnit) {
}

}

model.Registrant.Status = connection.Registered
_, _, err := rh.regManager.RegisterEntity(
model.Registrant,
Expand Down

0 comments on commit b729c30

Please sign in to comment.