github.com/smartcontractkit/chainlink-testing-framework/libs@v0.0.0-20240227141906-ec710b4eb1a3/k8s/pkg/helm/mockserver-cfg/mockserver-cfg.go (about) 1 package mockserver_cfg 2 3 import ( 4 "fmt" 5 "os" 6 "strconv" 7 8 "github.com/smartcontractkit/chainlink-testing-framework/libs/k8s/config" 9 "github.com/smartcontractkit/chainlink-testing-framework/libs/k8s/environment" 10 "github.com/smartcontractkit/chainlink-testing-framework/libs/utils/projectpath" 11 ) 12 13 type Props struct { 14 } 15 16 type Chart struct { 17 Name string 18 Path string 19 Version string 20 Props *Props 21 Values *map[string]interface{} 22 } 23 24 func (m Chart) IsDeploymentNeeded() bool { 25 return true 26 } 27 28 func (m Chart) GetName() string { 29 return m.Name 30 } 31 32 func (m Chart) GetProps() interface{} { 33 return m.Props 34 } 35 36 func (m Chart) GetPath() string { 37 return m.Path 38 } 39 40 func (m Chart) GetVersion() string { 41 return m.Version 42 } 43 44 func (m Chart) GetValues() *map[string]interface{} { 45 return m.Values 46 } 47 48 func (m Chart) ExportData(e *environment.Environment) error { 49 return nil 50 } 51 52 func New(props map[string]interface{}) environment.ConnectedChart { 53 return NewVersioned("", props) 54 } 55 56 // NewVersioned enables choosing a specific helm chart version 57 func NewVersioned(helmVersion string, props map[string]interface{}) environment.ConnectedChart { 58 chartPath := "chainlink-qa/mockserver-config" 59 if b, err := strconv.ParseBool(os.Getenv(config.EnvVarLocalCharts)); err == nil && b { 60 chartPath = fmt.Sprintf("%s/mockserver-config", projectpath.ChartsRoot) 61 } 62 return Chart{ 63 Name: "mockserver-cfg", 64 Path: chartPath, 65 Values: &props, 66 Version: helmVersion, 67 } 68 }