extensions

package
v1.0.88 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 25 Imported by: 3

Documentation

Index

Constants

View Source
const ExtensionsConfigDefaultConfigMap = "jenkins-x-extensions"
View Source
const (
	ExtensionsDefinitionFile = "jenkins-x-extension-definitions.yaml"
)
View Source
const (
	// PluginCommandLabel is the label applied to plugins to allow them to be found
	PluginCommandLabel = "jenkins.io/pluginCommand"
)

Variables

View Source
var (
	// DefaultPlatforms the default list of platforms to create plugins for
	DefaultPlatforms = []Platform{
		{
			Goarch: "amd64",
			Goos:   "Windows",
		},
		{
			Goarch: "amd64",
			Goos:   "Darwin",
		},
		{
			Goarch: "amd64",
			Goos:   "Linux",
		},
		{
			Goarch: "arm",
			Goos:   "Linux",
		},
		{
			Goarch: "386",
			Goos:   "Linux",
		},
	}
)

Functions

func CreateBinaries

func CreateBinaries(createURLFn func(Platform) string) []jenkinsv1.Binary

CreateBinaries a helper function to create the binary resources for the platforms for a given callback

func EnsurePluginInstalled

func EnsurePluginInstalled(plugin jenkinsv1.Plugin, pluginBinDir string) (string, error)

EnsurePluginInstalled ensures that the correct version of a plugin is installed locally. It will clean up old versions.

func EnsurePluginInstalledForAliasFile

func EnsurePluginInstalledForAliasFile(plugin jenkinsv1.Plugin, pluginBinDir string, aliasFileName string) (string, error)

EnsurePluginInstalledForAliasFile ensures that the correct version of a plugin is installed locally. It will clean up old versions.

func ExtensionOwnerRef

func ExtensionOwnerRef(ext *jenkinsv1.Extension) metav1.OwnerReference

func FindPluginUrl

func FindPluginUrl(plugin jenkinsv1.PluginSpec) (string, error)

FindPluginUrl finds the download URL for the current platform for a plugin

func GetAndDeduplicateChildrenRecursively

func GetAndDeduplicateChildrenRecursively(ext jenkinsv1.Extension, lookupByUUID map[string]jenkinsv1.Extension,
	exts map[string]*jenkinsv1.Extension) error

GetAndDeduplicateChildrenRecursively will walk a tree of extensions rooted at ext and add them to the flattened set exts. The lookupByUUID map is used to resolve UUID references to Extensions, and a warning will be emitted if the extension is not present in the lookupByUUID map.

func GetOrCreateExtensionsConfig

func GetOrCreateExtensionsConfig(kubeClient kubernetes.Interface, ns string) (*corev1.ConfigMap, error)

func ToExecutable

func ToExecutable(e *jenkinsv1.ExtensionSpec, paramValues []jenkinsv1.ExtensionParameterValue, teamNamespace string, exts jenkinsv1client.ExtensionInterface) (ext jenkinsv1.ExtensionExecution, envVarsStr string, err error)

TODO remove the env vars formatting stuff from here and make it a function on ExtensionSpec

func ValidatePlugins

func ValidatePlugins(jxClient jenkinsv1client.Interface, ns string) error

ValidatePlugins tells the user about any problems with plugins installed

Types

type CommandOverrideVerifier

type CommandOverrideVerifier struct {
	Root        *cobra.Command
	SeenPlugins map[string]string
}

CommandOverrideVerifier verifies a set of plugins

func (*CommandOverrideVerifier) Verify

func (v *CommandOverrideVerifier) Verify(path string) []error

Verify implements PathVerifier and determines if a given path is valid depending on whether or not it overwrites an existing jx command path, or a previously seen plugin.

type PathVerifier

type PathVerifier interface {
	// Verify determines if a given path is valid
	Verify(path string) []error
}

PathVerifier receives a path and determines if it is valid or not

type Platform

type Platform struct {
	Goarch string
	Goos   string
}

Platform represents a platform for binaries

func (Platform) Extension

func (p Platform) Extension() string

Extension returns the default distribution extension; `tar.gz` or `zip` for windows

func (Platform) IsWindows

func (p Platform) IsWindows() bool

IsWindows returns true if the platform is windows

Jump to

Keyboard shortcuts

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