Documentation
¶
Overview ¶
Copyright © 2019 Portworx
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.
Index ¶
- Constants
- func AddCommonLogOptions(lc *cobra.Command)
- func FillContainerInfo(vols []*api.SdkVolumeInspectResponse, cvOps *CliVolumeOps, ...) error
- func GetCommonLogOptions(cmd *cobra.Command) (*kubernetes.COpsLogOptions, error)
- func GetRequiredPortworxPods(cvOps *CliVolumeOps, nodeNames []string, portworxNamespace string) ([]kubernetes.ContainerInfo, error)
- func ValidateCliInput(cmd *cobra.Command, args []string) error
- type CliVolumeInputs
- type CliVolumeOps
Constants ¶
const (
PORTWORX_CONTAINER_NAME = "portworx"
)
Variables ¶
This section is empty.
Functions ¶
func AddCommonLogOptions ¶
func FillContainerInfo ¶
func FillContainerInfo( vols []*api.SdkVolumeInspectResponse, cvOps *CliVolumeOps, lo *kubernetes.COpsLogOptions, allLogs bool, ) error
This method looks at each of the volumes and figures out a) Which nodes the volume has relevance to such as where its replicas
are and where the node is attached
b) Converts the node names to appropriate portworx pods c) Figures out which pods are using this volume and which of the
containers inside those pods use the volume
Figures out all the unique namespace, pod and container combinations and returns those
func GetCommonLogOptions ¶
func GetCommonLogOptions(cmd *cobra.Command) (*kubernetes.COpsLogOptions, error)
func GetRequiredPortworxPods ¶
func GetRequiredPortworxPods( cvOps *CliVolumeOps, nodeNames []string, portworxNamespace string, ) ([]kubernetes.ContainerInfo, error)
From the given lost of nodeName, figures out the Portworx pods on those nodes
Types ¶
type CliVolumeInputs ¶
type CliVolumeInputs struct { util.BaseFormatOutput Wide bool ShowLabels bool VolumeNames []string ShowK8s bool // If namespace is nil, use default namespace // if namespace is "", use all-namespaces // else use specified namespace Namespace *string Labels map[string]string }
func GetCliVolumeInputs ¶
func GetCliVolumeInputs(cmd *cobra.Command, args []string) *CliVolumeInputs
GetCliVolumeInputs looks for all of the common flags and create a new cliVolumeInputs object
func (*CliVolumeInputs) GetNamespace ¶
func (p *CliVolumeInputs) GetNamespace(cmd *cobra.Command)
Checks if namespace is specified and if so set it
type CliVolumeOps ¶
type CliVolumeOps struct { CliVolumeInputs PxVolumeOps portworx.PxVolumeOps }
func NewCliVolumeOps ¶
func NewCliVolumeOps( cvi *CliVolumeInputs, ) *CliVolumeOps
Create a new cliVolumeOps object
func (*CliVolumeOps) Close ¶
func (p *CliVolumeOps) Close()
func (*CliVolumeOps) Connect ¶
func (p *CliVolumeOps) Connect() error
Connect will make connections to pxc and k8s (if needed).