Skip to content

Commit

Permalink
Merge pull request #93 from portainer/feat88-shortnames
Browse files Browse the repository at this point in the history
feat: introduce shortnames for all resources
  • Loading branch information
deviantony authored Nov 9, 2024
2 parents a239b27 + 4db7b7e commit 7dd8270
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/api/apis/apps/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (svc AppsService) ListAPIResources(r *restful.Request, w *restful.Response)
Name: "deployments",
Verbs: []string{"create", "list", "delete", "get", "patch"},
Namespaced: true,
ShortNames: []string{"deploy"},
},
},
}
Expand Down
1 change: 1 addition & 0 deletions internal/api/apis/batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (svc BatchService) ListAPIResources(r *restful.Request, w *restful.Response
Name: "jobs",
Verbs: []string{"create", "list", "delete", "get", "patch"},
Namespaced: true,
ShortNames: []string{"job"},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/api/apis/storage.k8s.io/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func (svc StorageService) ListAPIResources(r *restful.Request, w *restful.Respon
Kind: "StorageClass",
SingularName: "",
Name: "storageclasses",
ShortNames: []string{"sc"},
Verbs: []string{"list", "get"},
Namespaced: false,
ShortNames: []string{"sc"},
},
},
}
Expand Down
4 changes: 4 additions & 0 deletions internal/api/core/v1/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (svc V1Service) ListAPIResources(r *restful.Request, w *restful.Response) {
Name: "events",
Verbs: []string{"list"},
Namespaced: false,
ShortNames: []string{"ev"},
},
{
Kind: "Namespace",
Expand All @@ -90,6 +91,7 @@ func (svc V1Service) ListAPIResources(r *restful.Request, w *restful.Response) {
Name: "nodes",
Verbs: []string{"list", "get"},
Namespaced: false,
ShortNames: []string{"no"},
},
{
Kind: "PersistentVolume",
Expand All @@ -113,13 +115,15 @@ func (svc V1Service) ListAPIResources(r *restful.Request, w *restful.Response) {
Name: "pods",
Verbs: []string{"create", "list", "delete", "get", "patch"},
Namespaced: true,
ShortNames: []string{"po"},
},
{
Kind: "Secret",
SingularName: "",
Name: "secrets",
Verbs: []string{"create", "list", "delete", "get", "patch"},
Namespaced: true,
ShortNames: []string{"sec"},
},
{
Kind: "Service",
Expand Down

0 comments on commit 7dd8270

Please sign in to comment.