Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ jobs:

steps:
- name: Log in to the Container registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check out code into the Go module directory
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: Set up Go 1.25
uses: actions/setup-go@v5
- name: Set up Go 1.26
uses: actions/setup-go@v7
with:
go-version: "1.25"
go-version: "1.26"
cache: false

- name: fake ipxe binary
Expand All @@ -43,7 +43,7 @@ jobs:
touch ipxe/ipxe/bin/ipxe.bin

- name: Lint
uses: golangci/golangci-lint-action@v8
uses: golangci/golangci-lint-action@v9
with:
args: --timeout=3m

Expand All @@ -58,10 +58,10 @@ jobs:
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Build and push image
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt update \
make \
&& make ipxe

FROM golang:1.25-trixie AS builder
FROM golang:1.26-trixie AS builder
WORKDIR /work
COPY . .
COPY --from=ipxe-builder /work/ipxe/ipxe /work/ipxe/ipxe
Expand Down
18 changes: 8 additions & 10 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ package api

// MetalConfig is consumed by metal-hammer to get all options to open a grpc connection to the metal-api
type MetalConfig struct {
Debug bool `json:"debug"`
GRPCAddress string `json:"address,omitempty"`
MetalAPIUrl string `json:"metal_api_url,omitempty"`
PixieAPIURL string `json:"pixie_api_url"`
CACert string `json:"ca_cert,omitempty"`
Cert string `json:"cert,omitempty"`
Key string `json:"key,omitempty"`
HMAC string `json:"hmac,omitempty"`
NTPServers []string `json:"ntp_servers,omitempty"`
Partition string `json:"partition"`
Debug bool `json:"debug"`
MetalAPIServerUrl string `json:"metal_apiserver_url,omitempty"`
MetalAPIServerToken string `json:"metal_apiserver_token,omitempty"`
MetalAPIServerTokenForHammer string `json:"metal_apiserver_token_for_hammer,omitempty"`
MetalAPIUrl string `json:"metal_api_url,omitempty"`
PixieAPIUrl string `json:"pixie_api_url"`
NTPServers []string `json:"ntp_servers,omitempty"`
Partition string `json:"partition"`
// Logging contains logging configurations passed to metal-hammer
Logging *Logging `json:"logging,omitempty"`
}
Expand Down
5 changes: 2 additions & 3 deletions dhcp4/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"io"
"maps"
"net"
"sort"
)
Expand Down Expand Up @@ -134,9 +135,7 @@ func (o Options) Marshal() ([]byte, error) {
// Copy returns a shallow copy of o.
func (o Options) Copy() Options {
ret := make(Options, len(o))
for k, v := range o {
ret[k] = v
}
maps.Copy(ret, o)
return ret
}

Expand Down
11 changes: 5 additions & 6 deletions dhcp4/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"io"
"maps"
"net"
"sort"
)
Expand Down Expand Up @@ -197,9 +198,7 @@ func (p *Packet) Marshal() ([]byte, error) {
ret.Write([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0})

opts := make(Options, len(p.Options)+1)
for k, v := range p.Options {
opts[k] = v
}
maps.Copy(opts, p.Options)
opts[53] = []byte{byte(p.Type)}
if optsInSname {
opts, err = opts.marshalLimited(ret, 64, true)
Expand Down Expand Up @@ -339,9 +338,9 @@ func Unmarshal(bs []byte) (*Packet, error) {
}

func nullStr(bs []byte) (string, bool) {
i := bytes.IndexByte(bs, 0)
if i == -1 {
before, _, ok := bytes.Cut(bs, []byte{0})
if !ok {
return "", false
}
return string(bs[:i]), true
return string(before), true
}
41 changes: 23 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
module github.com/metal-stack/pixie

go 1.25
go 1.26

require (
github.com/metal-stack/metal-api v0.42.4
github.com/metal-stack/api v0.4.1
github.com/metal-stack/v v1.0.3
github.com/pin/tftp/v3 v3.1.0
github.com/prometheus/client_golang v1.23.2
github.com/spf13/cobra v1.10.1
github.com/pin/tftp/v3 v3.2.0
github.com/prometheus/client_golang v1.24.0
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
golang.org/x/crypto v0.43.0
golang.org/x/net v0.46.0
google.golang.org/grpc v1.76.0
golang.org/x/crypto v0.54.0
golang.org/x/net v0.57.0
google.golang.org/protobuf v1.36.11
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260709200747-435963d16310.1 // indirect
connectrpc.com/connect v1.20.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.19.1 // indirect
github.com/klauspost/connect-compress/v2 v2.1.1 // indirect
github.com/minio/minlz v1.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.2 // indirect
github.com/prometheus/procfs v0.19.1 // indirect
github.com/prometheus/common v0.70.1 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/sagikazarmark/locafero v0.12.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/text v0.30.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
google.golang.org/protobuf v1.36.10 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/text v0.40.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading