Skip to content

Commit fe81b04

Browse files
committed
fix(shared/sandbox-network): panic on malformed BYOP dev allowlist CIDR
The logger is not initialized at package-init time, so logger.L() silently discarded the warning. Panic instead so a malformed BYOP_DEV_ALLOWED_PROXY_CIDRS entry fails loudly during local dev rather than being ignored.
1 parent ac3e842 commit fe81b04

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

  • packages/shared/pkg/sandbox-network

‎packages/shared/pkg/sandbox-network/byop.go‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import (
99
"strconv"
1010
"strings"
1111

12-
"go.uber.org/zap"
13-
1412
"github.com/e2b-dev/infra/packages/shared/pkg/env"
15-
"github.com/e2b-dev/infra/packages/shared/pkg/logger"
1613
)
1714

1815
// DevAllowedProxyEndpointCIDRs is a dev-only allowlist that overrides
@@ -56,13 +53,7 @@ func parseCIDRsEnv(name string) []string {
5653
continue
5754
}
5855
if _, _, err := net.ParseCIDR(p); err != nil {
59-
logger.L().Warn(context.Background(), "ignoring malformed CIDR in env var",
60-
zap.String("env", name),
61-
zap.String("cidr", p),
62-
zap.Error(err),
63-
)
64-
65-
continue
56+
panic(fmt.Sprintf("sandbox_network: invalid CIDR in env var %s: %q: %v", name, p, err))
6657
}
6758
out = append(out, p)
6859
}

0 commit comments

Comments
 (0)