updateconfig

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

README

DOCUMENTATION DEPRECATION NOTICE: This file is deprecated. Please refer to the new migrated location. Please do not edit this file; instead, make changes to the new location!

The new location is served on the web at https://docs.prow.k8s.io/docs/.

This file will be deleted on 2023-02-28.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterChanges

func FilterChanges(cfg plugins.ConfigUpdater, changes []github.PullRequestChange, defaultNamespace string, bootstrap bool, log *logrus.Entry) map[plugins.ConfigMapID][]ConfigMapUpdate

FilterChanges determines which of the changes are relevant for config updating, returning mapping of config map to key to filename to update that key from.

func GetConfigMapClient

func GetConfigMapClient(kc corev1.ConfigMapsGetter, namespace string, buildClusterCoreV1Clients map[string]corev1.CoreV1Interface, cluster string) (corev1.ConfigMapInterface, error)

GetConfigMapClient returns a configMap interface according to the given cluster and namespace

func Update

func Update(fg FileGetter, kc corev1.ConfigMapInterface, name, namespace string, updates []ConfigMapUpdate, bootstrap bool, metrics *prometheus.GaugeVec, logger *logrus.Entry, sha string) error

Update updates the configmap with the data from the identified files. Existing configmap keys that are not included in the updates are left alone unless bootstrap is true in which case they are deleted.

Types

type ConfigMapUpdate

type ConfigMapUpdate struct {
	Key, Filename string
	GZIP          bool
}

ConfigMapUpdate is populated with information about a config map that should be updated.

type FileGetter

type FileGetter interface {
	GetFile(filename string) ([]byte, error)
}

FileGetter knows how to get the contents of a file by name

type OSFileGetter

type OSFileGetter struct {
	Root string
}

func (*OSFileGetter) GetFile

func (g *OSFileGetter) GetFile(filename string) ([]byte, error)

Jump to

Keyboard shortcuts

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