MCPcopy
hub / github.com/cortexlabs/cortex / getELBLoadBalancer

Function getELBLoadBalancer

cli/cmd/cluster.go:1415–1429  ·  view source on GitHub ↗

Will return error if the load balancer can't be found

(clusterName string, whichLB LoadBalancer, awsClient *awslib.Client)

Source from the content-addressed store, hash-verified

1413
1414// Will return error if the load balancer can't be found
1415func getELBLoadBalancer(clusterName string, whichLB LoadBalancer, awsClient *awslib.Client) (*elb.LoadBalancerDescription, error) {
1416 loadBalancer, err := awsClient.FindLoadBalancer(map[string]string{
1417 clusterconfig.ClusterNameTag: clusterName,
1418 "cortex.dev/load-balancer": whichLB.String(),
1419 })
1420 if err != nil {
1421 return nil, errors.Wrap(err, fmt.Sprintf("unable to locate %s load balancer", whichLB.String()))
1422 }
1423
1424 if loadBalancer == nil {
1425 return nil, ErrorNoOperatorLoadBalancer(whichLB.String())
1426 }
1427
1428 return loadBalancer, nil
1429}
1430
1431func listPVCVolumesForCluster(awsClient *awslib.Client, clusterName string) ([]ec2.Volume, error) {
1432 return awsClient.ListVolumes(ec2.Tag{

Callers 1

cmdInfoFunction · 0.85

Calls 4

WrapFunction · 0.92
FindLoadBalancerMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected