Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set maestro as source #98

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
)
Loading