-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat(routing): implemented back iptables filtering #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Terraform Plan: |
|
New Releases Check: |
| github.com/spf13/pflag v1.0.6 | ||
| github.com/stretchr/testify v1.10.0 | ||
| github.com/vishvananda/netlink v1.3.0 | ||
| github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is needed but I think i ran go mod tidy instead of go mod download ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go mod tidy is the right one, go mod download is for dockerfile caching magic. Super weird this tag changing like this, their latest is still 1.3.0: https://github.com/vishvananda/netlink/releases/tag/v1.3.0
But the CI failed it ran make tidy (which runs go mod tidy) and found differences. I think it corrected the go.mod file back to simply 1.3.0, so I think there's something wrong with your environment modifying the go.mod file like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was also a diff on the file internal/iptables/iptables.go, this one is probably because of go fmt. Are you using format on save? I use VSCode format on save for Go.
| RoutingModeDefault = RoutingModeBPF | ||
| RoutingModeBPF = "eBPF" | ||
| RoutingModeLoopback = "Loopback" | ||
| RoutingModeIPTables = "IPTables" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do it in lowercase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think uppercase like this is fine 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass ❤️
| github.com/spf13/pflag v1.0.6 | ||
| github.com/stretchr/testify v1.10.0 | ||
| github.com/vishvananda/netlink v1.3.0 | ||
| github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go mod tidy is the right one, go mod download is for dockerfile caching magic. Super weird this tag changing like this, their latest is still 1.3.0: https://github.com/vishvananda/netlink/releases/tag/v1.3.0
But the CI failed it ran make tidy (which runs go mod tidy) and found differences. I think it corrected the go.mod file back to simply 1.3.0, so I think there's something wrong with your environment modifying the go.mod file like this?
| github.com/spf13/pflag v1.0.6 | ||
| github.com/stretchr/testify v1.10.0 | ||
| github.com/vishvananda/netlink v1.3.0 | ||
| github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was also a diff on the file internal/iptables/iptables.go, this one is probably because of go fmt. Are you using format on save? I use VSCode format on save for Go.
| RoutingModeDefault = RoutingModeBPF | ||
| RoutingModeBPF = "eBPF" | ||
| RoutingModeLoopback = "Loopback" | ||
| RoutingModeIPTables = "IPTables" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think uppercase like this is fine 👍
| FROM golang:1.24.1-alpine3.21 AS base | ||
|
|
||
| RUN apk add --no-cache clang llvm bpftool libbpf-dev | ||
| RUN apk add --no-cache clang llvm bpftool libbpf-dev iptables | ||
| ENV CGO_ENABLED=0 | ||
| ENV GOOS=linux | ||
|
|
||
| FROM base AS builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the change you mentioned about devcontainers? Your commented is outdated with the code so I can't see it in the exact part of the code you made it anymore. If yes, this looks good to me 👍
| GKEMetadataServerAddressDefault = "169.254.169.254" | ||
| GKEMetadataServerPortDefault = 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| GKEMetadataServerAddressDefault = "169.254.169.254" | |
| GKEMetadataServerPortDefault = 80 | |
| GKEMetadataServerDefaultAddress = "169.254.169.254" | |
| GKEMetadataServerDefaultPort = 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, please check if we have these values anywhere else in the code and use these constants 🙏
| "net/netip" | ||
| "strconv" | ||
|
|
||
| "github.com/matheuscscp/gke-metadata-server/api" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We put internal imports in a separate import block between the standard libraries and third party imports
| "github.com/matheuscscp/gke-metadata-server/api" | |
| "github.com/matheuscscp/gke-metadata-server/api" | |
No description provided.