Skip to content

Commit 3cafecb

Browse files
authored
Redis be gone (#123)
1 parent 119684b commit 3cafecb

28 files changed

+18146
-22946
lines changed

.configs/gqlgen.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ autobind:
3939
- "github.com/nais/api/internal/persistence/bucket"
4040
- "github.com/nais/api/internal/persistence/kafkatopic"
4141
- "github.com/nais/api/internal/persistence/opensearch"
42-
- "github.com/nais/api/internal/persistence/redis"
4342
- "github.com/nais/api/internal/persistence/sqlinstance"
4443
- "github.com/nais/api/internal/persistence/valkey"
4544
- "github.com/nais/api/internal/reconciler"

data/k8s/dev/devteam/app-w-all-storage.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ spec:
7272
- name: uniquebucketname-bucket
7373
kafka:
7474
pool: nav-dev
75-
redis:
76-
- instance: contests
77-
access: admin
7875
valkey:
7976
- instance: contests
8077
access: admin

data/k8s/dev/devteam/deploy-canary.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ spec:
5050
cpu: 100m
5151
memory: 128Mi
5252
skipCaBundle: true
53-
redis:
54-
- instance: contests
55-
access: readwrite
5653
valkey:
5754
- instance: contests
5855
access: readwrite

data/k8s/dev/devteam/redis.yaml

-42
This file was deleted.

data/k8s/superprod/devteam/deploy-canary.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ spec:
5050
cpu: 100m
5151
memory: 128Mi
5252
skipCaBundle: true
53-
redis:
54-
- instance: contests
55-
access: readwrite
5653
valkey:
5754
- instance: contests
5855
access: readwrite

integration_tests/features.lua

-12
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ Test.gql("list enabled features", function(t)
1111
id
1212
enabled
1313
}
14-
redis {
15-
id
16-
enabled
17-
}
1814
valkey {
1915
id
2016
enabled
@@ -39,10 +35,6 @@ Test.gql("list enabled features", function(t)
3935
id = "F_5T7D7YtTPV",
4036
enabled = true,
4137
},
42-
redis = {
43-
id = "F_DuZv6up",
44-
enabled = true,
45-
},
4638
valkey = {
4739
id = "F_21x71SHpk",
4840
enabled = true,
@@ -65,10 +57,6 @@ local nodeTests = {
6557
name = "FeatureUnleash",
6658
id = "F_5T7D7YtTPV",
6759
},
68-
{
69-
name = "FeatureRedis",
70-
id = "F_DuZv6up",
71-
},
7260
{
7361
name = "FeatureValkey",
7462
id = "F_21x71SHpk",

internal/cmd/api/http.go

-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/nais/api/internal/persistence/bucket"
3030
"github.com/nais/api/internal/persistence/kafkatopic"
3131
"github.com/nais/api/internal/persistence/opensearch"
32-
"github.com/nais/api/internal/persistence/redis"
3332
"github.com/nais/api/internal/persistence/sqlinstance"
3433
"github.com/nais/api/internal/persistence/valkey"
3534
"github.com/nais/api/internal/reconciler"
@@ -192,7 +191,6 @@ func ConfigureGraph(
192191
jobWatcher := job.NewWatcher(ctx, watcherMgr)
193192
runWatcher := job.NewRunWatcher(ctx, watcherMgr)
194193
bqWatcher := bigquery.NewWatcher(ctx, watcherMgr)
195-
redisWatcher := redis.NewWatcher(ctx, watcherMgr)
196194
valkeyWatcher := valkey.NewWatcher(ctx, watcherMgr)
197195
openSearchWatcher := opensearch.NewWatcher(ctx, watcherMgr)
198196
bucketWatcher := bucket.NewWatcher(ctx, watcherMgr)
@@ -216,7 +214,6 @@ func ConfigureGraph(
216214
bucket.AddSearch(searcher, bucketWatcher)
217215
kafkatopic.AddSearch(searcher, kafkaTopicWatcher)
218216
opensearch.AddSearch(searcher, openSearchWatcher)
219-
redis.AddSearch(searcher, redisWatcher)
220217
sqlinstance.AddSearch(searcher, sqlInstanceWatcher)
221218
valkey.AddSearch(searcher, valkeyWatcher)
222219
team.AddSearch(searcher, pool, notifier, log.WithField("subsystem", "team_search"))
@@ -272,7 +269,6 @@ func ConfigureGraph(
272269
ctx = workload.NewLoaderContext(ctx, podWatcher)
273270
ctx = secret.NewLoaderContext(ctx, secretClientCreator, clusters, log)
274271
ctx = opensearch.NewLoaderContext(ctx, openSearchWatcher)
275-
ctx = redis.NewLoaderContext(ctx, redisWatcher)
276272
ctx = valkey.NewLoaderContext(ctx, valkeyWatcher)
277273
ctx = utilization.NewLoaderContext(ctx, utilizationClient)
278274
ctx = sqlinstance.NewLoaderContext(ctx, sqlAdminService, sqlDatabaseWatcher, sqlInstanceWatcher)
@@ -296,7 +292,6 @@ func ConfigureGraph(
296292
ctx = feature.NewLoaderContext(
297293
ctx,
298294
unleashWatcher.Enabled(),
299-
redisWatcher.Enabled(),
300295
valkeyWatcher.Enabled(),
301296
kafkaTopicWatcher.Enabled(),
302297
openSearchWatcher.Enabled(),

internal/cost/fake.go

-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ func randomServices() []string {
181181
"Cloud SQL",
182182
"Cloud Storage",
183183
"Compute Engine",
184-
"Redis",
185184
"Valkey",
186185
"OpenSearch",
187186
}

internal/cost/model.go

-4
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ type OpenSearchCost struct {
8585
Sum float64 `json:"sum"`
8686
}
8787

88-
type RedisInstanceCost struct {
89-
Sum float64 `json:"sum"`
90-
}
91-
9288
type ValkeyInstanceCost struct {
9389
Sum float64 `json:"sum"`
9490
}

internal/database/migrations/0001_schema.sql

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ CREATE TABLE audit_logs (
7575
-- Cloud SQL
7676
-- BigQuery
7777
-- Kubernetes Engine
78-
-- Redis
7978
-- Valkey
8079
-- Cloud Storage
8180
-- V and it should really, really be an enum.

internal/feature/dataloader.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ const (
1212

1313
func NewLoaderContext(
1414
ctx context.Context,
15-
unleash, redis, valkey, kafka, openSearch bool,
15+
unleash, valkey, kafka, openSearch bool,
1616
) context.Context {
1717
return context.WithValue(ctx, loadersKey, newLoaders(&Features{
1818
Unleash: FeatureUnleash{
1919
Enabled: unleash,
2020
},
21-
Redis: FeatureRedis{
22-
Enabled: redis,
23-
},
2421
Valkey: FeatureValkey{
2522
Enabled: valkey,
2623
},

internal/feature/models.go

-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import "github.com/nais/api/internal/graph/ident"
44

55
type Features struct {
66
Unleash FeatureUnleash `json:"unleash"`
7-
Redis FeatureRedis `json:"redis"`
87
Valkey FeatureValkey `json:"valkey"`
98
Kafka FeatureKafka `json:"kafka"`
109
OpenSearch FeatureOpenSearch `json:"openSearch"`
@@ -20,13 +19,6 @@ type FeatureUnleash struct {
2019
func (f FeatureUnleash) ID() ident.Ident { return NewIdent("unleash") }
2120
func (f FeatureUnleash) IsNode() {}
2221

23-
type FeatureRedis struct {
24-
Enabled bool `json:"enabled"`
25-
}
26-
27-
func (f FeatureRedis) ID() ident.Ident { return NewIdent("redis") }
28-
func (f FeatureRedis) IsNode() {}
29-
3022
type FeatureValkey struct {
3123
Enabled bool `json:"enabled"`
3224
}

internal/feature/queries.go

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ func getByIdent(ctx context.Context, id ident.Ident) (model.Node, error) {
2626
switch feature {
2727
case "unleash":
2828
return container.Unleash, nil
29-
case "redis":
30-
return container.Redis, nil
3129
case "valkey":
3230
return container.Valkey, nil
3331
case "kafka":

internal/graph/cost.resolvers.go

-23
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/nais/api/internal/kubernetes/watcher"
1313
"github.com/nais/api/internal/persistence/bigquery"
1414
"github.com/nais/api/internal/persistence/opensearch"
15-
"github.com/nais/api/internal/persistence/redis"
1615
"github.com/nais/api/internal/persistence/sqlinstance"
1716
"github.com/nais/api/internal/persistence/valkey"
1817
"github.com/nais/api/internal/team"
@@ -82,28 +81,6 @@ func (r *openSearchResolver) Cost(ctx context.Context, obj *opensearch.OpenSearc
8281
}, nil
8382
}
8483

85-
func (r *redisInstanceResolver) Cost(ctx context.Context, obj *redis.RedisInstance) (*cost.RedisInstanceCost, error) {
86-
if obj.WorkloadReference == nil {
87-
return &cost.RedisInstanceCost{}, nil
88-
}
89-
90-
sum, err := cost.MonthlyForService(ctx, obj.TeamSlug, obj.EnvironmentName, obj.WorkloadReference.Name, "Redis")
91-
if err != nil {
92-
r.log.WithError(err).WithFields(logrus.Fields{
93-
"EnvironmentName": obj.EnvironmentName,
94-
"TeamSlug": obj.TeamSlug,
95-
"Redis": obj.Name,
96-
}).Warn("failed to get monthly cost for Redis instance")
97-
return &cost.RedisInstanceCost{
98-
Sum: 0,
99-
}, nil
100-
}
101-
102-
return &cost.RedisInstanceCost{
103-
Sum: float64(sum),
104-
}, nil
105-
}
106-
10784
func (r *sqlInstanceResolver) Cost(ctx context.Context, obj *sqlinstance.SQLInstance) (*cost.SQLInstanceCost, error) {
10885
if obj.WorkloadReference == nil {
10986
return &cost.SQLInstanceCost{}, nil

internal/graph/gengql/complexity.go

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)