forked from getporter/porter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add porter credentials create command (getporter#1838)
* Add porter credentials create command Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Set default value of output format to yaml Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Remove required validation of FILE to enable writing the output to standard output Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Add examples for YAML and fix JSON content of CredentialSet Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Use error formating from errors package Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Write log to stderr instead Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Remove using yaml for the --output flag default value Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Log error when file format can't be deduced either from file extension of positional argument or outputtype flag Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Use switch statement for checking output type and enable print to stdout whene no filename is supplied Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Fix and add testcases Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Add checking for file extension Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Add comments for the yaml example Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Use secret key for credential set of secret type Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Remove schema from filename of the credential set with JSON format type Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Retrieve appropraite file for JSON format type of credential set Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * Remove schema from test filename Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com>
- Loading branch information
1 parent
ecedc49
commit 65f914c
Showing
9 changed files
with
386 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: "porter credentials create" | ||
slug: porter_credentials_create | ||
url: /cli/porter_credentials_create/ | ||
--- | ||
## porter credentials create | ||
|
||
Create a Credential | ||
|
||
### Synopsis | ||
|
||
Create a new blank resource for the definition of a Credential Set. | ||
|
||
``` | ||
porter credentials create [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
porter credentials create FILE [--output yaml|json] | ||
porter credentials create credential-set.json | ||
porter credentials create credential-set --output yaml | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for create | ||
--output string Credential set resource file format | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--debug Enable debug logging | ||
--debug-plugins Enable plugin debug logging | ||
--experimental strings Comma separated list of experimental features to enable. See https://porter.sh/configuration/#experimental-feature-flags for available feature flags. | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [porter credentials](/cli/porter_credentials/) - Credentials commands | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
pkg/templates/templates/credentials/create/credential-set.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"schemaType": "CredentialSet", | ||
"schemaVersion": "1.0.0", | ||
"name": "NAME", | ||
"namespace": "NAMESPACE", | ||
"labels": { | ||
"LABEL": "LABEL_VALUE" | ||
}, | ||
"credentials": [ | ||
{ | ||
"name": "credential-path", | ||
"source": { | ||
"path": "/path/to/credential-path-file.txt" | ||
} | ||
}, | ||
{ | ||
"name": "credential-command", | ||
"source": { | ||
"command": "echo 'credential command'" | ||
} | ||
}, | ||
{ | ||
"name": "credential-env", | ||
"source": { | ||
"ENV": "CREDENTIAL_ENV" | ||
} | ||
}, | ||
{ | ||
"name": "credential-value", | ||
"source": { | ||
"value": "credentialvalue" | ||
} | ||
}, | ||
{ | ||
"name": "credential-secret", | ||
"source": { | ||
"secret": "credential-secret" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.