utils

package
v0.0.0-...-38f7937 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

In this package you can find useful methods which interacting with the openshift cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeProject

func ChangeProject(projectName string)

Change to the project: projectName.

func CheckErrorMessage

func CheckErrorMessage(err error, message string)

functions that show the error in the console with some message

func CreateObject

func CreateObject(path string)

Deploy the object in path

func CreateSecret

func CreateSecret(secretName string)

Create a secret. All the info of the object should be in templates/secrets secretName supported are s3 or minio

func GetAllValue

func GetAllValue(PathTemplate, PathData, ClusterFrom, ClusterTo, ProjectTo, ProjectFrom,
	UsernameTo, UsernameFrom, PasswordFrom, PasswordTo string, ObjectsOc []string)

Get ALL the configuration using the key: "s" from the config file ~/.volume2volume.yaml

func GetAllValueFromObject

func GetAllValueFromObject(confObject confObject.ConfObject)

func GetAllValueReturn

func GetAllValueReturn(PathTemplate, PathData, ClusterFrom, ClusterTo, ProjectTo, ProjectFrom,
	UsernameTo, UsernameFrom, PasswordFrom, PasswordTo string, ObjectsOc []string) (string, string, string, string,
	string, string, string, string, string, string, []string)

Get ALL the configuration using the key: "s" from the config file ~/.volume2volume.yaml

func GetAllValueReturnObject

func GetAllValueReturnObject(confObject confObject.ConfObject) confObject.ConfObject

func GetDeploymentReplicaSet

func GetDeploymentReplicaSet(pod string) (string, string)

func GetObjects

func GetObjects(typeObject string) string

Get the objects of the typeObjects in the cluster and the project that you login beforehand.

func GetSizeVolume

func GetSizeVolume(podName, containerName, pathData string) string

Get size of the volume (used for stats)

func GetTypeObjects

func GetTypeObjects(ObjectsOc, ObjectsTypes []string) []string

GET CONFIGURATION

func GetValueFromConfig

func GetValueFromConfig(s string) interface{}

Get the configuration using the key: "s" from the config file ~/.volume2volume.yaml

func In_array

func In_array(val interface{}, array interface{}) (exists bool, index int)

func LoginAdmin

func LoginAdmin(cluster string)

Login to the user admin (minishift) TODO chante it for production clusters

func LoginCluster

func LoginCluster(cluster, username, password string)

login in the openshift cluster

func ReadJson

func ReadJson(path, name string) map[string]interface{}

Json functions

func ReadJsonArray

func ReadJsonArray(path, name string) []map[string]interface{}

Json functions

func ReadJsonData

func ReadJsonData(path string) []map[string]interface{}

Json functions

func WriteJson

func WriteJson(path, name string, data map[string]interface{}) error

Json functions

func WriteJsonArray

func WriteJsonArray(path, name string, data []map[string]interface{}) error

Json functions

Types

This section is empty.

Jump to

Keyboard shortcuts

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