forked from openshift/osd-network-verifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_verifier.go
58 lines (49 loc) · 2.28 KB
/
package_verifier.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package verifier
import (
"context"
"time"
"github.com/openshift/osd-network-verifier/pkg/output"
"github.com/openshift/osd-network-verifier/pkg/proxy"
)
// VerifierService defines the behaviors necessary to run verifier completely. Any clients that use that fullfills this interface
// will be able to run all verifier test
type verifierService interface {
// ValidateEgress validates that all required targets are reachable from the vpcsubnet
// target URLs: https://docs.openshift.com/rosa/rosa_getting_started/rosa-aws-prereqs.html#osd-aws-privatelink-firewall-prerequisites
// Expected return value is *output.Output that's storing failures, exceptions and errors
ValidateEgress(vei ValidateEgressInput) *output.Output
// VerifyDns verifies that a given VPC meets the DNS requirements specified in:
// https://docs.openshift.com/container-platform/4.10/installing/installing_aws/installing-aws-vpc.html
// Expected return value is *output.Output that's storing failures, exceptions and errors
VerifyDns(vdi VerifyDnsInput) *output.Output
}
type ValidateEgressInput struct {
Timeout time.Duration
Ctx context.Context
SubnetID, CloudImageID, InstanceType, PlatformType string
Proxy proxy.ProxyConfig
Tags map[string]string
AWS AwsEgressConfig
GCP GcpEgressConfig
SkipInstanceTermination bool
TerminateDebugInstance string
ImportKeyPair string
}
type AwsEgressConfig struct {
KmsKeyID, SecurityGroupId string
}
type GcpEgressConfig struct {
Region, Zone, ProjectID, VpcName string
}
// ValidateEgress pass in a GCP or AWS client that know how to fufill above interface
func ValidateEgress(vs verifierService, vei ValidateEgressInput) *output.Output {
return vs.ValidateEgress(vei)
}
type VerifyDnsInput struct {
Ctx context.Context
VpcID string
}
// VerifyDns pass in a GCP or AWS client that know how to fufill above interface
func VerifyDns(vs verifierService, vdi VerifyDnsInput) *output.Output {
return vs.VerifyDns(vdi)
}