Skip to content

Commit

Permalink
Set maestro as source
Browse files Browse the repository at this point in the history
Signed-off-by: clyang82 <[email protected]>
  • Loading branch information
clyang82 committed May 23, 2024
1 parent 5a3ead6 commit 3be7edc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/api/presenters/resource.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package presenters

import (
"gorm.io/datatypes"

"github.com/openshift-online/maestro/pkg/api"
"github.com/openshift-online/maestro/pkg/api/openapi"
"github.com/openshift-online/maestro/pkg/constants"
"github.com/openshift-online/maestro/pkg/util"
"gorm.io/datatypes"
)

// ConvertResource converts a resource from the API to the openapi representation.
Expand All @@ -20,8 +22,10 @@ func ConvertResource(resource openapi.Resource) (*api.Resource, error) {
},
ConsumerName: util.NilToEmptyString(resource.ConsumerName),
Version: util.NilToEmptyInt32(resource.Version),
Type: api.ResourceTypeSingle,
Manifest: manifest,
// Set the default source ID for RESTful API calls and do not allow modification
Source: constants.DefaultSourceID,
Type: api.ResourceTypeSingle,
Manifest: manifest,
}, nil
}

Expand Down
5 changes: 5 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package constants

const (
DefaultSourceID = "maestro"
)

0 comments on commit 3be7edc

Please sign in to comment.