Skip to content
Merged
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
38 changes: 23 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,44 @@
"protocol": "http"
}
},
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"ghcr.io/devcontainers/features/node:2": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/thediveo/devcontainer-features/local-pkgsite:1": {
"port": "6060"
},
"ghcr.io/thediveo/devcontainer-features/pinact:0": {},
"ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:1": {},
"ghcr.io/thediveo/devcontainer-features/lazygit:0": {},
"ghcr.io/devcontainers/features/docker-in-docker:4": {
"version": "latest",
"moby": false // go for the upstream Docker-CE
},
"ghcr.io/thediveo/devcontainer-features/lazygit:0": {},
"ghcr.io/thediveo/devcontainer-features/local-pkgsite:0": {},
"ghcr.io/thediveo/devcontainer-features/goreportcard:0": {},
"ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:0": {},
"ghcr.io/thediveo/devcontainer-features/gocover:0": {
"root": true,
"num-programs": "1",
"race": true,
"ghcr.io/thediveo/devcontainer-features/gocover:1": {
"run": "^Test", // skip testable examples
"root": true, // test both as ordinary user and root
"num-programs": "1", // do never run package-level tests in parallel
"race": true, // enable race detector
"verbose": true,
"html": true
},
"ghcr.io/thediveo/devcontainer-features/pin-github-action:0": {}
"html": true // generate coverage.html
}
},
"securityOpt": [
"apparmor=unconfined"
],
"remoteEnv": {
"GOPATH": "/home/vscode/go",
"PATH": "/home/vscode/go/bin:/go/bin:/usr/local/go/bin:${localEnv:PATH}"
},
"customizations": {
"vscode": {
"extensions": [
"stkb.rewrap",
"dnut.rewrap-revived",
"brunnerh.insert-unicode",
"mhutchie.git-graph",
"ms-vscode.makefile-tools"
"ms-vscode.makefile-tools",
"docker.docker"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildandtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 'stable' ]
go: [ 'stable', 'oldstable' ]

steps:
- name: Set up Go ${{matrix.go}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
language: [ 'go', 'actions' ]

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
![goroutines](https://img.shields.io/badge/go%20routines-not%20leaking-success)
![file descriptors](https://img.shields.io/badge/file%20descriptors-not%20leaking-success)
[![Go Report Card](https://goreportcard.com/badge/github.com/siemens/ieddata)](https://goreportcard.com/report/github.com/siemens/ieddata)
![Coverage](https://img.shields.io/badge/Coverage-89.0%25-brightgreen)
![Coverage](https://img.shields.io/badge/Coverage-90.6%25-brightgreen)

`iedata` provides querying information about a Siemens Industrial Edge (virtual)
device from an app inside the IE(v)D.
Expand Down
2 changes: 1 addition & 1 deletion apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (db *AppEngineDB) Apps() ([]App, error) {
if err != nil {
return nil, err
}
appT := reflect.TypeOf(App{})
appT := reflect.TypeFor[App]()
columnFieldIndices := make([]int, len(cols))
for columnIndex := range columnFieldIndices {
columnFieldIndices[columnIndex] = -1 // no corresponding field
Expand Down
13 changes: 10 additions & 3 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ func Open(dbname string) (*AppEngineDB, error) {
// IED's runtime container PID is already known, such as from an lxkns
// discovery, as so to skip the IE runtime container discovery.
func OpenInPID(dbname string, pid model.PIDType) (*AppEngineDB, error) {
return open(path.Join(dbBaseDir, sanitize(dbname)), pid)
return OpenPathInPID(path.Join(dbBaseDir, sanitize(dbname)), pid)
}

// OpenPathInPID works like OpenInPID but take a full path and database name as
// well as a PID within which to resolve the pathname. Use this primarily in
// (unit) tests where spinning up a fake IED runtime container is overkill.
func OpenPathInPID(pathname string, pid model.PIDType) (*AppEngineDB, error) {
return open(pathname, pid)
}

var onlyAlphaNumsAndMore = regexp.MustCompile(`[^a-zA-Z0-9\-_.]+`)
Expand Down Expand Up @@ -87,9 +94,9 @@ func sanitize(basename string) string {
// https://github.com/mathaou/termdbms/blob/be6f397196077cc7c9ced86e6460470e3b223f3e/main.go#L132.
//
// Well, what's good for the goose is good for the gander, so copy it is. Sigh.
func open(name string, pid model.PIDType) (*AppEngineDB, error) {
func open(pathname string, pid model.PIDType) (*AppEngineDB, error) {
rootpath := fmt.Sprintf("/proc/%d/root", pid)
dbpath, err := procfsroot.EvalSymlinks(name, rootpath, procfsroot.EvalFullPath)
dbpath, err := procfsroot.EvalSymlinks(pathname, rootpath, procfsroot.EvalFullPath)
if err != nil {
return nil, fmt.Errorf("cannot determine full database path, reason: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ func (db *AppEngineDB) DeviceInfo() (map[string]string, error) {
}
devinfo[key] = value
}
_ = rows.Err()
return devinfo, nil
}
110 changes: 56 additions & 54 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
module github.com/siemens/ieddata

go 1.26.2
go 1.26.3

require (
github.com/jmoiron/sqlx v1.4.0
github.com/onsi/ginkgo/v2 v2.28.2
github.com/onsi/gomega v1.39.1
github.com/thediveo/fdooze v0.3.2
github.com/thediveo/lxkns v0.45.1
github.com/thediveo/morbyd/v2 v2.0.0
github.com/thediveo/procfsroot v1.0.2
github.com/thediveo/success v1.0.3
github.com/thediveo/whalewatcher/v2 v2.0.0
golang.org/x/sys v0.43.0
modernc.org/sqlite v1.50.0
github.com/onsi/ginkgo/v2 v2.32.1
github.com/onsi/gomega v1.42.1
github.com/thediveo/fdooze v0.3.4
github.com/thediveo/lxkns v0.47.1
github.com/thediveo/morbyd/v2 v2.2.4
github.com/thediveo/procfsroot v1.0.3
github.com/thediveo/success v1.3.1
github.com/thediveo/whalewatcher/v2 v2.1.0
golang.org/x/sys v0.47.0
modernc.org/sqlite v1.57.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/go-winio v0.6.3-0.20251027160822-ad3df93bed29 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/containerd/containerd/api v1.10.0 // indirect
github.com/containerd/containerd/v2 v2.2.4 // indirect
github.com/containerd/continuity v0.4.5 // indirect
github.com/containerd/containerd/api v1.11.1 // indirect
github.com/containerd/containerd/v2 v2.3.4 // indirect
github.com/containerd/continuity v0.5.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v1.0.0-rc.4 // indirect
github.com/containerd/ttrpc v1.2.8 // indirect
github.com/containerd/typeurl/v2 v2.2.3 // indirect
github.com/containerd/typeurl/v2 v2.3.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v29.6.1+incompatible // indirect
github.com/docker/go-connections v0.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand All @@ -44,24 +45,24 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.7 // indirect
github.com/in-toto/attestation v1.1.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/in-toto/attestation v1.2.0 // indirect
github.com/in-toto/in-toto-golang v0.11.0 // indirect
github.com/klauspost/compress v1.18.5 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/moby/buildkit v0.29.0 // indirect
github.com/klauspost/compress v1.18.7 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/moby/buildkit v0.31.1 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.2.0 // indirect
github.com/moby/go-archive v0.3.3 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/moby/api v1.54.2 // indirect
github.com/moby/moby/client v0.4.1 // indirect
github.com/moby/moby/api v1.55.0 // indirect
github.com/moby/moby/client v0.5.1 // indirect
github.com/moby/patternmatcher v0.6.1 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/sequential v0.7.0 // indirect
github.com/moby/sys/signal v0.7.1 // indirect
github.com/moby/sys/user v0.4.0 // indirect
github.com/moby/sys/user v0.4.1 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.1.0 // indirect
Expand All @@ -71,41 +72,42 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.11.0 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/thediveo/cpus v0.11.0 // indirect
github.com/thediveo/faf v0.2.2 // indirect
github.com/thediveo/go-mntinfo v1.0.4 // indirect
github.com/thediveo/ioctl v0.9.4 // indirect
github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f // indirect
github.com/thediveo/cpus v0.11.1 // indirect
github.com/thediveo/faf v0.2.3 // indirect
github.com/thediveo/go-mntinfo v1.0.5 // indirect
github.com/thediveo/ioctl v0.9.5 // indirect
github.com/thediveo/nonstd v0.21.0 // indirect
github.com/tonistiigi/fsutil v0.0.0-20260609091201-0257b3308df4 // indirect
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
go.opentelemetry.io/otel v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect
go.opentelemetry.io/otel/metric v1.44.0 // indirect
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
go.opentelemetry.io/otel/trace v1.44.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.44.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260427160629-7cedc36a6bc4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260420184626-e10c466a9529 // indirect
google.golang.org/grpc v1.80.0 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/exp v0.0.0-20260603202125-055de637280b // indirect
golang.org/x/mod v0.38.0 // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/text v0.40.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.48.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/grpc v1.83.1 // indirect
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
modernc.org/libc v1.72.0 // indirect
modernc.org/libc v1.74.4 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
)
Loading
Loading