Documentation ¶
Index ¶
- func FilterChanges(cfg plugins.ConfigUpdater, changes []github.PullRequestChange, ...) map[plugins.ConfigMapID][]ConfigMapUpdate
- func GetConfigMapClient(kc corev1.ConfigMapsGetter, namespace string, ...) (corev1.ConfigMapInterface, error)
- func Update(fg FileGetter, kc corev1.ConfigMapInterface, name, namespace string, ...) error
- type ConfigMapUpdate
- type FileGetter
- type OSFileGetter
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 ¶
ConfigMapUpdate is populated with information about a config map that should be updated. If the Filename is missing, then this update means that the key should be deleted.
func MarkStaleKeysForDeletion ¶
func MarkStaleKeysForDeletion( configMap *coreapi.ConfigMap, updates []ConfigMapUpdate, ) []ConfigMapUpdate
MarkStaledKeysForDeletion returns a slice of ConfigMapUpdate entries for keys that were missing from the updates, and which should be deleted. This only makes sense for bootstrap mode (for the config-bootstrapper).
type FileGetter ¶
FileGetter knows how to get the contents of a file by name
type OSFileGetter ¶
type OSFileGetter struct {
Root string
}