Skip to content

Commit ac35f0a

Browse files
authored
chore: remove OCI repository references (#274)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent 798e18c commit ac35f0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+835
-3546
lines changed

app/cli/cmd/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ func newConfigCmd() *cobra.Command {
4949
Short: "Configure this client",
5050
}
5151

52-
cmd.AddCommand(newOCIRepositoryCreateCmd(), newConfigSaveCmd(), newConfigViewCmd(), newConfigResetCmd())
52+
cmd.AddCommand(newConfigSaveCmd(), newConfigViewCmd(), newConfigResetCmd())
5353
return cmd
5454
}

app/cli/cmd/config_ocirepository_set.go

Lines changed: 0 additions & 58 deletions
This file was deleted.

app/cli/cmd/organization_describe.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ func contextTableOutput(config *action.ConfigContextItem) error {
4747
gt.AppendRow(table.Row{"Logged in as", config.CurrentUser.Email})
4848
gt.AppendSeparator()
4949
gt.AppendRow(table.Row{"Organization", config.CurrentOrg.Name})
50-
repo := config.CurrentOCIRepo
51-
if repo != nil {
50+
backend := config.CurrentCASBackend
51+
if backend != nil {
5252
gt.AppendSeparator()
53-
gt.AppendRow(table.Row{"OCI repository", fmt.Sprintf("%s (status=%q)", repo.Repo, repo.ValidationStatus)})
53+
gt.AppendRow(table.Row{"Default CAS Backend", fmt.Sprintf("%s (provider=%s, status=%q)", backend.Location, backend.Provider, backend.ValidationStatus)})
5454
}
5555

5656
gt.Render()

app/cli/internal/action/config_current_context.go

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,16 @@ func NewConfigCurrentContext(cfg *ActionsOpts) *ConfigCurrentContext {
3131
}
3232

3333
type ConfigContextItem struct {
34-
CurrentUser *ConfigContextItemUser
35-
CurrentOrg *OrgItem
36-
CurrentOCIRepo *ConfigContextItemOCIRepo
34+
CurrentUser *ConfigContextItemUser
35+
CurrentOrg *OrgItem
36+
CurrentCASBackend *CASBackendItem
3737
}
3838

3939
type ConfigContextItemUser struct {
4040
ID, Email string
4141
CreatedAt *time.Time
4242
}
4343

44-
type ConfigContextItemOCIRepo struct {
45-
ID, Repo string
46-
CreatedAt *time.Time
47-
ValidationStatus ValidationStatus
48-
}
49-
5044
func (action *ConfigCurrentContext) Run() (*ConfigContextItem, error) {
5145
client := pb.NewContextServiceClient(action.cfg.CPConnection)
5246
resp, err := client.Current(context.Background(), &pb.ContextServiceCurrentRequest{})
@@ -56,29 +50,13 @@ func (action *ConfigCurrentContext) Run() (*ConfigContextItem, error) {
5650

5751
res := resp.GetResult()
5852

59-
item := &ConfigContextItem{
53+
return &ConfigContextItem{
6054
CurrentUser: &ConfigContextItemUser{
6155
ID: res.GetCurrentUser().Id,
6256
Email: res.GetCurrentUser().Email,
6357
CreatedAt: toTimePtr(res.GetCurrentUser().CreatedAt.AsTime()),
6458
},
65-
CurrentOrg: pbOrgItemToAction(res.GetCurrentOrg()),
66-
}
67-
68-
repo := res.GetCurrentOciRepo()
69-
if repo != nil {
70-
r := &ConfigContextItemOCIRepo{
71-
ID: repo.GetId(), Repo: repo.GetRepo(), CreatedAt: toTimePtr(repo.GetCreatedAt().AsTime()),
72-
}
73-
74-
switch repo.GetValidationStatus() {
75-
case pb.OCIRepositoryItem_VALIDATION_STATUS_OK:
76-
r.ValidationStatus = Valid
77-
case pb.OCIRepositoryItem_VALIDATION_STATUS_INVALID:
78-
r.ValidationStatus = Invalid
79-
}
80-
81-
item.CurrentOCIRepo = r
82-
}
83-
return item, nil
59+
CurrentOrg: pbOrgItemToAction(res.GetCurrentOrg()),
60+
CurrentCASBackend: pbCASBackendItemToAction(res.GetCurrentCasBackend()),
61+
}, nil
8462
}

app/cli/internal/action/ocirepository_save.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

app/cli/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ func errorInfo(err error, logger zerolog.Logger) (string, int) {
5454

5555
// Make overrides
5656
switch {
57-
case v1.IsOciRepositoryErrorReasonRequired(err):
57+
case v1.IsCasBackendErrorReasonRequired(err):
5858
msg = "you need to enable a CAS backend first. Refer to `chainloop cas-backend` command or contact your administrator."
59-
case v1.IsOciRepositoryErrorReasonInvalid(err):
59+
case v1.IsCasBackendErrorReasonInvalid(err):
6060
msg = "the CAS backend you provided is invalid. Refer to `chainloop cas-backend update` command or contact your administrator."
6161
case v1.IsAllowListErrorNotInList(err):
6262
msg = "your user is not part of the private beta yet. You can request access at https://docs.chainloop.dev/getting-started/private-beta"

app/controlplane/api/buf.lock

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ deps:
88
- remote: buf.build
99
owner: googleapis
1010
repository: googleapis
11-
commit: d1263fe26f8e430a967dc22a4d0cad18
11+
commit: cc916c31859748a68fd229a3c8d7a2e8
12+
- remote: buf.build
13+
owner: kratos-go
14+
repository: kratos
15+
commit: e1d52e944e3845c6862a566db322432d

app/controlplane/api/buf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ breaking:
55
deps:
66
- buf.build/googleapis/googleapis
77
- buf.build/envoyproxy/protoc-gen-validate:45685e052c7e406b9fbd441fc7a568a5
8+
- buf.build/kratos-go/kratos
89
lint:
910
use:
1011
- DEFAULT

0 commit comments

Comments
 (0)