Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
216 changes: 71 additions & 145 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func main() {
flag.Parse()
configBytes, err := os.ReadFile(*configFile)
if err != nil {
log.Exit("Failed to read config file. Specify with argument '--config_file path/to/file'")
log.Exitf("Failed to read config file; %v. Specify with argument '--config_file path/to/file'", err)
}
config := &cpb.Config{}
if err := prototext.Unmarshal(configBytes, config); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ require (
github.com/google/go-tpm v0.9.8
github.com/h-fam/errdiff v1.0.2
github.com/insomniacslk/dhcp v0.0.0-20260407060928-11b94ed970f2
github.com/openconfig/attestz v0.6.13
github.com/openconfig/gnmi v0.14.1
github.com/openconfig/attestz v0.6.10
github.com/openconfig/gnsi v1.9.1
go.mozilla.org/pkcs7 v0.9.0
google.golang.org/grpc v1.81.1
Expand All @@ -27,6 +26,7 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/openconfig/gnmi v0.14.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/openconfig/attestz v0.6.13 h1:gy0PI0CzyS9I4RcoR84FGD7vD5vSw5REqhxTj+VfpXs=
github.com/openconfig/attestz v0.6.13/go.mod h1:DyMmIKYsBUCLj9SVPVBRz0EoqR4WZLwPNkNPQ+DyPy0=
github.com/openconfig/attestz v0.6.10 h1:h3VtYiXHieOg7HRiNcNbbPxICh+7fUk4f+5holA4TGg=
github.com/openconfig/attestz v0.6.10/go.mod h1:2dUfsfqo/sDGCdtYI+4d3SOepA/rewcT+HfNj+pSi90=
github.com/openconfig/gnmi v0.14.1 h1:qKMuFvhIRR2/xxCOsStPQ25aKpbMDdWr3kI+nP9bhMs=
github.com/openconfig/gnmi v0.14.1/go.mod h1:whr6zVq9PCU8mV1D0K9v7Ajd3+swoN6Yam9n8OH3eT0=
github.com/openconfig/gnsi v1.9.1 h1:0XpYlG/99YWVIm6gFTVkxlwiXcU/tBla9MDLChLNBMM=
Expand Down
34 changes: 18 additions & 16 deletions regenerate-files.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#!/bin/bash
set -euo pipefail

BASE=$(bazel info bazel-genfiles)
BASE=$(bazel info bazel-genfiles)
BOOTZ_NS='github.com/openconfig/bootz/proto'
ENTITY_NS='github.com/openconfig/bootz/server/entitymanager/proto'
CONFIG_NS='github.com/openconfig/bootz/server/proto'
DHCPCONFIG_NS='github.com/openconfig/bootz/dhcp/proto'

copy_generated() {
pkg="$1"
# Default to using package name for proto if $4 is unset
proto="$1" && [ "${4++}" ] && proto="$4"
# Bazel go_rules will create empty files containing "// +build ignore\n\npackage ignore"
# in the case where the protoc compiler doesn't generate any output. See:
# https://github.com/bazelbuild/rules_go/blob/03a8b8e90eebe699d7/go/tools/builders/protoc.go#L190
for file in "${BASE}""/${3}""${proto}"_go_proto_/"${2}"/"${pkg}"/*.pb.go; do
[[ $(head -n 1 "${file}") == "// +build ignore" ]] || cp -f "${file}" "${3}${pkg}/"
done
pkg="$1"
# Default to using package name for proto if $4 is unset
proto="$1" && [ "${4++}" ] && proto="$4"
# Bazel go_rules will create empty files containing "// +build ignore\n\npackage ignore"
# in the case where the protoc compiler doesn't generate any output. See:
# https://github.com/bazelbuild/rules_go/blob/03a8b8e90eebe699d7/go/tools/builders/protoc.go#L190
for file in "${BASE}""/${3}""${proto}"_go_proto_/"${2}"/"${pkg}"/*.pb.go; do
[[ $(head -n 1 "${file}") == "// +build ignore" ]] || cp -f "${file}" "${3}${pkg}/"
done
}

bazel build //proto:all
bazel build //server/entitymanager/proto:all
# first arg is the package name, second arg is namespace for the package, and third is the location where the generated code will be saved.
copy_generated "bootz" ${BOOTZ_NS} "proto/"
copy_generated "entity" ${ENTITY_NS} "server/entitymanager/proto/"

bazel build //server/proto:all
bazel build //dhcp/proto:all
# first arg is the package name, second arg is namespace for the package, and third is the location where the generated code will be saved.
copy_generated "bootz" ${BOOTZ_NS} "proto/"
copy_generated "config" ${CONFIG_NS} "server/proto/"
copy_generated "dhcpconfig" ${DHCPCONFIG_NS} "dhcp/proto/"
1 change: 1 addition & 0 deletions server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ go_library(
"@openconfig_attestz//service/biz:enrollz_biz",
"@openconfig_attestz//service/biz:tpm20_utils",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//reflection",
"@org_golang_google_grpc//credentials",
],
)
Expand Down
2 changes: 1 addition & 1 deletion server/emulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func main() {

configBytes, err := os.ReadFile(*configFile)
if err != nil {
log.Exit("failed to read config file. Specify with argument '--config_file path/to/file'")
log.Exitf("failed to read config file: %v. Specify with argument '--config_file path/to/file'", err)
}
config := &cpb.Config{}
if err := prototext.Unmarshal(configBytes, config); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/openconfig/bootz/server/service"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"

dpb "github.com/openconfig/bootz/dhcp/proto/dhcpconfig"
bpb "github.com/openconfig/bootz/proto/bootz"
Expand Down Expand Up @@ -145,6 +146,8 @@ func NewServer(config *cpb.Config, opts ...bootzServerOpts) (*Server, error) {
s = grpc.NewServer(grpc.Creds(credentials.NewTLS(conf)))
}
bpb.RegisterBootstrapServer(s, c)
// Register reflection service on gRPC server.
reflection.Register(s)

lis, err := net.Listen("tcp", ":"+addrParts[1])
if err != nil {
Expand Down
Loading