Skip to content

Commit

Permalink
Merge branch 'main' into modify_strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
clyang82 authored May 30, 2024
2 parents 1e38372 + 15b243a commit ac0dc92
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 ac0dc92

Please sign in to comment.