You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Environment variables can't have dashes in them, so bind them to their equivalent
@@ -95,8 +125,8 @@ func init() {
95
125
networkCheckCmd.PersistentFlags().StringSliceVar(&networkConfig.HttpsHosts, "https-hosts", []string{}, "Hosts to test for outbound HTTPS connectivity")
96
126
networkCheckCmd.PersistentFlags().StringVar(&networkConfig.InstanceAMI, "instance-ami", "", "Custom ec2 instance AMI id, if not set will use latest ubuntu")
97
127
networkCheckCmd.PersistentFlags().StringVar(&networkConfig.ApiEndpoint, "api-endpoint", "", "The Gitpod Enterprise control plane's regional API endpoint subdomain")
98
-
networkCheckCmd.Flags().StringSliceVar(&flags.SelectedTestsets, "testsets", []string{"aws-services-pod-subnet", "aws-services-main-subnet", "https-hosts-main-subnet"}, "List of testsets to run (options: aws-services-pod-subnet, aws-services-main-subnet, https-hosts-main-subnet)")
99
-
networkCheckCmd.Flags().StringVar(&flags.ModeVar, "mode", string(ModeEC2), "How to run the tests (default: ec2, options: ec2, lamda)")
128
+
networkCheckCmd.PersistentFlags().StringSliceVar(&flags.SelectedTestsets, "testsets", []string{"aws-services-pod-subnet", "aws-services-main-subnet", "https-hosts-main-subnet"}, "List of testsets to run (options: aws-services-pod-subnet, aws-services-main-subnet, https-hosts-main-subnet)")
129
+
networkCheckCmd.PersistentFlags().StringVar(&flags.ModeVar, "mode", string(runner.ModeEC2), "How to run the tests (default: ec2, options: ec2, lambda, local)")
100
130
bindFlags(networkCheckCmd, v)
101
131
log.Infof("ℹ️ Running with region `%s`, main subnet `%v`, pod subnet `%v`, hosts `%v`, ami `%v`, and API endpoint `%v`", networkConfig.AwsRegion, networkConfig.MainSubnets, networkConfig.PodSubnets, networkConfig.HttpsHosts, networkConfig.InstanceAMI, networkConfig.ApiEndpoint)
3. Implement the `TestRunner` interface within `local-runner.go` using `net/http` for checks.
18
+
4. Update `gitpod-network-check/cmd/checks.go` to add the `local` mode constant, update `validModes`, and add instantiation logic for `LocalTestRunner`.
19
+
5. Update `gitpod-network-check/cmd/root.go` to modify the help text for the `--mode` flag.
Deploying Gitpod requires specific network configurations to allow communication between its components and various external services (AWS APIs, container registries, identity providers, etc.). Misconfigurations are common and can be difficult to diagnose, leading to deployment failures or runtime issues. This tool aims to proactively identify these network connectivity problems before or during Gitpod installation/updates.
6
+
7
+
**How it Should Work:**
8
+
9
+
The tool executes predefined sets of network connectivity tests (`TestSets`) targeting specific endpoints required by Gitpod. These tests are run from environments that simulate where Gitpod components would run (e.g., within specific AWS subnets).
10
+
11
+
***Modes:** The tool supports different execution modes:
12
+
*`ec2`: (Existing) Launches temporary EC2 instances in specified subnets to run tests. Requires AWS credentials and permissions.
13
+
*`lambda`: (Planned/Partially Implemented?) Uses AWS Lambda functions for testing.
14
+
*`local`: (Current Task) Runs tests directly from the machine executing the CLI using standard Go libraries. Useful for basic outbound checks or when AWS resources aren't desired/available.
15
+
***Test Sets:** Groups of related checks (e.g., connectivity to core AWS services from pod subnets).
16
+
***Configuration:** Network details (subnets, region) and test parameters (hosts) are provided via CLI flags or a configuration file.
17
+
***Output:** Logs detailed information about each check, clearly indicating success or failure.
18
+
***Cleanup:** Automatically removes any temporary resources created during the `ec2` mode run.
19
+
20
+
**User Experience Goals:**
21
+
22
+
***Simplicity:** Easy to run with sensible defaults.
23
+
***Clarity:** Provide clear pass/fail results and informative error messages.
24
+
***Flexibility:** Allow users to select specific test sets and execution modes.
25
+
***Reliability:** Accurately reflect the network connectivity status relevant to Gitpod.
0 commit comments