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
/
configuration_provider.go
62 lines (51 loc) · 2.51 KB
/
configuration_provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package runtime
import (
"github.com/lyft/flyteadmin/pkg/runtime/interfaces"
)
// Implementation of an interfaces.Configuration
type ConfigurationProvider struct {
applicationConfiguration interfaces.ApplicationConfiguration
queueConfiguration interfaces.QueueConfiguration
clusterConfiguration interfaces.ClusterConfiguration
taskResourceConfiguration interfaces.TaskResourceConfiguration
whitelistConfiguration interfaces.WhitelistConfiguration
registrationValidationConfiguration interfaces.RegistrationValidationConfiguration
clusterResourceConfiguration interfaces.ClusterResourceConfiguration
namespaceMappingConfiguration interfaces.NamespaceMappingConfiguration
}
func (p *ConfigurationProvider) ApplicationConfiguration() interfaces.ApplicationConfiguration {
return p.applicationConfiguration
}
func (p *ConfigurationProvider) QueueConfiguration() interfaces.QueueConfiguration {
return p.queueConfiguration
}
func (p *ConfigurationProvider) ClusterConfiguration() interfaces.ClusterConfiguration {
return p.clusterConfiguration
}
func (p *ConfigurationProvider) TaskResourceConfiguration() interfaces.TaskResourceConfiguration {
return p.taskResourceConfiguration
}
func (p *ConfigurationProvider) WhitelistConfiguration() interfaces.WhitelistConfiguration {
return p.whitelistConfiguration
}
func (p *ConfigurationProvider) RegistrationValidationConfiguration() interfaces.RegistrationValidationConfiguration {
return p.registrationValidationConfiguration
}
func (p *ConfigurationProvider) ClusterResourceConfiguration() interfaces.ClusterResourceConfiguration {
return p.clusterResourceConfiguration
}
func (p *ConfigurationProvider) NamespaceMappingConfiguration() interfaces.NamespaceMappingConfiguration {
return p.namespaceMappingConfiguration
}
func NewConfigurationProvider() interfaces.Configuration {
return &ConfigurationProvider{
applicationConfiguration: NewApplicationConfigurationProvider(),
queueConfiguration: NewQueueConfigurationProvider(),
clusterConfiguration: NewClusterConfigurationProvider(),
taskResourceConfiguration: NewTaskResourceProvider(),
whitelistConfiguration: NewWhitelistConfigurationProvider(),
registrationValidationConfiguration: NewRegistrationValidationProvider(),
clusterResourceConfiguration: NewClusterResourceConfigurationProvider(),
namespaceMappingConfiguration: NewNamespaceMappingConfigurationProvider(),
}
}