modules

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Copyright 2020 The MetaGraph 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.

Index

Constants

This section is empty.

Variables

View Source
var (
	All           bool
	NameSpace     string // Used to pass namespace from cmd to module to avoid import cycle.
	Output        bool   // Flag passing hack
	Version       string // Flag passing hack
	Verbose       bool   // Flag passing hack
	Dryrun        bool   // Flag passing hack
	Branch        string // Flag passing hack
	BaseEnvs      bool   //Flag passing hack
	CVfile        string //Flag passing hack
	Defaults      bool   //Flag passing hack
	Format        string // Flag passing hack
	Template      string // Flag passing hack
	Suffix        string // Flag passing hack
	Enforce       bool
	ImageNS       string
	Registry      string
	Tag           string
	OName         string
	Context       string // Application context root from FlagPassingHack.
	CreateGlobals bool
)

This is a complete hack. todo: fix this shit, restructure packages

View Source
var EnvBlacklistFilter []string = []string{
	"path",
	"home",
	"bash",
	"env",
	"sti",
	"openshift",
}

Slice of strings that we wash environment variables with from the base image when creating a deploymentconfig

View Source
var LabelBlacklistFilter []string = []string{
	"openshift",
	"s2i",
	"license",
	"k8s",
}

Slice of strings that we wash labels from baseimage with when creating a deploymentconfig

View Source
var TmplBasePath = "/usr/share/metagraf/templates"

todo this should be made a configuration option, distribution of templates are also "unsolved"

View Source
var Variables map[string]string

Functions

func ConfigSecretName added in v0.0.6

func ConfigSecretName(c *metagraf.Config) string

func DeleteBuildConfig added in v0.0.30

func DeleteBuildConfig(name string)

func DeleteConfigMap added in v0.0.30

func DeleteConfigMap(name string)

func DeleteConfigMaps added in v0.0.30

func DeleteConfigMaps(mg *metagraf.MetaGraf)

func DeleteDeploymentConfig added in v0.0.30

func DeleteDeploymentConfig(name string)

func DeleteImageStream added in v0.0.30

func DeleteImageStream(name string)

func DeleteRoute added in v0.0.30

func DeleteRoute(name string)

func DeleteSecret added in v0.0.30

func DeleteSecret(name string)

func DeleteSecrets added in v0.0.30

func DeleteSecrets(mg *metagraf.MetaGraf)

func DeleteService added in v0.0.30

func DeleteService(name string)

func EnvToEnvVar

func EnvToEnvVar(e *metagraf.EnvironmentVar, ext bool) corev1.EnvVar

Applies conventions and override logic to an environment variable and returns a corev1.EnvVar{}.

func ExternalEnvToEnvVar

func ExternalEnvToEnvVar(e *metagraf.EnvironmentVar) corev1.EnvVar

Prepends _ to indicate environment variable name to indicate a variable that comes from some external configuration repository. How you use this is an implementation detail in the runtime container image.

func FindMetagrafConfigMaps added in v0.0.12

func FindMetagrafConfigMaps(mg *metagraf.MetaGraf) map[string]string

This function will inspect the metaGraf specification for which configmaps it will need to create and their type in a map.

func FindSecrets

func FindSecrets(mg *metagraf.MetaGraf) map[string]string

func GenBuildConfig

func GenBuildConfig(mg *metagraf.MetaGraf)

func GenConfigMaps

func GenConfigMaps(mg *metagraf.MetaGraf)

Entry function for creating a slew of configmaps, this will be somewhat specific to NT internal workings for now.

func GenDeployment

func GenDeployment(mg *metagraf.MetaGraf, namespace string)

func GenDeploymentConfig

func GenDeploymentConfig(mg *metagraf.MetaGraf, namespace string)

Todo: Still needs to be split up, but some refactoring has been done.

func GenDotFromPath

func GenDotFromPath(cpath string)

func GenEnvVar_JVM_SYS_PROP added in v0.0.31

func GenEnvVar_JVM_SYS_PROP(mg *metagraf.MetaGraf, name string) corev1.EnvVar

Generate an EnvVar for a config section. SecretFrom or EnvFrom will not be processed.

func GenImageStream

func GenImageStream(mg *metagraf.MetaGraf, namespace string)

func GenRef

func GenRef(mg *metagraf.MetaGraf)

func GenRoute

func GenRoute(mg *metagraf.MetaGraf)

func GenSecrets

func GenSecrets(mg *metagraf.MetaGraf)

todo: flag creation of resource secrets?

func GenService

func GenService(mg *metagraf.MetaGraf)

func GetConfigMap added in v0.0.12

func GetConfigMap(name string) (*corev1.ConfigMap, error)

Fetch a ConfigMap resource the connected kubernetes cluster.

func GetMetagrafConfigByType added in v0.0.12

func GetMetagrafConfigByType(mg *metagraf.MetaGraf, ctype string) []metagraf.Config

Returns a slice of metagraf Config structs that match specific ctype string

func GetSecret added in v0.0.12

func GetSecret(name string) (*corev1.Secret, error)

func HasJVM_SYS_PROP added in v0.0.31

func HasJVM_SYS_PROP(mg *metagraf.MetaGraf) bool

Identify if a metagraf specification has a JVM_SYS_PROP configuration type. This is a special type for handling system properties in the java space that your application might not know about.

func InspectConfigMaps

func InspectConfigMaps(mg *metagraf.MetaGraf)

func InspectSecrets

func InspectSecrets(mg *metagraf.MetaGraf)

func MGAppName

func MGAppName(mg *metagraf.MetaGraf) string

func MarshalObject

func MarshalObject(obj runtime.Object)

Marshal kubernetes resource to json

func Name

func Name(mg *metagraf.MetaGraf) string

Returns a name for a resource based on convention as follows.

func ResourceSecretName

func ResourceSecretName(r *metagraf.Resource) string

Returns a name for a secret for a resource based on convention as follows.

func SpecName added in v0.0.19

func SpecName(mg *metagraf.MetaGraf) string

Return a specification name for a resource base on convention. Does not adhere to override flags.

func StoreBuildConfig

func StoreBuildConfig(obj buildv1.BuildConfig)

func StoreConfigMap

func StoreConfigMap(m corev1.ConfigMap)

func StoreDeployment added in v0.0.32

func StoreDeployment(obj appsv1.Deployment)

func StoreDeploymentConfig

func StoreDeploymentConfig(obj appsv1.DeploymentConfig)

func StoreImageStream

func StoreImageStream(obj imagev1.ImageStream)

func StoreRoute

func StoreRoute(obj routev1.Route)

func StoreSecret

func StoreSecret(obj corev1.Secret)

func StoreService

func StoreService(obj corev1.Service)

func ValueFromEnv

func ValueFromEnv(key string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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