forked from openshift/assisted-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
35 lines (29 loc) · 1.39 KB
/
config.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
package cnv
import (
"strings"
)
type DeviceIDDecoder map[string]bool
type Config struct {
// List of supported GPUs: https://issues.redhat.com/browse/CNV-7749
SupportedGPUs DeviceIDDecoder `envconfig:"CNV_SUPPORTED_GPUS" default:"10de:1db6,10de:1eb8"`
// List of supported SR-IOV NICs: https://docs.openshift.com/container-platform/4.7/networking/hardware_networks/about-sriov.html#supported-devices_about-sriov
SupportedSRIOVNetworkIC DeviceIDDecoder `envconfig:"CNV_SUPPORTED_SRIOV_NICS" default:"8086:158b,15b3:1015,15b3:1017,15b3:1013,15b3:101b"`
// CNV operator mode. It defines whether to use upstream `false` or downstream `true`
Mode bool `envconfig:"CNV_MODE" default:"true"`
// HPP install flag. It defines whether we should install HPP when CNV is on SNO
SNOInstallHPP bool `envconfig:"CNV_SNO_INSTALL_HPP" default:"true"`
// In CNV+SNO we'll deploy the HPP storage provisioner. This defines the request size for the storage pool that backs HPP; we validate by checking host's disks against this value
SNOPoolSizeRequestHPPGib int64 `envconfig:"CNV_SNO_POOL_SIZE_REQUEST_HPP_GIB" default:"50"`
}
func (d *DeviceIDDecoder) Decode(value string) error {
deviceIDSet := make(DeviceIDDecoder)
*d = deviceIDSet
if strings.TrimSpace(value) == "" {
return nil
}
devices := strings.Split(value, ",")
for _, device := range devices {
deviceIDSet[strings.ToLower(device)] = true
}
return nil
}