mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Simplify AddOdoProjectVolume and AddOdoMandatoryVolume * Rename / Clarify HandleEphemeralStorage function * Regroup volume-specific code * Move volume specific code to a separated function * Add a new module configAutomount * Automount PVC (without options) * Add unit tests * Separate functions * Mount secrets * Mount configmaps * Specific mount path * MountAs annotation * Mounting cm/secret as env * Refacto: use inAllContainers + replace result with volume * Mounting cm/secret as subpath * Read-only * Integration tests * Rename label * Automount during odo deploy Exec command * Add documentation * Fix TODO * Review * Fix indentation * Rename labels/annotations
27 lines
639 B
Go
27 lines
639 B
Go
package kclient
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
// ListConfigMaps lists all the configmaps based on the given label selector
|
|
func (c *Client) ListConfigMaps(labelSelector string) ([]corev1.ConfigMap, error) {
|
|
listOptions := metav1.ListOptions{}
|
|
if len(labelSelector) > 0 {
|
|
listOptions = metav1.ListOptions{
|
|
LabelSelector: labelSelector,
|
|
}
|
|
}
|
|
|
|
cmList, err := c.KubeClient.CoreV1().ConfigMaps(c.Namespace).List(context.TODO(), listOptions)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("unable to get configmap list: %w", err)
|
|
}
|
|
|
|
return cmList.Items, nil
|
|
}
|