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.
Copyright 2020 The OSM contributors ¶
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 ¶
- func DoesTargetRefDstPod(spec v1alpha3.TrafficTargetSpec, dstPod *corev1.Pod) bool
- func DoesTargetRefSrcPod(spec v1alpha3.TrafficTargetSpec, srcPod *corev1.Pod) bool
- func GetChartSource(path string) ([]byte, error)
- func GetEnvoyProxyConfig(clientSet kubernetes.Interface, config *rest.Config, namespace string, ...) ([]byte, error)
- type EnvConfig
- type EnvConfigInstall
- type EnvSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesTargetRefDstPod ¶ added in v0.10.0
func DoesTargetRefDstPod(spec v1alpha3.TrafficTargetSpec, dstPod *corev1.Pod) bool
DoesTargetRefDstPod checks whether the TrafficTarget spec refers to the destination pod's service account
func DoesTargetRefSrcPod ¶ added in v0.10.0
func DoesTargetRefSrcPod(spec v1alpha3.TrafficTargetSpec, srcPod *corev1.Pod) bool
DoesTargetRefSrcPod checks whether the TrafficTarget spec refers to the source pod's service account
func GetChartSource ¶
GetChartSource is a helper to convert a filepath to a chart to a base64-encoded, gzipped tarball.
Types ¶
type EnvConfig ¶ added in v0.10.0
type EnvConfig struct {
Install EnvConfigInstall `yaml:"install"`
}
EnvConfig represents the environment configuration of OSM
type EnvConfigInstall ¶ added in v0.10.0
type EnvConfigInstall struct { Kind string `yaml:"kind"` Distribution string `yaml:"distribution"` Namespace string `yaml:"namespace"` }
EnvConfigInstall represents the environment configuration of OSM install
type EnvSettings ¶
type EnvSettings struct {
// contains filtered or unexported fields
}
EnvSettings describes all of the cli environment settings
func (*EnvSettings) AddFlags ¶
func (s *EnvSettings) AddFlags(fs *pflag.FlagSet)
AddFlags binds flags to the given flagset.
func (*EnvSettings) Config ¶ added in v0.10.0
func (s *EnvSettings) Config() EnvConfig
Config returns the environment config
func (*EnvSettings) IsManaged ¶ added in v0.10.0
func (s *EnvSettings) IsManaged() bool
IsManaged returns true in a managed OSM environment (ex. managed by a cloud distributor)
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
func (*EnvSettings) Verbose ¶ added in v0.10.0
func (s *EnvSettings) Verbose() bool
Verbose gets whether verbose output is enabled from the configuration