From d28663f388cb4628c09d35e9aae73b8a854b2e6a Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Tue, 24 Jan 2023 09:40:38 -0500 Subject: [PATCH 1/5] update graph supports through v1.16.1 --- default-operator-config.yaml | 198 ++++++++++++++++++++++++++++ tools/generate-update-graph/main.go | 108 +++++++++------ tools/go.mod | 34 +++-- tools/go.sum | 76 +++++------ 4 files changed, 314 insertions(+), 102 deletions(-) diff --git a/default-operator-config.yaml b/default-operator-config.yaml index 840a6819..7ec09243 100644 --- a/default-operator-config.yaml +++ b/default-operator-config.yaml @@ -130,14 +130,35 @@ channels: - v1.14.0-phase1 v1.14.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.14.0-phase1: - v1.14.0-phase2 v1.14.0-phase2: - v1.14.0 + v1.14.1: + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.15.0: + - v1.16.0 + - v1.16.1 + v1.16.0: + - v1.16.1 metadata: datastore: postgres name: postgres nodes: + - id: v1.16.1 + migration: drop-id-constraints + tag: v1.16.1 + - id: v1.16.0 + migration: drop-id-constraints + tag: v1.16.0 + - id: v1.15.0 + migration: drop-id-constraints + tag: v1.15.0 - id: v1.14.1 migration: drop-id-constraints tag: v1.14.1 @@ -213,6 +234,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.1.0: - v1.2.0 - v1.3.0 @@ -227,6 +251,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.2.0: - v1.3.0 - v1.4.0 @@ -240,6 +267,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.3.0: - v1.4.0 - v1.5.0 @@ -252,6 +282,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.4.0: - v1.5.0 - v1.6.0 @@ -263,6 +296,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.5.0: - v1.6.0 - v1.7.1 @@ -273,6 +309,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.6.0: - v1.7.1 - v1.8.0 @@ -282,6 +321,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.7.0: - v1.7.1 - v1.8.0 @@ -291,6 +333,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.7.1: - v1.8.0 - v1.9.0 @@ -299,6 +344,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.8.0: - v1.9.0 - v1.10.0 @@ -306,32 +354,71 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.9.0: - v1.10.0 - v1.11.0 - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.10.0: - v1.11.0 - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.11.0: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.12.0: - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.13.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.14.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.14.1: + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.15.0: + - v1.16.0 + - v1.16.1 + v1.16.0: + - v1.16.1 metadata: datastore: cockroachdb name: cockroachdb nodes: + - id: v1.16.1 + migration: add-caveats + tag: v1.16.1 + - id: v1.16.0 + migration: add-caveats + tag: v1.16.0 + - id: v1.15.0 + migration: add-caveats + tag: v1.15.0 - id: v1.14.1 migration: add-caveats tag: v1.14.1 @@ -393,6 +480,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.7.1: - v1.8.0 - v1.9.0 @@ -401,6 +491,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.8.0: - v1.9.0 - v1.10.0 @@ -408,32 +501,71 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.9.0: - v1.10.0 - v1.11.0 - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.10.0: - v1.11.0 - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.11.0: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.12.0: - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.13.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.14.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.14.1: + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.15.0: + - v1.16.0 + - v1.16.1 + v1.16.0: + - v1.16.1 metadata: datastore: mysql name: mysql nodes: + - id: v1.16.1 + migration: add-caveats + tag: v1.16.1 + - id: v1.16.0 + migration: add-caveats + tag: v1.16.0 + - id: v1.15.0 + migration: add-caveats + tag: v1.15.0 - id: v1.14.1 migration: add-caveats tag: v1.14.1 @@ -480,6 +612,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.1.0: - v1.2.0 - v1.3.0 @@ -494,6 +629,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.2.0: - v1.3.0 - v1.4.0 @@ -507,6 +645,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.3.0: - v1.4.0 - v1.5.0 @@ -519,6 +660,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.4.0: - v1.5.0 - v1.6.0 @@ -530,6 +674,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.5.0: - v1.6.0 - v1.7.1 @@ -540,6 +687,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.6.0: - v1.7.1 - v1.8.0 @@ -549,6 +699,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.7.0: - v1.7.1 - v1.8.0 @@ -558,6 +711,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.7.1: - v1.8.0 - v1.9.0 @@ -566,6 +722,9 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.8.0: - v1.9.0 - v1.10.0 @@ -573,32 +732,71 @@ channels: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.9.0: - v1.10.0 - v1.11.0 - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.10.0: - v1.11.0 - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.11.0: - v1.12.0 - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.12.0: - v1.13.0 - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.13.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 v1.14.0: - v1.14.1 + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.14.1: + - v1.15.0 + - v1.16.0 + - v1.16.1 + v1.15.0: + - v1.16.0 + - v1.16.1 + v1.16.0: + - v1.16.1 metadata: datastore: spanner name: spanner nodes: + - id: v1.16.1 + migration: add-caveats + tag: v1.16.1 + - id: v1.16.0 + migration: add-caveats + tag: v1.16.0 + - id: v1.15.0 + migration: add-caveats + tag: v1.15.0 - id: v1.14.1 migration: add-caveats tag: v1.14.1 diff --git a/tools/generate-update-graph/main.go b/tools/generate-update-graph/main.go index 66eddd11..970663ab 100644 --- a/tools/generate-update-graph/main.go +++ b/tools/generate-update-graph/main.go @@ -64,6 +64,9 @@ func main() { func postgresChannel() updates.Channel { releases := []updates.State{ + {ID: "v1.16.1", Tag: "v1.16.1", Migration: "drop-id-constraints"}, + {ID: "v1.16.0", Tag: "v1.16.0", Migration: "drop-id-constraints"}, + {ID: "v1.15.0", Tag: "v1.15.0", Migration: "drop-id-constraints"}, {ID: "v1.14.1", Tag: "v1.14.1", Migration: "drop-id-constraints"}, {ID: "v1.14.0", Tag: "v1.14.0", Migration: "drop-id-constraints"}, {ID: "v1.14.0-phase2", Tag: "v1.14.0", Migration: "add-xid-constraints", Phase: "write-both-read-new"}, @@ -89,7 +92,10 @@ func postgresChannel() updates.Channel { Metadata: map[string]string{"datastore": "postgres"}, Nodes: releases, Edges: map[string][]string{ - "v1.14.0": {"v1.14.1"}, + "v1.16.0": {"v1.16.1"}, + "v1.15.0": {"v1.16.0", "v1.16.1"}, + "v1.14.1": {"v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.14.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, "v1.14.0-phase2": {"v1.14.0"}, "v1.14.0-phase1": {"v1.14.0-phase2"}, "v1.13.0": {"v1.14.0-phase1"}, @@ -113,6 +119,9 @@ func postgresChannel() updates.Channel { func crdbChannel() updates.Channel { releases := []updates.State{ + {ID: "v1.16.1", Tag: "v1.16.1", Migration: "add-caveats"}, + {ID: "v1.16.0", Tag: "v1.16.0", Migration: "add-caveats"}, + {ID: "v1.15.0", Tag: "v1.15.0", Migration: "add-caveats"}, {ID: "v1.14.1", Tag: "v1.14.1", Migration: "add-caveats"}, {ID: "v1.14.0", Tag: "v1.14.0", Migration: "add-caveats"}, {ID: "v1.13.0", Tag: "v1.13.0", Migration: "add-metadata-and-counters"}, @@ -136,28 +145,34 @@ func crdbChannel() updates.Channel { Metadata: map[string]string{"datastore": "cockroachdb"}, Nodes: releases, Edges: map[string][]string{ - "v1.14.0": {"v1.14.1"}, - "v1.13.0": {"v1.14.1"}, - "v1.12.0": {"v1.13.0", "v1.14.1"}, - "v1.11.0": {"v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.10.0": {"v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.9.0": {"v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.8.0": {"v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.7.1": {"v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.7.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.6.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.5.0": {"v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.4.0": {"v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.3.0": {"v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.2.0": {"v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.1.0": {"v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.0.0": {"v1.1.0", "v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, + "v1.16.0": {"v1.16.1"}, + "v1.15.0": {"v1.16.0", "v1.16.1"}, + "v1.14.1": {"v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.14.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.13.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.12.0": {"v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.11.0": {"v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.10.0": {"v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.9.0": {"v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.8.0": {"v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.7.1": {"v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.7.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.6.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.5.0": {"v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.4.0": {"v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.3.0": {"v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.2.0": {"v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.1.0": {"v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.0.0": {"v1.1.0", "v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, }, } } func mysqlChannel() updates.Channel { releases := []updates.State{ + {ID: "v1.16.1", Tag: "v1.16.1", Migration: "add-caveats"}, + {ID: "v1.16.0", Tag: "v1.16.0", Migration: "add-caveats"}, + {ID: "v1.15.0", Tag: "v1.15.0", Migration: "add-caveats"}, {ID: "v1.14.1", Tag: "v1.14.1", Migration: "add-caveats"}, {ID: "v1.14.0", Tag: "v1.14.0", Migration: "add-caveats"}, {ID: "v1.13.0", Tag: "v1.13.0", Migration: "add_ns_config_id"}, @@ -174,21 +189,27 @@ func mysqlChannel() updates.Channel { Metadata: map[string]string{"datastore": "mysql"}, Nodes: releases, Edges: map[string][]string{ - "v1.14.0": {"v1.14.1"}, - "v1.13.0": {"v1.14.1"}, - "v1.12.0": {"v1.13.0", "v1.14.1"}, - "v1.11.0": {"v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.10.0": {"v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.9.0": {"v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.8.0": {"v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.7.1": {"v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.7.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, + "v1.16.0": {"v1.16.1"}, + "v1.15.0": {"v1.16.0", "v1.16.1"}, + "v1.14.1": {"v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.14.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.13.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.12.0": {"v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.11.0": {"v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.10.0": {"v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.9.0": {"v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.8.0": {"v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.7.1": {"v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.7.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, }, } } func spannerChannel() updates.Channel { releases := []updates.State{ + {ID: "v1.16.1", Tag: "v1.16.1", Migration: "add-caveats"}, + {ID: "v1.16.0", Tag: "v1.16.0", Migration: "add-caveats"}, + {ID: "v1.15.0", Tag: "v1.15.0", Migration: "add-caveats"}, {ID: "v1.14.1", Tag: "v1.14.1", Migration: "add-caveats"}, {ID: "v1.14.0", Tag: "v1.14.0", Migration: "add-caveats"}, {ID: "v1.13.0", Tag: "v1.13.0", Migration: "add-metadata-and-counters"}, @@ -212,22 +233,25 @@ func spannerChannel() updates.Channel { Metadata: map[string]string{"datastore": "spanner"}, Nodes: releases, Edges: map[string][]string{ - "v1.14.0": {"v1.14.1"}, - "v1.13.0": {"v1.14.1"}, - "v1.12.0": {"v1.13.0", "v1.14.1"}, - "v1.11.0": {"v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.10.0": {"v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.9.0": {"v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.8.0": {"v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.7.1": {"v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.7.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.6.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.5.0": {"v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.4.0": {"v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.3.0": {"v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.2.0": {"v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.1.0": {"v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, - "v1.0.0": {"v1.1.0", "v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1"}, + "v1.16.0": {"v1.16.1"}, + "v1.15.0": {"v1.16.0", "v1.16.1"}, + "v1.14.1": {"v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.14.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.13.0": {"v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.12.0": {"v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.11.0": {"v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.10.0": {"v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.9.0": {"v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.8.0": {"v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.7.1": {"v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.7.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.6.0": {"v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.5.0": {"v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.4.0": {"v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.3.0": {"v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.2.0": {"v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.1.0": {"v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, + "v1.0.0": {"v1.1.0", "v1.2.0", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "v1.7.1", "v1.8.0", "v1.9.0", "v1.10.0", "v1.11.0", "v1.12.0", "v1.13.0", "v1.14.1", "v1.15.0", "v1.16.0", "v1.16.1"}, }, } } diff --git a/tools/go.mod b/tools/go.mod index 278bef79..d04bf91e 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,49 +9,47 @@ require ( ) require ( - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/authzed/controller-idioms v0.5.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/authzed/controller-idioms v0.6.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.8.0 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/fatih/camelcase v1.0.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.19.14 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/jzelinskie/stringz v0.0.1 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect golang.org/x/exp v0.0.0-20220823124025-807a23277127 // indirect - golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect + golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect + golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.25.0 // indirect - k8s.io/apimachinery v0.25.0 // indirect - k8s.io/client-go v0.25.0 // indirect - k8s.io/klog/v2 v2.80.0 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect - k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 // indirect + k8s.io/api v0.26.0 // indirect + k8s.io/apimachinery v0.26.0 // indirect + k8s.io/client-go v0.26.0 // indirect + k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index a6e100db..eff27f22 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,36 +1,29 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/authzed/controller-idioms v0.5.0 h1:ZJQR43vrX5tPO9fuJZrCLX2MdeuiJC1toWujKu4b00g= -github.com/authzed/controller-idioms v0.5.0/go.mod h1:Ov4P7cMA/CQF7ojBx1Z9dNUp7pAuJviMerp+aRUtUTc= +github.com/authzed/controller-idioms v0.6.0 h1:KlWiAU+Al9M4K68W91bsHyigXOmp+QQCgodlL+AYEMI= +github.com/authzed/controller-idioms v0.6.0/go.mod h1:0B/PmqCguKv8b3azSMF+HdyKpKr2o3UAZ5eo12Ze8Fo= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= @@ -59,8 +52,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v43 v43.0.0 h1:y+GL7LIsAIF2NZlJ46ZoC/D1W1ivZasT0lnWHMYPZ+U= github.com/google/go-github/v43 v43.0.0/go.mod h1:ZkTvvmCXBvsfPpTHXnH/d2hP9Y0cTbvN9kr5xqyXOIc= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -73,6 +66,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jzelinskie/stringz v0.0.1 h1:IahR+y8ct2nyj7B6i8UtFsGFj4ex1SX27iKFYsAheLk= +github.com/jzelinskie/stringz v0.0.1/go.mod h1:hHYbgxJuNLRw91CmpuFsYEOyQqpDVFg8pvEh23vy4P0= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -95,13 +90,12 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= -github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= +github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= +github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -131,11 +125,10 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc= +golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= @@ -148,17 +141,17 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -212,19 +205,18 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= -k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= -k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= -k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= -k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= -k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.80.0 h1:lyJt0TWMPaGoODa8B8bUuxgHS3W/m/bNr2cca3brA/g= -k8s.io/klog/v2 v2.80.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 h1:H9TCJUUx+2VA0ZiD9lvtaX8fthFsMoD+Izn93E/hm8U= -k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= +k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= +k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg= +k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/client-go v0.26.0 h1:lT1D3OfO+wIi9UFolCrifbjUUgu7CpLca0AD8ghRLI8= +k8s.io/client-go v0.26.0/go.mod h1:I2Sh57A79EQsDmn7F7ASpmru1cceh3ocVT9KlX2jEZg= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= +k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= +k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= From ce840790bfb79ef99c4512f9bb5262183978fb8c Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Tue, 24 Jan 2023 10:33:36 -0500 Subject: [PATCH 2/5] make intOrString key generic, use int32 for replicas --- .github/workflows/lint.yaml | 41 +++++++++++++++++----------------- .github/workflows/release.yaml | 28 +++++++++++++++++++++++ config/kustomization.yaml | 3 +++ e2e/e2e_test.go | 4 ++-- goreleaser.yaml | 15 ++++++++++++- pkg/config/config.go | 6 ++--- pkg/config/keys.go | 37 ++++++++++++++++++------------ 7 files changed, 93 insertions(+), 41 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index dbfd0d93..6e082ad1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -37,26 +37,25 @@ jobs: - uses: "stefanprodan/kube-tools@v1" with: command: "kustomize build ./config" - # Disabled due to issues with Kustomize, see: - # - https://github.com/instrumenta/kubeval-action/pull/3 - # - https://github.com/instrumenta/kubeval/issues/232 - # - uses: "instrumenta/kubeval-action@5915e4adba5adccac07cb156b82e54c3fed74921" - # with: - # files: "config" + # Disabled due to issues with Kustomize, see: + # - https://github.com/instrumenta/kubeval-action/pull/3 + # - https://github.com/instrumenta/kubeval/issues/232 + # - uses: "instrumenta/kubeval-action@5915e4adba5adccac07cb156b82e54c3fed74921" + # with: + # files: "config" - uses: "authzed/actions/markdown-lint@main" -# TODO: enable when public -# codeql: -# name: "Analyze with CodeQL" -# runs-on: "ubuntu-latest" -# permissions: -# actions: "read" -# contents: "read" -# security-events: "write" -# strategy: -# fail-fast: false -# matrix: -# language: ["go"] -# steps: -# - uses: "actions/checkout@v3" -# - uses: "authzed/actions/codeql@main" + codeql: + name: "Analyze with CodeQL" + runs-on: "ubuntu-latest" + permissions: + actions: "read" + contents: "read" + security-events: "write" + strategy: + fail-fast: false + matrix: + language: ["go"] + steps: + - uses: "actions/checkout@v3" + - uses: "authzed/actions/codeql@main" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5f0c636e..58adfab3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,3 +32,31 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}" + + kustomizer: + runs-on: "ubuntu-latest" + env: + ARTIFACT: "oci://ghcr.io/${{github.repository_owner}}/${{github.event.repository.name}}-manifests" + steps: + - uses: "actions/checkout@v3" + - name: "Login to GitHub Container Registry" + uses: "docker/login-action@v2" + with: + registry: "ghcr.io" + username: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + - name: "Setup kustomizer" + uses: "stefanprodan/kustomizer/action@main" + - name: "Set operator image in release manifests" + uses: "mikefarah/yq@master" + with: + cmd: | + yq eval '.images[0].newTag="${{ github.ref_name }}"' -i ./config/kustomization.yaml + - name: "Push release manifests" + run: | + kustomizer push artifact ${ARTIFACT}:${{ github.ref_name }} -k ./config \ + --source=${{ github.repositoryUrl }} \ + --revision="${{ github.ref_name }}/${{ github.sha }}" + - name: "Tag latest release manifests" + run: | + kustomizer tag artifact ${ARTIFACT}:${GITHUB_REF_NAME} latest diff --git a/config/kustomization.yaml b/config/kustomization.yaml index 61fe9902..1f6b6348 100644 --- a/config/kustomization.yaml +++ b/config/kustomization.yaml @@ -4,3 +4,6 @@ resources: - crds - rbac - operator.yaml +images: + - name: ghcr.io/authzed/spicedb-operator + newTag: latest diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 66762d7f..0552e6d0 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -68,9 +68,7 @@ var ( func init() { klog.InitFlags(nil) -} -func TestEndToEnd(t *testing.T) { RegisterFailHandler(Fail) // Default operator logs to --v=4 and write to GinkgoWriter @@ -84,7 +82,9 @@ func TestEndToEnd(t *testing.T) { SetDefaultEventuallyPollingInterval(100 * time.Millisecond) SetDefaultConsistentlyDuration(30 * time.Second) SetDefaultConsistentlyPollingInterval(100 * time.Millisecond) +} +func TestEndToEnd(t *testing.T) { RunSpecs(t, "operator tests") } diff --git a/goreleaser.yaml b/goreleaser.yaml index 58cc9cf8..702e5a76 100644 --- a/goreleaser.yaml +++ b/goreleaser.yaml @@ -67,5 +67,18 @@ changelog: release: prerelease: "auto" footer: | + ## Release Kustomize Manifests + Release manifests can be found at `oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }}` and can be installed or inspected with [kustomizer](https://kustomizer.dev/): + + Install directly into a cluster: + ```sh + kustomizer apply inventory spicedb-operator --artifact oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }} + ``` + + Dump kube manifests for inspection or management with other tools: + ```sh + kustomizer pull artifact oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }} > spicedb-operator-v{{ .Version }}.yaml + ``` + ## Docker Images - This release is available at `authzed/spicedb-operator:v{{ .Version }}`, `quay.io/authzed/spicedb-operator:v{{ .Version }}`, `ghcr.io/authzed/spicedb-operator:v{{ .Version }}` + This release image is available at `authzed/spicedb-operator:v{{ .Version }}`, `quay.io/authzed/spicedb-operator:v{{ .Version }}`, `ghcr.io/authzed/spicedb-operator:v{{ .Version }}` diff --git a/pkg/config/config.go b/pkg/config/config.go index da868382..0ef169d2 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -61,8 +61,8 @@ var ( spannerCredentialsKey = newStringKey("spannerCredentials") datastoreTLSSecretKey = newStringKey("datastoreTLSSecretName") datastoreEngineKey = newStringKey("datastoreEngine") - replicasKey = newIntOrStringKey("replicas", 2) - replicasKeyForMemory = newIntOrStringKey("replicas", 1) + replicasKey = newIntOrStringKey[int32]("replicas", 2) + replicasKeyForMemory = newIntOrStringKey[int32]("replicas", 1) extraPodLabelsKey = metadataSetKey("extraPodLabels") extraPodAnnotationsKey = metadataSetKey("extraPodAnnotations") extraServiceAccountAnnotationsKey = metadataSetKey("extraServiceAccountAnnotations") @@ -250,7 +250,7 @@ func NewConfig(nn types.NamespacedName, uid types.UID, version, channel string, errs = append(errs, fmt.Errorf("invalid value for replicas %q: %w", replicas, err)) } - spiceConfig.Replicas = int32(replicas) + spiceConfig.Replicas = replicas if replicas > 1 && datastoreEngine == "memory" { errs = append(errs, fmt.Errorf("cannot set replicas > 1 for memory engine")) } diff --git a/pkg/config/keys.go b/pkg/config/keys.go index dc9b55ff..865452cb 100644 --- a/pkg/config/keys.go +++ b/pkg/config/keys.go @@ -36,36 +36,45 @@ func (k *key[V]) pop(config RawConfig) V { return tv } -type intOrStringKey struct { +type intOrStringKey[I int64 | int32 | int16 | int8] struct { key string - defaultValue int64 + defaultValue I } -func newIntOrStringKey(key string, defaultValue int64) *intOrStringKey { - return &intOrStringKey{ +func newIntOrStringKey[I int64 | int32 | int16 | int8](key string, defaultValue I) *intOrStringKey[I] { + return &intOrStringKey[I]{ key: key, defaultValue: defaultValue, } } -func (k *intOrStringKey) pop(config RawConfig) (out int64, err error) { +func (k *intOrStringKey[I]) pop(config RawConfig) (out I, err error) { v, ok := config[k.key] delete(config, k.key) if !ok { return k.defaultValue, nil } - switch value := v.(type) { - case string: - out, err = strconv.ParseInt(value, 10, 64) - if err != nil { - return - } - case float64: - out = int64(value) + var bits int + switch any(out).(type) { + case int8: + bits = 8 + case int16: + bits = 16 + case int32: + bits = 32 + case int64: + bits = 64 default: - err = fmt.Errorf("expected int or string for key %s", k.key) + panic("invalid int type") + } + + var parsed int64 + parsed, err = strconv.ParseInt(fmt.Sprint(v), 10, bits) + if err != nil { + return } + out = I(parsed) return } From 61bc3ea91e712f5be0a1ba827a3950cb644d9ceb Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Thu, 26 Jan 2023 13:20:56 -0500 Subject: [PATCH 3/5] bump controller-idioms to 0.7.0 --- go.mod | 2 +- go.sum | 4 ++-- pkg/controller/config_change.go | 8 +------- pkg/controller/ensure_deployment.go | 6 +----- pkg/controller/validate_config.go | 6 +----- 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index f6270142..96d9fc58 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( cloud.google.com/go/spanner v1.39.0 - github.com/authzed/controller-idioms v0.6.0 + github.com/authzed/controller-idioms v0.7.0 github.com/cespare/xxhash/v2 v2.1.2 github.com/fatih/camelcase v1.0.0 github.com/go-logr/logr v1.2.3 diff --git a/go.sum b/go.sum index 9928f7de..b1e26198 100644 --- a/go.sum +++ b/go.sum @@ -92,8 +92,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/authzed/controller-idioms v0.6.0 h1:KlWiAU+Al9M4K68W91bsHyigXOmp+QQCgodlL+AYEMI= -github.com/authzed/controller-idioms v0.6.0/go.mod h1:0B/PmqCguKv8b3azSMF+HdyKpKr2o3UAZ5eo12Ze8Fo= +github.com/authzed/controller-idioms v0.7.0 h1:HhNMUBb8hJzYqY3mhen3B2AC5nsIem3fBe0tC/AAOHo= +github.com/authzed/controller-idioms v0.7.0/go.mod h1:0B/PmqCguKv8b3azSMF+HdyKpKr2o3UAZ5eo12Ze8Fo= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= diff --git a/pkg/controller/config_change.go b/pkg/controller/config_change.go index 48fd6bf7..8afe8fb5 100644 --- a/pkg/controller/config_change.go +++ b/pkg/controller/config_change.go @@ -21,13 +21,7 @@ func (c *ConfigChangedHandler) Handle(ctx context.Context) { secret := CtxSecret.Value(ctx) var secretHash string if secret != nil { - var err error - secretHash, err = hash.SecureObject(secret.Data) - if err != nil { - QueueOps.RequeueErr(ctx, err) - return - } - ctx = CtxSecretHash.WithValue(ctx, secretHash) + ctx = CtxSecretHash.WithValue(ctx, hash.SecureObject(secret.Data)) } status := &v1alpha1.SpiceDBCluster{ TypeMeta: metav1.TypeMeta{ diff --git a/pkg/controller/ensure_deployment.go b/pkg/controller/ensure_deployment.go index 5328a480..e7a9bf01 100644 --- a/pkg/controller/ensure_deployment.go +++ b/pkg/controller/ensure_deployment.go @@ -43,11 +43,7 @@ func (m *DeploymentHandler) Handle(ctx context.Context) { secretHash := CtxSecretHash.MustValue(ctx) config := CtxConfig.MustValue(ctx) newDeployment := config.Deployment(migrationHash, secretHash) - deploymentHash, err := hash.Object(newDeployment) - if err != nil { - QueueOps.RequeueErr(ctx, err) - return - } + deploymentHash := hash.Object(newDeployment) matchingObjs := make([]*appsv1.Deployment, 0) extraObjs := make([]*appsv1.Deployment, 0) diff --git a/pkg/controller/validate_config.go b/pkg/controller/validate_config.go index 8ae0b048..ce874c17 100644 --- a/pkg/controller/validate_config.go +++ b/pkg/controller/validate_config.go @@ -67,11 +67,7 @@ func (c *ValidateConfigHandler) Handle(ctx context.Context) { warningCondition = &cond } - migrationHash, err := hash.SecureObject(validatedConfig.MigrationConfig) - if err != nil { - QueueOps.RequeueErr(ctx, err) - return - } + migrationHash := hash.SecureObject(validatedConfig.MigrationConfig) ctx = CtxMigrationHash.WithValue(ctx, migrationHash) computedStatus := v1alpha1.ClusterStatus{ From fb7f68260e9ba8b47de00e40fb1b6a63cbe366ee Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Thu, 26 Jan 2023 13:40:37 -0500 Subject: [PATCH 4/5] include a pre-built install bundle in each release --- .github/workflows/release.yaml | 36 +++++++++++++--------------------- goreleaser.yaml | 31 +++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 58adfab3..e5d3caae 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,6 +10,8 @@ permissions: jobs: goreleaser: runs-on: "ubuntu-latest" + env: + KUSTOMIZER_ARTIFACT: "oci://ghcr.io/${{github.repository_owner}}/${{github.event.repository.name}}-manifests" steps: - uses: "actions/checkout@v3" with: @@ -24,6 +26,16 @@ jobs: dockerhub_token: "${{ secrets.DOCKERHUB_ACCESS_TOKEN }}" - uses: "docker/setup-qemu-action@v1" - uses: "docker/setup-buildx-action@v1" + - name: "Set operator image in release manifests" + uses: "mikefarah/yq@master" + with: + cmd: | + yq eval '.images[0].newTag="${{ github.ref_name }}"' -i ./config/kustomization.yaml + - name: "Build release bundle.yaml" + uses: "karancode/kustomize-github-action@master" + with: + kustomize_build_dir: "config" + kustomize_output_file: "bundle.yaml" - uses: "goreleaser/goreleaser-action@v2" with: distribution: "goreleaser" @@ -32,31 +44,11 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" GORELEASER_KEY: "${{ secrets.GORELEASER_KEY }}" - - kustomizer: - runs-on: "ubuntu-latest" - env: - ARTIFACT: "oci://ghcr.io/${{github.repository_owner}}/${{github.event.repository.name}}-manifests" - steps: - - uses: "actions/checkout@v3" - - name: "Login to GitHub Container Registry" - uses: "docker/login-action@v2" - with: - registry: "ghcr.io" - username: "${{ github.actor }}" - password: "${{ secrets.GITHUB_TOKEN }}" - - name: "Setup kustomizer" - uses: "stefanprodan/kustomizer/action@main" - - name: "Set operator image in release manifests" - uses: "mikefarah/yq@master" - with: - cmd: | - yq eval '.images[0].newTag="${{ github.ref_name }}"' -i ./config/kustomization.yaml - name: "Push release manifests" run: | - kustomizer push artifact ${ARTIFACT}:${{ github.ref_name }} -k ./config \ + kustomizer push artifact ${KUSTOMIZER_ARTIFACT}:${{ github.ref_name }} -k ./config \ --source=${{ github.repositoryUrl }} \ --revision="${{ github.ref_name }}/${{ github.sha }}" - name: "Tag latest release manifests" run: | - kustomizer tag artifact ${ARTIFACT}:${GITHUB_REF_NAME} latest + kustomizer tag artifact ${KUSTOMIZER_ARTIFACT}:${GITHUB_REF_NAME} latest diff --git a/goreleaser.yaml b/goreleaser.yaml index 702e5a76..c9a4e9aa 100644 --- a/goreleaser.yaml +++ b/goreleaser.yaml @@ -64,21 +64,36 @@ snapshot: changelog: use: "github-native" sort: "asc" +includes: +- from_file: + path: "bundle.yaml" release: prerelease: "auto" footer: | - ## Release Kustomize Manifests + ## Install with `kubectl` + kubectl apply --server-side -k https://github.com/authzed/spicedb-operator/releases/download/v{{ .Version }}/bundle.yaml + + ## Include or modify this release in your own `kustomize` bundle + + ```yaml + apiVersion: kustomize.config.k8s.io/v1beta1 + kind: Kustomization + resources: + - https://github.com/authzed/spicedb-operator/config?ref=v{{ .Version }} + images: + - name: ghcr.io/authzed/spicedb-operator + newTag: v{{ .Version }} + ``` + + ## Install with `kustomizer` Release manifests can be found at `oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }}` and can be installed or inspected with [kustomizer](https://kustomizer.dev/): - Install directly into a cluster: ```sh kustomizer apply inventory spicedb-operator --artifact oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }} ``` - Dump kube manifests for inspection or management with other tools: - ```sh - kustomizer pull artifact oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }} > spicedb-operator-v{{ .Version }}.yaml - ``` - ## Docker Images - This release image is available at `authzed/spicedb-operator:v{{ .Version }}`, `quay.io/authzed/spicedb-operator:v{{ .Version }}`, `ghcr.io/authzed/spicedb-operator:v{{ .Version }}` + This release's image is available at: + - `authzed/spicedb-operator:v{{ .Version }}` + - `quay.io/authzed/spicedb-operator:v{{ .Version }}` + - `ghcr.io/authzed/spicedb-operator:v{{ .Version }}` From e1c55565ad5b1de6a99055595aa2b17202c0de23 Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Thu, 26 Jan 2023 13:55:18 -0500 Subject: [PATCH 5/5] change default channel name to `stable` --- README.md | 4 +- default-operator-config.yaml | 8 +-- e2e/cluster_test.go | 10 ++- e2e/e2e_test.go | 86 +++++++++++++++++++++++++- goreleaser.yaml | 14 ++--- pkg/config/config_test.go | 30 ++++----- pkg/controller/validate_config_test.go | 2 +- pkg/updates/file.go | 20 +++--- pkg/updates/file_test.go | 25 +++++--- tools/generate-update-graph/main.go | 36 +++++++---- tools/go.mod | 2 +- tools/go.sum | 4 +- 12 files changed, 173 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 30e6f04b..bd43ea46 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ We recommend one of the following: - [kind](https://kind.sigs.k8s.io) - [minikube](https://minikube.sigs.k8s.io) -Next, you'll install the operator: +Next, you'll install a [release](https://github.com/authzed/spicedb-operator/releases/) of the operator: ```console -kubectl apply --server-side -k github.com/authzed/spicedb-operator/config +kubectl apply --server-side -f https://github.com/authzed/spicedb-operator/releases/download/v1.1.0/bundle.yaml ``` Finally you can create your first cluster: diff --git a/default-operator-config.yaml b/default-operator-config.yaml index 7ec09243..4a7a55b1 100644 --- a/default-operator-config.yaml +++ b/default-operator-config.yaml @@ -148,7 +148,7 @@ channels: - v1.16.1 metadata: datastore: postgres - name: postgres + name: stable nodes: - id: v1.16.1 migration: drop-id-constraints @@ -408,7 +408,7 @@ channels: - v1.16.1 metadata: datastore: cockroachdb - name: cockroachdb + name: stable nodes: - id: v1.16.1 migration: add-caveats @@ -555,7 +555,7 @@ channels: - v1.16.1 metadata: datastore: mysql - name: mysql + name: stable nodes: - id: v1.16.1 migration: add-caveats @@ -786,7 +786,7 @@ channels: - v1.16.1 metadata: datastore: spanner - name: spanner + name: stable nodes: - id: v1.16.1 migration: add-caveats diff --git a/e2e/cluster_test.go b/e2e/cluster_test.go index 81fff7a7..e23391d6 100644 --- a/e2e/cluster_test.go +++ b/e2e/cluster_test.go @@ -903,8 +903,8 @@ var _ = Describe("SpiceDBClusters", func() { UpdateGraph: updates.UpdateGraph{ Channels: []updates.Channel{ { - Name: "postgres", - Metadata: map[string]string{"datastore": "postgres"}, + Name: "stable", + Metadata: map[string]string{"datastore": "postgres", "default": "true"}, Nodes: []updates.State{ {ID: "v1.14.1", Tag: "v1.14.1", Migration: "drop-id-constraints"}, {ID: "v1.14.0", Tag: "v1.14.0", Migration: "drop-id-constraints"}, @@ -919,6 +919,12 @@ var _ = Describe("SpiceDBClusters", func() { "v1.14.0": {"v1.14.1"}, }, }, + { + // define an extra channel for another datastore to make sure + // channel selection is correct + Name: "stable", + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, + }, }, }, } diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 0552e6d0..bcb9cd81 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -69,14 +69,14 @@ var ( func init() { klog.InitFlags(nil) - RegisterFailHandler(Fail) - // Default operator logs to --v=4 and write to GinkgoWriter if verbosity := flag.CommandLine.Lookup("v"); verbosity.Value.String() == "" { Expect(verbosity.Value.Set("4")).To(Succeed()) } klog.SetOutput(GinkgoWriter) + RegisterFailHandler(SnapshotFailHandler) + // Test Defaults SetDefaultEventuallyTimeout(5 * time.Minute) SetDefaultEventuallyPollingInterval(100 * time.Millisecond) @@ -343,3 +343,85 @@ func Provision() (string, func(), error) { return kubeconfig, deprovision, nil } + +// SnapshotFailHandler dumps cluster state when a test fails +// It prints SpiceDBClusters, Pods, and Jobs from all namespaces with the prefix +// "test". +// TODO: turn into generic, re-usable library +func SnapshotFailHandler(message string, callerSkip ...int) { + defer Fail(message, callerSkip...) + + c, err := dynamic.NewForConfig(restConfig) + if err != nil { + GinkgoWriter.Println("could not create client to report cluster state on error", err) + return + } + + k, err := kubernetes.NewForConfig(restConfig) + if err != nil { + GinkgoWriter.Println("could not create client to report cluster state on error", err) + return + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + namespaces, err := k.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) + if err != nil { + GinkgoWriter.Println("error fetching namespaces", err) + } + for _, n := range namespaces.Items { + if !strings.HasPrefix(n.Name, "test") { + continue + } + GinkgoWriter.Println("dumping namespace", n.Name) + + // dump spicedbclusters + GinkgoWriter.Println("dumping SpiceDBClusters") + clusters, err := c.Resource(v1alpha1ClusterGVR).Namespace(n.Name).List(ctx, metav1.ListOptions{}) + if err != nil { + GinkgoWriter.Println("error fetching clusters from namespace", n.Name, err) + } + for _, item := range clusters.Items { + cluster, err := yaml.Marshal(item) + if err != nil { + GinkgoWriter.Println("error fetching cluster", item.GetName(), item.GetNamespace(), err) + continue + } + GinkgoWriter.Println(string(cluster)) + GinkgoWriter.Println("---") + } + + // dump pods + GinkgoWriter.Println("dumping pods") + pods, err := k.CoreV1().Pods(n.Name).List(ctx, metav1.ListOptions{}) + if err != nil { + GinkgoWriter.Println("error fetching pods from namespace", n.Name, err) + } + for _, item := range pods.Items { + pod, err := yaml.Marshal(item) + if err != nil { + GinkgoWriter.Println("error fetching pod", item.GetName(), item.GetNamespace(), err) + continue + } + GinkgoWriter.Println(string(pod)) + GinkgoWriter.Println("---") + } + + // dump jobs + GinkgoWriter.Println("dumping jobs") + jobs, err := k.BatchV1().Jobs(n.Name).List(ctx, metav1.ListOptions{}) + if err != nil { + GinkgoWriter.Println("error fetching jobs from namespace", n.Name, err) + } + for _, item := range jobs.Items { + job, err := yaml.Marshal(item) + if err != nil { + GinkgoWriter.Println("error fetching job", item.GetName(), item.GetNamespace(), err) + continue + } + GinkgoWriter.Println(string(job)) + GinkgoWriter.Println("---") + } + } +} diff --git a/goreleaser.yaml b/goreleaser.yaml index c9a4e9aa..f0208146 100644 --- a/goreleaser.yaml +++ b/goreleaser.yaml @@ -65,16 +65,16 @@ changelog: use: "github-native" sort: "asc" includes: -- from_file: - path: "bundle.yaml" + - from_file: + path: "bundle.yaml" release: prerelease: "auto" footer: | ## Install with `kubectl` - kubectl apply --server-side -k https://github.com/authzed/spicedb-operator/releases/download/v{{ .Version }}/bundle.yaml - + kubectl apply --server-side -f https://github.com/authzed/spicedb-operator/releases/download/v{{ .Version }}/bundle.yaml + ## Include or modify this release in your own `kustomize` bundle - + ```yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization @@ -84,8 +84,8 @@ release: - name: ghcr.io/authzed/spicedb-operator newTag: v{{ .Version }} ``` - - ## Install with `kustomizer` + + ## Install with `kustomizer` Release manifests can be found at `oci://ghcr.io/authzed/spicedb-operator-manifests:v{{ .Version }}` and can be installed or inspected with [kustomizer](https://kustomizer.dev/): ```sh diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 08985a6e..14d36668 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -90,7 +90,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -162,7 +162,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "memory", - Metadata: map[string]string{"datastore": "memory"}, + Metadata: map[string]string{"datastore": "memory", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -345,7 +345,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -418,7 +418,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -491,7 +491,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -568,7 +568,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -648,7 +648,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -723,7 +723,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -798,7 +798,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -875,7 +875,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -955,7 +955,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -1032,7 +1032,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -1111,7 +1111,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, @@ -1188,7 +1188,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v2", Tag: "v2", Migration: "migration1", Phase: "phase1"}, {ID: "v1", Tag: "v1"}, @@ -1437,7 +1437,7 @@ func TestNewConfig(t *testing.T) { Channels: []updates.Channel{ { Name: "spanner", - Metadata: map[string]string{"datastore": "spanner"}, + Metadata: map[string]string{"datastore": "spanner", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, diff --git a/pkg/controller/validate_config_test.go b/pkg/controller/validate_config_test.go index 85fa51c7..52ba4dad 100644 --- a/pkg/controller/validate_config_test.go +++ b/pkg/controller/validate_config_test.go @@ -217,7 +217,7 @@ func TestValidateConfigHandler(t *testing.T) { Channels: []updates.Channel{ { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []updates.State{ {ID: "v1", Tag: "v1"}, }, diff --git a/pkg/updates/file.go b/pkg/updates/file.go index 0165cc45..c21a93e2 100644 --- a/pkg/updates/file.go +++ b/pkg/updates/file.go @@ -42,12 +42,12 @@ type UpdateGraph struct { Channels []Channel `json:"channels,omitempty"` } -// ChannelForDatastore returns the first channel for a specific datastore. +// DefaultChannelForDatastore returns the first channel for a specific datastore. // This makes it possible to pick a channel even if a channel name is not // provided. In the future we may want to explicitly define default channels. -func (g *UpdateGraph) ChannelForDatastore(datastore string) (string, error) { +func (g *UpdateGraph) DefaultChannelForDatastore(datastore string) (string, error) { for _, c := range g.Channels { - if strings.EqualFold(c.Metadata["datastore"], datastore) { + if strings.EqualFold(c.Metadata["datastore"], datastore) && strings.EqualFold(c.Metadata["default"], "true") { return c.Name, nil } } @@ -55,13 +55,13 @@ func (g *UpdateGraph) ChannelForDatastore(datastore string) (string, error) { } // SourceForChannel returns a channel represented as a Source for querying -func (g *UpdateGraph) SourceForChannel(channel string) (Source, error) { +func (g *UpdateGraph) SourceForChannel(engine, channel string) (Source, error) { for _, c := range g.Channels { - if strings.EqualFold(c.Name, channel) { + if strings.EqualFold(c.Name, channel) && strings.EqualFold(c.Metadata["datastore"], engine) { return NewMemorySource(c.Nodes, c.Edges) } } - return nil, fmt.Errorf("no channel found with name %q", channel) + return nil, fmt.Errorf("no channel for %q found with name %q", engine, channel) } // Copy returns a copy of the graph. The controller gets a copy so that @@ -73,7 +73,7 @@ func (g *UpdateGraph) Copy() UpdateGraph { // AvailableVersions traverses an UpdateGraph and collects a list of the // safe versions for updating from the provided currentVersion. func (g *UpdateGraph) AvailableVersions(engine string, v v1alpha1.SpiceDBVersion) ([]v1alpha1.SpiceDBVersion, error) { - source, err := g.SourceForChannel(v.Channel) + source, err := g.SourceForChannel(engine, v.Channel) if err != nil { return nil, fmt.Errorf("no source found for channel %q, can't compute available versions: %w", v.Channel, err) } @@ -128,7 +128,7 @@ func (g *UpdateGraph) AvailableVersions(engine string, v v1alpha1.SpiceDBVersion if c.Metadata["datastore"] != engine { continue } - source, err := g.SourceForChannel(c.Name) + source, err := g.SourceForChannel(engine, c.Name) if err != nil { continue } @@ -191,7 +191,7 @@ func (g *UpdateGraph) ComputeTarget(defaultBaseImage, image, version, channel, e // If there's no still no channel, pick a default based on the engine. if channel == "" { - channel, err = g.ChannelForDatastore(engine) + channel, err = g.DefaultChannelForDatastore(engine) if err != nil { err = fmt.Errorf("couldn't find channel for datastore %q: %w", engine, err) return @@ -200,7 +200,7 @@ func (g *UpdateGraph) ComputeTarget(defaultBaseImage, image, version, channel, e var updateSource Source if len(channel) > 0 { - updateSource, err = g.SourceForChannel(channel) + updateSource, err = g.SourceForChannel(engine, channel) if err != nil { err = fmt.Errorf("error fetching update source: %w", err) return diff --git a/pkg/updates/file_test.go b/pkg/updates/file_test.go index 11cae6b3..9d2208bc 100644 --- a/pkg/updates/file_test.go +++ b/pkg/updates/file_test.go @@ -8,32 +8,32 @@ import ( "github.com/authzed/spicedb-operator/pkg/apis/authzed/v1alpha1" ) -func TestChannelForDatastore(t *testing.T) { +func TestDefaultChannelForDatastore(t *testing.T) { graph := UpdateGraph{Channels: []Channel{ { Name: "postgres", - Metadata: map[string]string{"datastore": "postgres"}, + Metadata: map[string]string{"datastore": "postgres", "default": "true"}, Nodes: []State{{ID: "v1.0.0"}}, }, { Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Nodes: []State{{ID: "v1.0.0"}}, }, }} t.Run("common case", func(t *testing.T) { - channel, err := graph.ChannelForDatastore("cockroachdb") + channel, err := graph.DefaultChannelForDatastore("cockroachdb") require.Nil(t, err) require.Equal(t, "cockroachdb", channel) - channel, err = graph.ChannelForDatastore("postgres") + channel, err = graph.DefaultChannelForDatastore("postgres") require.Nil(t, err) require.Equal(t, "postgres", channel) }) t.Run("case insensitive", func(t *testing.T) { - channel, err := graph.ChannelForDatastore("POSTGRES") + channel, err := graph.DefaultChannelForDatastore("POSTGRES") require.Nil(t, err) require.Equal(t, "postgres", channel) }) @@ -229,6 +229,7 @@ func TestComputeTarget(t *testing.T) { Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, + engine: "cockroachdb", currentVersion: &v1alpha1.SpiceDBVersion{Name: "v1.0.0", Channel: "cockroachdb"}, baseImage: "ghcr.io/authzed/spicedb", expectedBaseImage: "ghcr.io/authzed/spicedb", @@ -236,10 +237,10 @@ func TestComputeTarget(t *testing.T) { expectedState: State{ID: "v1.0.1"}, }, { - name: "fallback to engine as channel", + name: "fallback to default channel", graph: &UpdateGraph{Channels: []Channel{{ Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, @@ -254,7 +255,7 @@ func TestComputeTarget(t *testing.T) { name: "fail missing channel", graph: &UpdateGraph{Channels: []Channel{{ Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, + Metadata: map[string]string{"datastore": "cockroachdb", "default": "true"}, Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, @@ -262,7 +263,7 @@ func TestComputeTarget(t *testing.T) { currentVersion: &v1alpha1.SpiceDBVersion{Name: "v1.0.0"}, baseImage: "ghcr.io/authzed/spicedb", expectedBaseImage: "ghcr.io/authzed/spicedb", - expectedErr: "no channel found", + expectedErr: "no channel", }, { name: "rolling without current state fails", @@ -272,6 +273,7 @@ func TestComputeTarget(t *testing.T) { Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, + engine: "cockroachdb", channel: "cockroachdb", baseImage: "ghcr.io/authzed/spicedb", expectedBaseImage: "ghcr.io/authzed/spicedb", @@ -286,6 +288,7 @@ func TestComputeTarget(t *testing.T) { Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, + engine: "cockroachdb", channel: "cockroachdb", baseImage: "ghcr.io/authzed/spicedb", expectedBaseImage: "ghcr.io/authzed/spicedb", @@ -302,6 +305,7 @@ func TestComputeTarget(t *testing.T) { Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, + engine: "cockroachdb", channel: "cockroachdb", baseImage: "ghcr.io/authzed/spicedb", expectedBaseImage: "ghcr.io/authzed/spicedb", @@ -317,6 +321,7 @@ func TestComputeTarget(t *testing.T) { Edges: EdgeSet{"v1.0.0": {"v1.0.1"}}, Nodes: []State{{ID: "v1.0.1"}, {ID: "v1.0.0"}}, }}}, + engine: "cockroachdb", channel: "cockroachdb", baseImage: "ghcr.io/authzed/spicedb", expectedBaseImage: "ghcr.io/authzed/spicedb", diff --git a/tools/generate-update-graph/main.go b/tools/generate-update-graph/main.go index 970663ab..a298b5d5 100644 --- a/tools/generate-update-graph/main.go +++ b/tools/generate-update-graph/main.go @@ -88,9 +88,12 @@ func postgresChannel() updates.Channel { {ID: "v1.0.0", Tag: "v1.0.0", Migration: "add-unique-living-ns"}, } return updates.Channel{ - Name: "postgres", - Metadata: map[string]string{"datastore": "postgres"}, - Nodes: releases, + Name: "stable", + Metadata: map[string]string{ + "datastore": "postgres", + "default": "true", + }, + Nodes: releases, Edges: map[string][]string{ "v1.16.0": {"v1.16.1"}, "v1.15.0": {"v1.16.0", "v1.16.1"}, @@ -141,9 +144,12 @@ func crdbChannel() updates.Channel { {ID: "v1.0.0", Tag: "v1.0.0", Migration: "add-transactions-table"}, } return updates.Channel{ - Name: "cockroachdb", - Metadata: map[string]string{"datastore": "cockroachdb"}, - Nodes: releases, + Name: "stable", + Metadata: map[string]string{ + "datastore": "cockroachdb", + "default": "true", + }, + Nodes: releases, Edges: map[string][]string{ "v1.16.0": {"v1.16.1"}, "v1.15.0": {"v1.16.0", "v1.16.1"}, @@ -185,9 +191,12 @@ func mysqlChannel() updates.Channel { {ID: "v1.7.0", Tag: "v1.7.0", Migration: "add_unique_datastore_id"}, } return updates.Channel{ - Name: "mysql", - Metadata: map[string]string{"datastore": "mysql"}, - Nodes: releases, + Name: "stable", + Metadata: map[string]string{ + "datastore": "mysql", + "default": "true", + }, + Nodes: releases, Edges: map[string][]string{ "v1.16.0": {"v1.16.1"}, "v1.15.0": {"v1.16.0", "v1.16.1"}, @@ -229,9 +238,12 @@ func spannerChannel() updates.Channel { {ID: "v1.0.0", Tag: "v1.0.0", Migration: "initial"}, } return updates.Channel{ - Name: "spanner", - Metadata: map[string]string{"datastore": "spanner"}, - Nodes: releases, + Name: "stable", + Metadata: map[string]string{ + "datastore": "spanner", + "default": "true", + }, + Nodes: releases, Edges: map[string][]string{ "v1.16.0": {"v1.16.1"}, "v1.15.0": {"v1.16.0", "v1.16.1"}, diff --git a/tools/go.mod b/tools/go.mod index d04bf91e..aa8f848d 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -9,7 +9,7 @@ require ( ) require ( - github.com/authzed/controller-idioms v0.6.0 // indirect + github.com/authzed/controller-idioms v0.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/fatih/camelcase v1.0.0 // indirect diff --git a/tools/go.sum b/tools/go.sum index eff27f22..cf8e2f37 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/authzed/controller-idioms v0.6.0 h1:KlWiAU+Al9M4K68W91bsHyigXOmp+QQCgodlL+AYEMI= -github.com/authzed/controller-idioms v0.6.0/go.mod h1:0B/PmqCguKv8b3azSMF+HdyKpKr2o3UAZ5eo12Ze8Fo= +github.com/authzed/controller-idioms v0.7.0 h1:HhNMUBb8hJzYqY3mhen3B2AC5nsIem3fBe0tC/AAOHo= +github.com/authzed/controller-idioms v0.7.0/go.mod h1:0B/PmqCguKv8b3azSMF+HdyKpKr2o3UAZ5eo12Ze8Fo= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=