mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-04-27 10:39:18 -04:00
Send cdbg deploy only to loadbalancer
This commit is contained in:
parent
df9db94079
commit
cf9662641c
@ -180,34 +180,11 @@ func deployOnEndpoint(ctx context.Context, in deployOnEndpointInput) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getIPsFromConfig(stat statec.ConstellationState, config configc.Config) ([]string, error) {
|
func getIPsFromConfig(stat statec.ConstellationState, config configc.Config) ([]string, error) {
|
||||||
controlPlanes, workers, err := state.GetScalingGroupsFromConfig(stat, &config)
|
if stat.LoadBalancerIP != "" {
|
||||||
if err != nil {
|
return []string{stat.LoadBalancerIP}, nil
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var ips []string
|
return nil, fmt.Errorf("no load balancer IP found in statefile")
|
||||||
// only deploy to non empty public IPs
|
|
||||||
for _, ip := range append(controlPlanes.PublicIPs(), workers.PublicIPs()...) {
|
|
||||||
if ip != "" {
|
|
||||||
ips = append(ips, ip)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// add bootstrapper IP if it is not already in the list
|
|
||||||
var foundBootstrapperIP bool
|
|
||||||
for _, ip := range ips {
|
|
||||||
if ip == stat.LoadBalancerIP {
|
|
||||||
foundBootstrapperIP = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !foundBootstrapperIP && stat.LoadBalancerIP != "" {
|
|
||||||
ips = append(ips, stat.LoadBalancerIP)
|
|
||||||
}
|
|
||||||
if len(ips) == 0 {
|
|
||||||
return nil, fmt.Errorf("no public IPs found in statefile")
|
|
||||||
}
|
|
||||||
|
|
||||||
return ips, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user