This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default cluster pool assignments to config
Signed-off-by: Katrina Rogan <katroganGH@gmail.com>
- Loading branch information
Showing
8 changed files
with
144 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package runtime | ||
|
||
import ( | ||
"github.com/flyteorg/flyteadmin/pkg/runtime/interfaces" | ||
|
||
"github.com/flyteorg/flytestdlib/config" | ||
) | ||
|
||
const clusterPoolsKey = "cluster_pools" | ||
|
||
var clusterPoolsConfig = config.MustRegisterSection(clusterPoolsKey, &interfaces.ClusterPoolAssignmentConfig{ | ||
ClusterPoolAssignments: make(interfaces.ClusterPoolAssignments), | ||
}) | ||
|
||
// Implementation of an interfaces.QueueConfiguration | ||
type ClusterPoolAssignmentConfigurationProvider struct{} | ||
|
||
func (p *ClusterPoolAssignmentConfigurationProvider) GetClusterPoolAssignments() interfaces.ClusterPoolAssignments { | ||
return clusterPoolsConfig.GetConfig().(*interfaces.ClusterPoolAssignmentConfig).ClusterPoolAssignments | ||
} | ||
|
||
func NewClusterPoolAssignmentConfigurationProvider() interfaces.ClusterPoolAssignmentConfiguration { | ||
return &ClusterPoolAssignmentConfigurationProvider{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package interfaces | ||
|
||
//go:generate mockery -name ClusterPoolAssignmentConfiguration -output=mocks -case=underscore | ||
|
||
type ClusterPoolAssignment struct { | ||
Pool string `json:"pool"` | ||
} | ||
|
||
type ClusterPoolAssignments = map[DomainName]ClusterPoolAssignment | ||
|
||
type ClusterPoolAssignmentConfig struct { | ||
ClusterPoolAssignments ClusterPoolAssignments `json:"clusterPoolAssignments"` | ||
} | ||
|
||
type ClusterPoolAssignmentConfiguration interface { | ||
GetClusterPoolAssignments() ClusterPoolAssignments | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
pkg/runtime/interfaces/mocks/cluster_pool_assignment_configuration.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters