Skip to content

Commit 8a97790

Browse files
authored
Update all dependencies and replace godss/yaml with k8s fork (#50)
1 parent 0338aa6 commit 8a97790

File tree

12 files changed

+164
-75
lines changed

12 files changed

+164
-75
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM alpine:3.14 as health-downloader
2-
ENV GRPC_HEALTH_PROBE_VERSION=v0.4.5 \
2+
ENV GRPC_HEALTH_PROBE_VERSION=v0.4.6 \
33
GRPC_HEALTH_PROBE_URL=https://github.com/grpc-ecosystem/grpc-health-probe/releases/download
44
RUN apk -U add curl \
55
&& curl -fLso /bin/grpc_health_probe \

api/grpc/health/v1/health.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/iam.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/meta.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/project.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/quota.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1/tenant.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@ module github.com/metal-stack/masterdata-api
33
go 1.16
44

55
require (
6-
github.com/Masterminds/squirrel v1.5.0
7-
github.com/ghodss/yaml v1.0.0
8-
github.com/gogo/status v1.1.0
6+
github.com/Masterminds/squirrel v1.5.1
97
github.com/google/go-cmp v0.5.6
108
github.com/google/uuid v1.3.0
119
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
1210
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
1311
github.com/jmoiron/sqlx v1.3.4
1412
github.com/json-iterator/go v1.1.12
15-
github.com/lib/pq v1.10.3
13+
github.com/lib/pq v1.10.4
1614
github.com/lopezator/migrator v0.3.0
17-
github.com/metal-stack/metal-lib v0.8.1
18-
github.com/metal-stack/security v0.6.2
15+
github.com/metal-stack/metal-lib v0.9.0
16+
github.com/metal-stack/security v0.6.3
1917
github.com/metal-stack/v v1.0.3
2018
github.com/prometheus/client_golang v1.11.0
2119
github.com/spf13/cobra v1.2.1
22-
github.com/spf13/viper v1.8.1
20+
github.com/spf13/viper v1.9.0
2321
github.com/stretchr/testify v1.7.0
2422
github.com/testcontainers/testcontainers-go v0.11.1
2523
go.uber.org/zap v1.19.1
26-
google.golang.org/grpc v1.40.0
24+
google.golang.org/grpc v1.42.0
2725
google.golang.org/protobuf v1.27.1
26+
sigs.k8s.io/yaml v1.3.0
2827
)

go.sum

Lines changed: 136 additions & 47 deletions
Large diffs are not rendered by default.

pkg/datastore/bootstrap.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
"regexp"
1212
"strings"
1313

14-
gyaml "github.com/ghodss/yaml"
1514
healthv1 "github.com/metal-stack/masterdata-api/api/grpc/health/v1"
1615
v1 "github.com/metal-stack/masterdata-api/api/v1"
1716
"github.com/metal-stack/masterdata-api/pkg/health"
1817
"go.uber.org/zap"
18+
"sigs.k8s.io/yaml"
1919
)
2020

2121
// Initdb reads all yaml files in given directory and apply their content as initial datasets.
@@ -61,13 +61,13 @@ func splitYamlDocs(doc string) []string {
6161

6262
// processConfig processes all yaml docs contained in the given file
6363
func (ds *Datastore) processConfig(file string) error {
64-
yaml, err := os.ReadFile(file)
64+
yml, err := os.ReadFile(file)
6565
if err != nil {
6666
return err
6767
}
6868
ctx := context.Background()
6969

70-
yamldocs := splitYamlDocs(string(yaml))
70+
yamldocs := splitYamlDocs(string(yml))
7171
for i := range yamldocs {
7272
ydoc := yamldocs[i]
7373
err = ds.createOrUpdate(ctx, []byte(ydoc))
@@ -82,7 +82,7 @@ func (ds *Datastore) createOrUpdate(ctx context.Context, ydoc []byte) error {
8282

8383
// all entities must contain a meta, parse that to get kind and apiversion
8484
var mm MetaMeta
85-
err := gyaml.Unmarshal(ydoc, &mm)
85+
err := yaml.Unmarshal(ydoc, &mm)
8686
if err != nil {
8787
return err
8888
}
@@ -112,7 +112,7 @@ func (ds *Datastore) createOrUpdate(ctx context.Context, ydoc []byte) error {
112112
panic(fmt.Sprintf("entity type %s must implement VersionedJSONEntity-Interface", elementType.String()))
113113
}
114114

115-
err = gyaml.Unmarshal(ydoc, newEntity)
115+
err = yaml.Unmarshal(ydoc, newEntity)
116116
if err != nil {
117117
return err
118118
}

0 commit comments

Comments
 (0)