-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add get packages
sub-command
#303
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package get | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
const ( | ||
packageTemplatePath = "templates/package.tmpl" | ||
) | ||
|
||
var PackagesCmd = &cobra.Command{ | ||
Use: "packages", | ||
Short: "retrieve package info from the cluster", | ||
Long: ``, | ||
RunE: getPackagesE, | ||
} | ||
|
||
type PackageTemplateData struct { | ||
Name string `json:"name"` | ||
Namespace string `json:"namespace"` | ||
Category string `json:"category"` | ||
PackageType string `json:"packageType"` | ||
Spec PackageSpecTemplateData `json:"spec"` | ||
} | ||
|
||
type PackageSpecTemplateData struct { | ||
Description string `json:"description"` | ||
URL string `json:"url"` | ||
Credentials map[string]string `json:"credentials"` | ||
} | ||
|
||
func getPackagesE(cmd *cobra.Command, args []string) error { | ||
return nil | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package get |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: {{ .Name }} | ||
namespace: {{ .Namespace }} | ||
category: {{ .Category }} | ||
package-type: {{ .PackageType }} | ||
spec: | ||
description: {{ .Description }} | ||
url: {{ .URL }} | ||
credentials: | ||
{{- range $key, $value := .Credentials }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for working on this. This template file is not meant to be YAML parseable though. I know it looks like one but it's meant for humans to read the outputs easily. We have a yaml output option for yaml parsing purposes: idpbuilder/pkg/cmd/get/secrets.go Lines 179 to 198 in e8e2319
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--------------------------- | ||
Name: {{ .Name }} | ||
Namespace: {{ .Namespace }} | ||
Data: | ||
--- | ||
name: {{ .Name }} | ||
namespace: {{ .Namespace }} | ||
data: | ||
{{- range $key, $value := .Data }} | ||
{{ $key }} : {{ $value }} | ||
{{ $key }}: {{ $value }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly do not know if we can get this kind of data right now.