Skip to content

Commit 43bc730

Browse files
committed
chore: refactor to use k8s yaml again
1 parent f0cb5db commit 43bc730

11 files changed

Lines changed: 972 additions & 985 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,13 @@ jobs:
4949
- uses: "authzed/actions/golangci-lint@main"
5050

5151
extra-lint:
52-
name: "Lint YAML & Markdown"
52+
name: "Lint YAML"
5353
runs-on: "depot-ubuntu-24.04"
5454
steps:
5555
- uses: "actions/checkout@v6"
56-
- uses: "authzed/actions/yaml-lint@main"
5756
- uses: "stefanprodan/kube-tools@v1"
5857
with:
5958
command: "kustomize build ./config"
60-
# Disabled due to issues with Kustomize, see:
61-
# - https://github.com/instrumenta/kubeval-action/pull/3
62-
# - https://github.com/instrumenta/kubeval/issues/232
63-
# - uses: "instrumenta/kubeval-action@5915e4adba5adccac07cb156b82e54c3fed74921"
64-
# with:
65-
# files: "config"
66-
- uses: "authzed/actions/markdown-lint@main"
6759

6860
codeql:
6961
if: "${{ github.event_name == 'pull_request' }}"

e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"time"
1919

2020
"github.com/go-logr/zapr"
21-
"github.com/goccy/go-yaml"
2221
"github.com/jzelinskie/stringz"
2322
. "github.com/onsi/ginkgo/v2"
2423
. "github.com/onsi/gomega"
@@ -54,6 +53,7 @@ import (
5453
"sigs.k8s.io/kind/pkg/cluster/nodeutils"
5554
"sigs.k8s.io/kind/pkg/cmd"
5655
"sigs.k8s.io/kind/pkg/fs"
56+
"sigs.k8s.io/yaml"
5757

5858
"github.com/authzed/spicedb-operator/e2e/databases"
5959
e2eutil "github.com/authzed/spicedb-operator/e2e/util"

e2e/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv
102102
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
103103
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
104104
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
105-
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
106-
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
105+
github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM=
106+
github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
107107
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
108108
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
109109
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ require (
88
github.com/evanphx/json-patch v5.9.11+incompatible
99
github.com/fatih/camelcase v1.0.0
1010
github.com/go-logr/logr v1.4.3
11-
github.com/goccy/go-yaml v1.19.2
1211
github.com/gosimple/slug v1.15.0
1312
github.com/jzelinskie/stringz v0.0.3
1413
github.com/magefile/mage v1.15.0
@@ -28,6 +27,7 @@ require (
2827
k8s.io/kubectl v0.36.0-alpha.0
2928
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
3029
sigs.k8s.io/kind v0.31.0
30+
sigs.k8s.io/yaml v1.6.0
3131
)
3232

3333
require (
@@ -60,6 +60,7 @@ require (
6060
github.com/go-openapi/swag v0.23.0 // indirect
6161
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
6262
github.com/gobuffalo/flect v1.0.3 // indirect
63+
github.com/goccy/go-yaml v1.19.2 // indirect
6364
github.com/gogo/protobuf v1.3.2 // indirect
6465
github.com/golang/protobuf v1.5.4 // indirect
6566
github.com/google/btree v1.1.3 // indirect
@@ -148,7 +149,6 @@ require (
148149
sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
149150
sigs.k8s.io/randfill v1.0.0 // indirect
150151
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
151-
sigs.k8s.io/yaml v1.6.0 // indirect
152152
)
153153

154154
tool (

magefiles/magefile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"strings"
1313

1414
"github.com/cespare/xxhash/v2"
15-
"github.com/goccy/go-yaml"
1615
"github.com/jzelinskie/stringz"
1716
"github.com/magefile/mage/mg"
1817
"github.com/magefile/mage/sh"
@@ -21,6 +20,7 @@ import (
2120
kind "sigs.k8s.io/kind/pkg/cluster"
2221
"sigs.k8s.io/kind/pkg/cmd"
2322
"sigs.k8s.io/kind/pkg/fs"
23+
"sigs.k8s.io/yaml"
2424
)
2525

2626
const versionsYamlFile = "magefiles/versions.yaml"

pkg/config/global.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import "github.com/authzed/spicedb-operator/pkg/updates"
44

55
// OperatorConfig holds operator-wide config that is used across all objects
66
type OperatorConfig struct {
7-
ImageName string `json:"imageName,omitempty" yaml:"imageName,omitempty"`
8-
updates.UpdateGraph `yaml:",inline"`
7+
ImageName string `json:"imageName,omitempty"`
8+
updates.UpdateGraph
99
}
1010

1111
func NewOperatorConfig() OperatorConfig {

pkg/updates/file.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ const DatastoreMetadataKey = "datastore"
1919
// to the "head" of the channel from every node.
2020
type Channel struct {
2121
// Name is the user-facing identifier for a graph of updates.
22-
Name string `json:"name" yaml:"name"`
22+
Name string `json:"name"`
2323

2424
// Metadata contains any additional properties about the channel.
2525
// For example, the applicable datastore is stored as metadata.
26-
Metadata map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
26+
Metadata map[string]string `json:"metadata,omitempty"`
2727

2828
// Edges are the transitions between states in the update graph.
29-
Edges EdgeSet `json:"edges,omitempty" yaml:"edges,omitempty"`
29+
Edges EdgeSet `json:"edges,omitempty"`
3030

3131
// Nodes are the possible states in an update graph.
32-
Nodes []State `json:"nodes,omitempty" yaml:"nodes,omitempty"`
32+
Nodes []State `json:"nodes,omitempty"`
3333
}
3434

3535
// EqualIdentity determines if two channels represent the same stream of
@@ -80,19 +80,19 @@ func (c Channel) RemoveNodes(nodes []State) Channel {
8080
// State is a "node" in the channel graph, indicating how to run at that
8181
// release.
8282
type State struct {
83-
ID string `json:"id" yaml:"id"`
84-
Tag string `json:"tag,omitempty" yaml:"tag,omitempty"`
85-
Migration string `json:"migration,omitempty" yaml:"migration,omitempty"`
86-
Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
87-
Digest string `json:"digest,omitempty" yaml:"digest,omitempty"`
83+
ID string `json:"id"`
84+
Tag string `json:"tag,omitempty"`
85+
Migration string `json:"migration,omitempty"`
86+
Phase string `json:"phase,omitempty"`
87+
Digest string `json:"digest,omitempty"`
8888

8989
// Deprecated releases can be updated from, but not to
90-
Deprecated bool `json:"-" yaml:"-"`
90+
Deprecated bool `json:"-"`
9191
}
9292

9393
// UpdateGraph holds a graph of required update edges
9494
type UpdateGraph struct {
95-
Channels []Channel `json:"channels,omitempty" yaml:"channels,omitempty"`
95+
Channels []Channel `json:"channels,omitempty"`
9696
}
9797

9898
// DefaultChannelForDatastore returns the first channel for a specific datastore.

0 commit comments

Comments
 (0)