Documentation ¶
Overview ¶
Package cli describes the operating environment for the FSM cli and includes convenience functions for the FSM 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 FSM 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 GetSidecarProxyConfig(clientSet kubernetes.Interface, config *rest.Config, namespace string, ...) ([]byte, error)
- type EnvConfig
- type EnvConfigInstall
- type EnvSettings
- func (s *EnvSettings) AddFlags(fs *pflag.FlagSet)
- func (s *EnvSettings) Config() EnvConfig
- func (s *EnvSettings) Factory() common.Factory
- func (s *EnvSettings) FsmNamespace() string
- func (s *EnvSettings) IOStreams() genericiooptions.IOStreams
- func (s *EnvSettings) IsManaged() bool
- func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter
- func (s *EnvSettings) Verbose() bool
- type Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesTargetRefDstPod ¶
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 ¶
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 ¶
type EnvConfig struct {
Install EnvConfigInstall `yaml:"install"`
}
EnvConfig represents the environment configuration of FSM
type EnvConfigInstall ¶
type EnvConfigInstall struct { Kind string `yaml:"kind"` Distribution string `yaml:"distribution"` Namespace string `yaml:"namespace"` }
EnvConfigInstall represents the environment configuration of FSM 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 ¶
func (s *EnvSettings) Config() EnvConfig
Config returns the environment config
func (*EnvSettings) Factory ¶
func (s *EnvSettings) Factory() common.Factory
Factory returns the factory from the configuration
func (*EnvSettings) FsmNamespace ¶
func (s *EnvSettings) FsmNamespace() string
FsmNamespace gets the fsm-namespace from the configuration
func (*EnvSettings) IOStreams ¶
func (s *EnvSettings) IOStreams() genericiooptions.IOStreams
IOStreams returns the IOStreams from the configuration
func (*EnvSettings) IsManaged ¶
func (s *EnvSettings) IsManaged() bool
IsManaged returns true in a managed FSM environment (ex. managed by a cloud distributor)
func (*EnvSettings) RESTClientGetter ¶
func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter
RESTClientGetter gets the kubeconfig from EnvSettings
func (*EnvSettings) Verbose ¶
func (s *EnvSettings) Verbose() bool
Verbose gets whether verbose output is enabled from the configuration