cli

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 11 Imported by: 2

Documentation

Overview

Package cli describes the operating environment for the OSM cli and includes convenience functions for the OSM cli.

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.

Licensed under the MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This package is heavily inspired by how the Helm project handles environment variables: https://github.com/helm/helm/blob/master/pkg/cli/environment.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChartSource

func GetChartSource(path string) (string, error)

GetChartSource is a helper to convert a filepath to a chart to a base64-encoded, gzipped tarball.

func LoadChart

func LoadChart(source string) (*chart.Chart, error)

LoadChart is a helper to turn a base64-encoded, gzipped tarball into a chart.

Types

type EnvSettings

type EnvSettings struct {
	// contains filtered or unexported fields
}

EnvSettings describes all of the cli environment settings

func New

func New() *EnvSettings

New relevant environment variables set and returns EnvSettings

func (*EnvSettings) AddFlags

func (s *EnvSettings) AddFlags(fs *pflag.FlagSet)

AddFlags binds flags to the given flagset.

func (*EnvSettings) EnvVars

func (s *EnvSettings) EnvVars() map[string]string

EnvVars returns a map of all OSM related environment variables

func (*EnvSettings) Namespace

func (s *EnvSettings) Namespace() string

Namespace gets the namespace from the configuration

func (*EnvSettings) RESTClientGetter

func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter

RESTClientGetter gets the kubeconfig from EnvSettings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL