Skip to content

Commit

Permalink
auto complete kind
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Feb 28, 2024
1 parent b230306 commit de2da94
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/api/storage/v1/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ func (s *Secret) ToAPI() (*v1.Secret, error) {
if err := json.Unmarshal([]byte(s.Data), &out); err != nil {
return nil, err
}
out.Namespace = s.Namespace
out.Name = s.Name
out.Creation = s.CreatedAt
out.SetName(s.Name)
out.SetNamespace(s.Namespace)
out.SetKind(v1.KindSecret)
return &out, nil
}

Expand Down Expand Up @@ -112,9 +113,10 @@ func (s *Workflow) ToAPI() (*v1.Workflow, error) {
if err := json.Unmarshal([]byte(s.Data), &out); err != nil {
return nil, err
}
out.Namespace = s.Namespace
out.Name = s.Name
out.Creation = s.CreatedAt
out.SetName(s.Name)
out.SetNamespace(s.Namespace)
out.SetKind(v1.KindWorkflow)
return &out, nil
}

Expand Down Expand Up @@ -157,9 +159,10 @@ func (s *Box) ToAPI() (*v1.Box, error) {
return nil, err
}
out.ID = s.ID
out.Namespace = s.Namespace
out.Name = s.Name
out.Creation = s.CreatedAt
out.SetName(s.Name)
out.SetNamespace(s.Namespace)
out.SetKind(v1.KindBox)
if out.Labels == nil {
out.Labels = make(map[string]string)
}
Expand Down

0 comments on commit de2da94

Please sign in to comment.