This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
make build: Build theosd-network-verifierexecutable in the base directorymake test: Run all tests usinggo test ./...make fmt: Format Go code and tidy modulesmake check-fmt: Check formatting and ensure clean git statusmake boilerplate-update: Update boilerplate files
osd-network-verifier is a CLI tool for validating network configurations for ROSA and OSD CCS clusters on AWS and GCP. The tool consists of several key architectural components:
CLI Structure (cmd/):
root.go: Main cobra command withegressanddnssubcommandscmd/egress/: Egress validation subcommandcmd/dns/: DNS validation subcommand
Verifier Service (pkg/verifier/):
- Defines the
verifierServiceinterface withValidateEgress()andVerifyDns()methods - Cloud-agnostic verification orchestration
- Structured input types for validation operations
Cloud Clients (pkg/clients/):
aws/: AWS-specific client implementationgcp/: GCP-specific client implementationkube/: Kubernetes client for pod-mode operations
Probe System (pkg/probes/):
package_probes.go: Defines theProbeinterface for cloud-agnostic instance behaviorcurl/: Default curl-based probe implementationlegacy/: Legacy probe for pre-1.0 behavior compatibilitydummy/: Test probe implementation- Each probe manages machine images, user data generation, and output parsing
Platform Abstraction (pkg/data/cloud/):
- Platform type definitions (AWSClassic, AWSHCP, AWSHCPZeroEgress, GCPClassic)
- Platform-specific configuration and behavior
Data Management (pkg/data/):
egress_lists/: Network endpoint lists fetched dynamically from latest commitcpu/: CPU architecture definitionscurlgen/: Curl command generation utilities
- Cloud Agnostic Design: Probes and core verification logic work across AWS/GCP
- Interface-Based Architecture:
verifierServiceandProbeinterfaces enable pluggable implementations - Dynamic Configuration: Egress lists are pulled from the repository dynamically rather than hardcoded
- Platform Selection: Platform types determine egress lists, machine types, and CPU architectures
- Machine images are maintained per probe in
machine_images.gofiles - Image selection based on platform, region, and CPU architecture
- Default X86 architecture unless overridden with
--cpu-archflag - Terraform examples available in
examples/aws/terraform/for testing different network scenarios
pkg/verifier/package_verifier.go: Core verification interface and input structurespkg/probes/package_probes.go: Probe interface definitionpkg/data/cloud/platform.go: Platform type systemcmd/root.go: Main CLI command structure