Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
Signed-off-by: ashish <[email protected]>
  • Loading branch information
Revolyssup committed Jan 21, 2022
1 parent 7ccde37 commit 3bd83bb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions osm/oam/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (

// AvailableVersions denote the component versions available statically
var AvailableVersions = map[string]bool{}
var pathSets []schemaDefinitionPathSet

type schemaDefinitionPathSet struct {
oamDefinitionPath string
Expand All @@ -33,11 +34,6 @@ type schemaDefinitionPathSet struct {
func RegisterWorkloads(runtime, host string) error {
oamRDP := []adapter.OAMRegistrantDefinitionPath{}

pathSets, err := load(WorkloadPath)
if err != nil {
return err
}

for _, pathSet := range pathSets {
metadata := map[string]string{
config.OAMAdapterNameMetadataKey: config.OSMOperation,
Expand Down Expand Up @@ -122,3 +118,11 @@ func load(basePath string) ([]schemaDefinitionPathSet, error) {

return res, nil
}

func init() {
var err error
pathSets, err = load(WorkloadPath)
if err != nil {
fmt.Println("Err loading components: ", err.Error())
}
}

0 comments on commit 3bd83bb

Please sign in to comment.