Skip to content

Commit

Permalink
bump design version on evaluation
Browse files Browse the repository at this point in the history
Signed-off-by: aabidsofi19 <[email protected]>
  • Loading branch information
aabidsofi19 committed Jan 3, 2025
1 parent fec83b1 commit 5ce2dfc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/handlers/policy_relationship_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"time"

"github.com/Masterminds/semver/v3"
"github.com/gofrs/uuid"
"github.com/gorilla/mux"
"github.com/layer5io/meshery/server/models"
Expand Down Expand Up @@ -119,6 +120,15 @@ func processEvaluationResponse(registry *registry.RegistryManager, evalPayload p
compsUpdated := []component.ComponentDefinition{}
compsAdded := []component.ComponentDefinition{}

// Bump the version of design
oldVersion, versionParseErr := semver.NewVersion(evalResponse.Design.Version)
if versionParseErr != nil {
oldVersion = semver.MustParse("0.0.0")
}

newVersion := oldVersion.IncPatch()
evalResponse.Design.Version = newVersion.String()

// components which were added by the evaluator based on the relationship definition, but doesn't exist in the registry.
unknownComponents := []*component.ComponentDefinition{}

Expand Down

0 comments on commit 5ce2dfc

Please sign in to comment.