Skip to content

Commit b6648f1

Browse files
remove dead code (#478)
During GROW-2587 work, I migrated from an old output shape to a new output shape. Which caused me to cut over all KV commands to use a couple of new resolve and format methods to deal with the new API shapes. Now that everything is converted, those old helpers are unused code! Completes GROW-2587 GitOrigin-RevId: c363f9603150b737c841fbe73e6bb48db732b718
1 parent 164002e commit b6648f1

2 files changed

Lines changed: 0 additions & 49 deletions

File tree

pkg/keyvalue/resolve.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,6 @@ func (s *Service) enrichResolvedKeyValue(ctx context.Context, resolved *Resolved
7575
return nil
7676
}
7777

78-
// Resolve looks up a Key Value instance by ID or name within an optional
79-
// project/environment scope.
80-
//
81-
// If env is supplied, Key Value name lookup is narrowed to that environment,
82-
// and an ID lookup is rejected unless the Key Value belongs to that
83-
// environment. If only project is supplied, name lookup is narrowed to all
84-
// environments in that project, and ID lookup is rejected unless the Key Value
85-
// belongs to one of them. If both are supplied, env is the concrete Key Value
86-
// scope; the caller is responsible for resolving env relative to project
87-
// before calling Resolve.
88-
func Resolve(
89-
ctx context.Context,
90-
idOrName string,
91-
project *client.Project,
92-
env *client.Environment,
93-
) (*client.KeyValueDetail, error) {
94-
c, err := client.NewDefaultClient()
95-
if err != nil {
96-
return nil, err
97-
}
98-
repo := NewRepo(c)
99-
return resolveInScope(ctx, repo, idOrName, resolveScope{project: project, env: env})
100-
}
101-
102-
func resolveWithRepo(ctx context.Context, repo *Repo, idOrName string, env *client.Environment) (*client.KeyValueDetail, error) {
103-
return resolveInScope(ctx, repo, idOrName, resolveScope{env: env})
104-
}
105-
10678
func resolveInScope(
10779
ctx context.Context,
10880
repo *Repo,

pkg/text/keyvalue.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66

77
"github.com/jedib0t/go-pretty/table"
88

9-
"github.com/render-oss/cli/pkg/client"
109
"github.com/render-oss/cli/pkg/keyvalue"
1110
)
1211

@@ -27,26 +26,6 @@ func KeyValueTable(v []keyvalue.KeyValueOut) string {
2726
return FormatString(t.Render())
2827
}
2928

30-
// KeyValueAPIDetail formats a raw API KV instance detail for text output.
31-
// Does NOT include an action prefix (e.g., "Created" or "Updated") — callers should prepend
32-
// their own action prefix in the formatText closure passed to command.NonInteractive.
33-
//
34-
// Prefer converting callers to keyvalue.KeyValueOut and using KeyValueDetail.
35-
func KeyValueAPIDetail(kv *client.KeyValueDetail) string {
36-
lines := []string{
37-
fmt.Sprintf("Name: %s", kv.Name),
38-
fmt.Sprintf("ID: %s", kv.Id),
39-
fmt.Sprintf("Plan: %s", string(kv.Plan)),
40-
fmt.Sprintf("Region: %s", string(kv.Region)),
41-
fmt.Sprintf("Status: %s", string(kv.Status)),
42-
}
43-
if kv.Options.MaxmemoryPolicy != nil {
44-
lines = append(lines, fmt.Sprintf("Memory policy: %s", *kv.Options.MaxmemoryPolicy))
45-
}
46-
lines = append(lines, ipAllowListBlock(kv.IpAllowList))
47-
return strings.Join(lines, "\n")
48-
}
49-
5029
func KeyValueDetail(kv *keyvalue.KeyValueOut) string {
5130
lines := []string{
5231
fmt.Sprintf("Name: %s", kv.Name),

0 commit comments

Comments
 (0)