Skip to content

Commit

Permalink
delete redundant codes in spec (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan authored Apr 19, 2023
1 parent 103d18b commit 3a0f50c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pkg/engine/models/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,3 @@ package models
type Spec struct {
Resources Resources `json:"resources" yaml:"resources"`
}

// fixme: get `cluster` from compile arguments

// ParseCluster try to parse Cluster from resource extensions.
// All resources in one compile MUST have the same Cluster and this constraint will be guaranteed by KCL compile logic
func (s *Spec) ParseCluster() string {
resources := s.Resources
var cluster string
if len(resources) != 0 && resources[0].Extensions != nil && resources[0].Extensions["Cluster"] != nil {
cluster = resources[0].Extensions["Cluster"].(string)
}
return cluster
}

0 comments on commit 3a0f50c

Please sign in to comment.