cliops

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 17

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.

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 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

View Source
const (
	PORTWORX_CONTAINER_NAME = "portworx"
)

Variables

This section is empty.

Functions

func AddCommonLogOptions

func AddCommonLogOptions(lc *cobra.Command)

func FillContainerInfo

func FillContainerInfo(
	vols []*api.Volume,
	cliOps CliOps,
	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 GetCliAlertInputs added in v0.22.0

func GetCliAlertInputs(cmd *cobra.Command, args []string) *portworx.CliAlertInputs

func GetCliAuthInputs added in v0.31.1

func GetCliAuthInputs(cmd *cobra.Command, args []string) *portworx.CliAuthInputs

GetCliAuthInputs gets all CLI auth inputs

func GetCommonLogOptions

func GetCommonLogOptions(cmd *cobra.Command) (*kubernetes.COpsLogOptions, error)

func GetRequiredPortworxPods

func GetRequiredPortworxPods(
	cliOps CliOps,
	nodeNames []string,
	portworxNamespace string,
) ([]kubernetes.ContainerInfo, error)

From the given lot of nodeName, figures out the Portworx pods on those nodes

func ValidateCliInput

func ValidateCliInput(cmd *cobra.Command, args []string) error

Validating the user provided options

Types

type CliAlertOps added in v0.22.0

type CliAlertOps struct {
	portworx.CliAlertInputs
	PxAlertOps portworx.PxAlertOps
}

func NewCliAlertOps added in v0.22.0

func NewCliAlertOps(
	cvi *portworx.CliAlertInputs,
) *CliAlertOps

Create a new cliAlertOps object

type CliAuthOps added in v0.31.1

type CliAuthOps struct {
	portworx.CliAuthInputs
	AuthOps portworx.AuthOps
}

CliAuthOps represents an interface for auth commands

func NewCliAuthOps added in v0.31.1

func NewCliAuthOps(
	cvi *portworx.CliAuthInputs,
) *CliAuthOps

NewCliAuthOps creates a new cliAuthOps object

type CliInputs added in v0.22.0

type CliInputs struct {
	util.BaseFormatOutput
	Wide          bool
	ShowLabels    bool
	AllNamespaces bool
	Owner         string
	Labels        map[string]string
	Args          []string
}

func NewCliInputs added in v0.22.0

func NewCliInputs(cmd *cobra.Command, args []string) *CliInputs

NewCliVolumeInputs looks for all of the common flags and create a new cliVolumeInputs object

type CliOps added in v0.22.0

type CliOps interface {
	// Connect creates connections to portworx and if needed to k8s
	Connect() error
	// Close connections to portworx and k8s
	Close()
	// CliInputs returns the CliInputs
	CliInputs() *CliInputs
	// PxOps returns the portwor connection object
	PxOps() portworx.PxOps
	// COps returns the k8s connection object
	COps() kubernetes.COps
}

func GetCliOps added in v0.22.0

func GetCliOps() CliOps

func NewCliOps added in v0.22.0

func NewCliOps(ci *CliInputs) CliOps

Jump to

Keyboard shortcuts

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