feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
48
vendor/helm.sh/helm/v3/pkg/action/push.go
vendored
48
vendor/helm.sh/helm/v3/pkg/action/push.go
vendored
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package action
|
||||
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"helm.sh/helm/v3/pkg/cli"
|
||||
@@ -29,8 +30,14 @@ import (
|
||||
//
|
||||
// It provides the implementation of 'helm push'.
|
||||
type Push struct {
|
||||
Settings *cli.EnvSettings
|
||||
cfg *Configuration
|
||||
Settings *cli.EnvSettings
|
||||
cfg *Configuration
|
||||
certFile string
|
||||
keyFile string
|
||||
caFile string
|
||||
insecureSkipTLSverify bool
|
||||
plainHTTP bool
|
||||
out io.Writer
|
||||
}
|
||||
|
||||
// PushOpt is a type of function that sets options for a push action.
|
||||
@@ -43,6 +50,36 @@ func WithPushConfig(cfg *Configuration) PushOpt {
|
||||
}
|
||||
}
|
||||
|
||||
// WithTLSClientConfig sets the certFile, keyFile, and caFile fields on the push configuration object.
|
||||
func WithTLSClientConfig(certFile, keyFile, caFile string) PushOpt {
|
||||
return func(p *Push) {
|
||||
p.certFile = certFile
|
||||
p.keyFile = keyFile
|
||||
p.caFile = caFile
|
||||
}
|
||||
}
|
||||
|
||||
// WithInsecureSkipTLSVerify determines if a TLS Certificate will be checked
|
||||
func WithInsecureSkipTLSVerify(insecureSkipTLSVerify bool) PushOpt {
|
||||
return func(p *Push) {
|
||||
p.insecureSkipTLSverify = insecureSkipTLSVerify
|
||||
}
|
||||
}
|
||||
|
||||
// WithPlainHTTP configures the use of plain HTTP connections.
|
||||
func WithPlainHTTP(plainHTTP bool) PushOpt {
|
||||
return func(p *Push) {
|
||||
p.plainHTTP = plainHTTP
|
||||
}
|
||||
}
|
||||
|
||||
// WithOptWriter sets the registryOut field on the push configuration object.
|
||||
func WithPushOptWriter(out io.Writer) PushOpt {
|
||||
return func(p *Push) {
|
||||
p.out = out
|
||||
}
|
||||
}
|
||||
|
||||
// NewPushWithOpts creates a new push, with configuration options.
|
||||
func NewPushWithOpts(opts ...PushOpt) *Push {
|
||||
p := &Push{}
|
||||
@@ -59,10 +96,15 @@ func (p *Push) Run(chartRef string, remote string) (string, error) {
|
||||
c := uploader.ChartUploader{
|
||||
Out: &out,
|
||||
Pushers: pusher.All(p.Settings),
|
||||
Options: []pusher.Option{},
|
||||
Options: []pusher.Option{
|
||||
pusher.WithTLSClientConfig(p.certFile, p.keyFile, p.caFile),
|
||||
pusher.WithInsecureSkipTLSVerify(p.insecureSkipTLSverify),
|
||||
pusher.WithPlainHTTP(p.plainHTTP),
|
||||
},
|
||||
}
|
||||
|
||||
if registry.IsOCI(remote) {
|
||||
// Don't use the default registry client if tls options are set.
|
||||
c.Options = append(c.Options, pusher.WithRegistryClient(p.cfg.RegistryClient))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user