github.com/smartcontractkit/chainlink-testing-framework/libs@v0.0.0-20240227141906-ec710b4eb1a3/k8s/pkg/helm/influxdb/influxdb.go (about)

     1  package influxdb
     2  
     3  import (
     4  	"github.com/smartcontractkit/chainlink-testing-framework/libs/k8s/config"
     5  	"github.com/smartcontractkit/chainlink-testing-framework/libs/k8s/environment"
     6  )
     7  
     8  type Props struct {
     9  }
    10  
    11  type Chart struct {
    12  	Name    string
    13  	Path    string
    14  	Version string
    15  	Props   *Props
    16  	Values  *map[string]interface{}
    17  }
    18  
    19  func (m Chart) IsDeploymentNeeded() bool {
    20  	return true
    21  }
    22  
    23  func (m Chart) GetName() string {
    24  	return m.Name
    25  }
    26  
    27  func (m Chart) GetPath() string {
    28  	return m.Path
    29  }
    30  
    31  func (m Chart) GetVersion() string {
    32  	return m.Version
    33  }
    34  
    35  func (m Chart) GetProps() interface{} {
    36  	return m.Props
    37  }
    38  
    39  func (m Chart) GetValues() *map[string]interface{} {
    40  	return m.Values
    41  }
    42  
    43  func (m Chart) ExportData(e *environment.Environment) error {
    44  	return nil
    45  }
    46  
    47  func defaultProps() map[string]interface{} {
    48  	return map[string]interface{}{
    49  		"auth": map[string]interface{}{
    50  			"enabled": "false",
    51  		},
    52  		"image": map[string]interface{}{
    53  			"tag": "1.7.10",
    54  		},
    55  		"influxdb": map[string]interface{}{
    56  			"readinessProbe": map[string]interface{}{
    57  				"enabled": false,
    58  			},
    59  			"livenessProbe": map[string]interface{}{
    60  				"enabled": false,
    61  			},
    62  			"startupProbe": map[string]interface{}{
    63  				"enabled": false,
    64  			},
    65  			"resources": map[string]interface{}{
    66  				"limits": map[string]interface{}{
    67  					"memory": "19000Mi",
    68  					"cpu":    "6",
    69  				},
    70  				"requests": map[string]interface{}{
    71  					"memory": "16000Mi",
    72  					"cpu":    "5",
    73  				},
    74  			},
    75  		},
    76  	}
    77  }
    78  
    79  func New(props map[string]interface{}) environment.ConnectedChart {
    80  	return NewVersioned("", props)
    81  }
    82  
    83  // NewVersioned enables choosing a specific helm chart version
    84  func NewVersioned(helmVersion string, props map[string]interface{}) environment.ConnectedChart {
    85  	dp := defaultProps()
    86  	config.MustMerge(&dp, props)
    87  	return Chart{
    88  		Name:    "influxdb",
    89  		Path:    "bitnami/influxdb",
    90  		Values:  &dp,
    91  		Version: helmVersion,
    92  	}
    93  }