mirror of https://github.com/helm/helm
As part of this port, I removed some now superfluous code from the `action` package. This is technically a breaking change, but since the package was introduced in v3, it is highly unlikely anyone is using it and we are still within the beta window. Also closes #6437 Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>pull/6504/head
parent
85572df378
commit
eac6a60001
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
Copyright The Helm Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
|
"helm.sh/helm/pkg/action"
|
||||||
|
"helm.sh/helm/pkg/cli/values"
|
||||||
|
)
|
||||||
|
|
||||||
|
const outputFlag = "output"
|
||||||
|
|
||||||
|
func addValueOptionsFlags(f *pflag.FlagSet, v *values.Options) {
|
||||||
|
f.StringSliceVarP(&v.ValueFiles, "values", "f", []string{}, "specify values in a YAML file or a URL(can specify multiple)")
|
||||||
|
f.StringArrayVar(&v.Values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
|
||||||
|
f.StringArrayVar(&v.StringValues, "set-string", []string{}, "set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
|
||||||
|
f.StringArrayVar(&v.FileValues, "set-file", []string{}, "set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)")
|
||||||
|
}
|
||||||
|
|
||||||
|
func addChartPathOptionsFlags(f *pflag.FlagSet, c *action.ChartPathOptions) {
|
||||||
|
f.StringVar(&c.Version, "version", "", "specify the exact chart version to install. If this is not specified, the latest version is installed")
|
||||||
|
f.BoolVar(&c.Verify, "verify", false, "verify the package before installing it")
|
||||||
|
f.StringVar(&c.Keyring, "keyring", defaultKeyring(), "location of public keys used for verification")
|
||||||
|
f.StringVar(&c.RepoURL, "repo", "", "chart repository url where to locate the requested chart")
|
||||||
|
f.StringVar(&c.Username, "username", "", "chart repository username where to locate the requested chart")
|
||||||
|
f.StringVar(&c.Password, "password", "", "chart repository password where to locate the requested chart")
|
||||||
|
f.StringVar(&c.CertFile, "cert-file", "", "identify HTTPS client using this SSL certificate file")
|
||||||
|
f.StringVar(&c.KeyFile, "key-file", "", "identify HTTPS client using this SSL key file")
|
||||||
|
f.StringVar(&c.CaFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle")
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindOutputFlag will add the output flag to the given command and bind the
|
||||||
|
// value to the given string pointer
|
||||||
|
func bindOutputFlag(cmd *cobra.Command, varRef *string) {
|
||||||
|
// NOTE(taylor): A possible refactor here is that we can implement all the
|
||||||
|
// validation for the OutputFormat type here so we don't have to do the
|
||||||
|
// parsing and checking in the command
|
||||||
|
cmd.Flags().StringVarP(varRef, outputFlag, "o", string(action.Table), fmt.Sprintf("Prints the output in the specified format. Allowed values: %s, %s, %s", action.Table, action.JSON, action.YAML))
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
[{"Name":"testing/mariadb","Version":"0.3.0","AppVersion":"","Description":"Chart for MariaDB"}]
|
@ -0,0 +1,4 @@
|
|||||||
|
- AppVersion: 2.3.4
|
||||||
|
Description: Deploy a basic Alpine Linux pod
|
||||||
|
Name: testing/alpine
|
||||||
|
Version: 0.2.0
|
@ -1 +1 @@
|
|||||||
{"name":"flummoxed-chickadee","info":{"first_deployed":"0001-01-01T00:00:00Z","last_deployed":"2016-01-16T00:00:00Z","deleted":"0001-01-01T00:00:00Z","status":"deployed","notes":"release notes"},"namespace":"default"}
|
{"name":"flummoxed-chickadee","info":{"first_deployed":"0001-01-01T00:00:00Z","last_deployed":"2016-01-16T00:00:00Z","deleted":"0001-01-01T00:00:00Z","status":"deployed","notes":"release notes"},"namespace":"default"}
|
||||||
|
Loading…
Reference in new issue