-
Notifications
You must be signed in to change notification settings - Fork 19
Support multiple input parameters #470
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
Merged
Trojan295
merged 11 commits into
capactio:main
from
Trojan295:support-multiple-parameters
Sep 7, 2021
Merged
Support multiple input parameters #470
Trojan295
merged 11 commits into
capactio:main
from
Trojan295:support-multiple-parameters
Sep 7, 2021
Conversation
This file contains hidden or 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
abe6fc3
to
19651ab
Compare
lukaszo
reviewed
Sep 3, 2021
internal/cli/upgrade/upgrade.go
Outdated
@@ -374,7 +374,11 @@ func mapToInputTypeInstances(capactCfg gqllocalapi.TypeInstance) ([]*gqlengine.I | |||
} | |||
|
|||
func mapToInputParameters(params capact.InputParameters) (gqlengine.JSON, error) { | |||
marshalled, err := json.Marshal(params) | |||
parameters := map[string]interface{}{ | |||
"input-parameters": params, |
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.
Maybe make it a constant?
// RUN apk add jq=1.6-r1 | ||
|
||
Command: []string{"sh", "-c"}, | ||
Args: []string{fmt.Sprintf(`cat "%s" | jq -r '%s' | tee "%s" && sleep 1`, inputFilepath, jqPath, outputFilepath)}, |
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.
Maybe instead of using jq to extract parameters, we can just store then in secrets as separate keys?
Instead of:
apiVersion: v1
data:
parameters.json: eyJleHRyYS1wYXJhbWV0ZXJzIjp7ImRlZmF1bHREQk5hbWUiOiJleHRyYS1kYmRiIiwic3VwZXJ1c2VyIjp7InBhc3N3b3JkIjoiZXh0cmEtcGFzczEyMyIsInVzZXJuYW1lIjoiZXh0cmEifX0sImlucHV0LXBhcmFtZXRlcnMiOnsiZGVmYXVsdERCTmFtZSI6ImRiZGIiLCJzdXBlcnVzZXIiOnsicGFzc3dvcmQiOiJjYXBhY3QtcGFzczEyMyIsInVzZXJuYW1lIjoiY2FwYWN0In19fQ==
We could do:
apiVersion: v1
data:
input-parameters: <base64>
another-parameters: <base64>
361d31e
to
de6249f
Compare
de6249f
to
722d812
Compare
lukaszo
approved these changes
Sep 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes proposed in this pull request:
Testing
AFAIK we don't have any Interface with two input parameters. I added a test for this + you can run an existing Action, eg. setup a Bitnami Helm Postgresql using the following input parameters:
Check also
capact upgrade
on a cluster from this PR and CLI compiled from this PR:capact upgrade --action-name-prefix 'capact-upgrade-' --version @latest --helm-repo-url @latest --increase-resource-limits --wait
Related issue(s)
Resolves #468