github.com/uhthomas/helm@v3.0.0-beta.3+incompatible/pkg/action/chart_push.go (about) 1 /* 2 Copyright The Helm Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package action 18 19 import ( 20 "io" 21 22 "helm.sh/helm/internal/experimental/registry" 23 ) 24 25 // ChartPush performs a chart push operation. 26 type ChartPush struct { 27 cfg *Configuration 28 } 29 30 // NewChartPush creates a new ChartPush object with the given configuration. 31 func NewChartPush(cfg *Configuration) *ChartPush { 32 return &ChartPush{ 33 cfg: cfg, 34 } 35 } 36 37 // Run executes the chart push operation 38 func (a *ChartPush) Run(out io.Writer, ref string) error { 39 r, err := registry.ParseReference(ref) 40 if err != nil { 41 return err 42 } 43 return a.cfg.RegistryClient.PushChart(r) 44 }