Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/cli/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ func newConfigCmd() *cobra.Command {
Short: "Configure this client",
}

cmd.AddCommand(newOCIRepositoryCreateCmd(), newConfigSaveCmd(), newConfigViewCmd(), newConfigResetCmd())
cmd.AddCommand(newConfigSaveCmd(), newConfigViewCmd(), newConfigResetCmd())
return cmd
}
58 changes: 0 additions & 58 deletions app/cli/cmd/config_ocirepository_set.go

This file was deleted.

6 changes: 3 additions & 3 deletions app/cli/cmd/organization_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func contextTableOutput(config *action.ConfigContextItem) error {
gt.AppendRow(table.Row{"Logged in as", config.CurrentUser.Email})
gt.AppendSeparator()
gt.AppendRow(table.Row{"Organization", config.CurrentOrg.Name})
repo := config.CurrentOCIRepo
if repo != nil {
backend := config.CurrentCASBackend
if backend != nil {
gt.AppendSeparator()
gt.AppendRow(table.Row{"OCI repository", fmt.Sprintf("%s (status=%q)", repo.Repo, repo.ValidationStatus)})
gt.AppendRow(table.Row{"Default CAS Backend", fmt.Sprintf("%s (provider=%s, status=%q)", backend.Location, backend.Provider, backend.ValidationStatus)})
}

gt.Render()
Expand Down
36 changes: 7 additions & 29 deletions app/cli/internal/action/config_current_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,16 @@ func NewConfigCurrentContext(cfg *ActionsOpts) *ConfigCurrentContext {
}

type ConfigContextItem struct {
CurrentUser *ConfigContextItemUser
CurrentOrg *OrgItem
CurrentOCIRepo *ConfigContextItemOCIRepo
CurrentUser *ConfigContextItemUser
CurrentOrg *OrgItem
CurrentCASBackend *CASBackendItem
}

type ConfigContextItemUser struct {
ID, Email string
CreatedAt *time.Time
}

type ConfigContextItemOCIRepo struct {
ID, Repo string
CreatedAt *time.Time
ValidationStatus ValidationStatus
}

func (action *ConfigCurrentContext) Run() (*ConfigContextItem, error) {
client := pb.NewContextServiceClient(action.cfg.CPConnection)
resp, err := client.Current(context.Background(), &pb.ContextServiceCurrentRequest{})
Expand All @@ -56,29 +50,13 @@ func (action *ConfigCurrentContext) Run() (*ConfigContextItem, error) {

res := resp.GetResult()

item := &ConfigContextItem{
return &ConfigContextItem{
CurrentUser: &ConfigContextItemUser{
ID: res.GetCurrentUser().Id,
Email: res.GetCurrentUser().Email,
CreatedAt: toTimePtr(res.GetCurrentUser().CreatedAt.AsTime()),
},
CurrentOrg: pbOrgItemToAction(res.GetCurrentOrg()),
}

repo := res.GetCurrentOciRepo()
if repo != nil {
r := &ConfigContextItemOCIRepo{
ID: repo.GetId(), Repo: repo.GetRepo(), CreatedAt: toTimePtr(repo.GetCreatedAt().AsTime()),
}

switch repo.GetValidationStatus() {
case pb.OCIRepositoryItem_VALIDATION_STATUS_OK:
r.ValidationStatus = Valid
case pb.OCIRepositoryItem_VALIDATION_STATUS_INVALID:
r.ValidationStatus = Invalid
}

item.CurrentOCIRepo = r
}
return item, nil
CurrentOrg: pbOrgItemToAction(res.GetCurrentOrg()),
CurrentCASBackend: pbCASBackendItemToAction(res.GetCurrentCasBackend()),
}, nil
}
53 changes: 0 additions & 53 deletions app/cli/internal/action/ocirepository_save.go

This file was deleted.

4 changes: 2 additions & 2 deletions app/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func errorInfo(err error, logger zerolog.Logger) (string, int) {

// Make overrides
switch {
case v1.IsOciRepositoryErrorReasonRequired(err):
case v1.IsCasBackendErrorReasonRequired(err):
msg = "you need to enable a CAS backend first. Refer to `chainloop cas-backend` command or contact your administrator."
case v1.IsOciRepositoryErrorReasonInvalid(err):
case v1.IsCasBackendErrorReasonInvalid(err):
msg = "the CAS backend you provided is invalid. Refer to `chainloop cas-backend update` command or contact your administrator."
case v1.IsAllowListErrorNotInList(err):
msg = "your user is not part of the private beta yet. You can request access at https://docs.chainloop.dev/getting-started/private-beta"
Expand Down
6 changes: 5 additions & 1 deletion app/controlplane/api/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: d1263fe26f8e430a967dc22a4d0cad18
commit: cc916c31859748a68fd229a3c8d7a2e8
- remote: buf.build
owner: kratos-go
repository: kratos
commit: e1d52e944e3845c6862a566db322432d
1 change: 1 addition & 0 deletions app/controlplane/api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ breaking:
deps:
- buf.build/googleapis/googleapis
- buf.build/envoyproxy/protoc-gen-validate:45685e052c7e406b9fbd441fc7a568a5
- buf.build/kratos-go/kratos
lint:
use:
- DEFAULT
Expand Down
Loading