mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-21 12:44:20 -04:00
Add VerifyService port to GCP LB (#291)
* Add VerifyService port to GCP LB * cli verify command: Use verify service port by default Co-authored-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
244426305d
commit
ad02249b9a
3 changed files with 5 additions and 3 deletions
|
@ -140,7 +140,7 @@ func parseVerifyFlags(cmd *cobra.Command, fileHandler file.Handler) (verifyFlags
|
||||||
if ownerID == "" && clusterID == "" {
|
if ownerID == "" && clusterID == "" {
|
||||||
return verifyFlags{}, errors.New("neither owner-id nor cluster-id provided to verify the cluster")
|
return verifyFlags{}, errors.New("neither owner-id nor cluster-id provided to verify the cluster")
|
||||||
}
|
}
|
||||||
endpoint, err = validateEndpoint(endpoint, constants.BootstrapperPort)
|
endpoint, err = validateEndpoint(endpoint, constants.VerifyServiceNodePortGRPC)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return verifyFlags{}, fmt.Errorf("validating endpoint argument: %w", err)
|
return verifyFlags{}, fmt.Errorf("validating endpoint argument: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ func TestVerify(t *testing.T) {
|
||||||
nodeEndpointFlag: "192.0.2.1",
|
nodeEndpointFlag: "192.0.2.1",
|
||||||
ownerIDFlag: zeroBase64,
|
ownerIDFlag: zeroBase64,
|
||||||
protoClient: &stubVerifyClient{},
|
protoClient: &stubVerifyClient{},
|
||||||
wantEndpoint: "192.0.2.1:9000",
|
wantEndpoint: "192.0.2.1:30081",
|
||||||
},
|
},
|
||||||
"endpoint not set": {
|
"endpoint not set": {
|
||||||
setupFs: func(require *require.Assertions) afero.Fs { return afero.NewMemMapFs() },
|
setupFs: func(require *require.Assertions) afero.Fs { return afero.NewMemMapFs() },
|
||||||
|
|
|
@ -4,8 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/edgelesssys/constellation/internal/cloud/cloudtypes"
|
"github.com/edgelesssys/constellation/internal/cloud/cloudtypes"
|
||||||
|
"github.com/edgelesssys/constellation/internal/constants"
|
||||||
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
|
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
@ -257,7 +259,7 @@ func (c *Client) CreateLoadBalancer(ctx context.Context) error {
|
||||||
Name: proto.String(c.forwardingRule),
|
Name: proto.String(c.forwardingRule),
|
||||||
IPProtocol: proto.String(computepb.ForwardingRule_IPProtocolEnum_name[int32(computepb.ForwardingRule_TCP)]),
|
IPProtocol: proto.String(computepb.ForwardingRule_IPProtocolEnum_name[int32(computepb.ForwardingRule_TCP)]),
|
||||||
LoadBalancingScheme: proto.String(computepb.ForwardingRule_LoadBalancingScheme_name[int32(computepb.ForwardingRule_EXTERNAL)]),
|
LoadBalancingScheme: proto.String(computepb.ForwardingRule_LoadBalancingScheme_name[int32(computepb.ForwardingRule_EXTERNAL)]),
|
||||||
Ports: []string{"6443", "9000"},
|
Ports: []string{"6443", "9000", strconv.Itoa(constants.VerifyServiceNodePortGRPC)},
|
||||||
BackendService: proto.String("https://www.googleapis.com/compute/v1/projects/" + c.project + "/regions/" + c.region + "/backendServices/" + c.backendService),
|
BackendService: proto.String("https://www.googleapis.com/compute/v1/projects/" + c.project + "/regions/" + c.region + "/backendServices/" + c.backendService),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue