Skip to content

Commit

Permalink
Merge branch 'main' into update_e2e_with_managed
Browse files Browse the repository at this point in the history
  • Loading branch information
coleenquadros authored May 23, 2024
2 parents ae41f18 + 29695d9 commit 0fdcef9
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions tests/pkg/utils/mco_configmaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,6 @@ import (
"k8s.io/klog"
)

func CreateConfigMap(opt TestOptions, isHub bool, cm *corev1.ConfigMap) error {
clientKube := getKubeClient(opt, isHub)
found, err := clientKube.CoreV1().
ConfigMaps(cm.ObjectMeta.Namespace).
Get(context.TODO(), cm.ObjectMeta.Name, metav1.GetOptions{})
if err != nil && errors.IsNotFound(err) {
_, err := clientKube.CoreV1().
ConfigMaps(cm.ObjectMeta.Namespace).
Create(context.TODO(), cm, metav1.CreateOptions{})
if err == nil {
klog.V(1).Infof("configmap %s created", cm.ObjectMeta.Name)
}
return err
}
if err != nil {
return err
}
cm.ObjectMeta.ResourceVersion = found.ObjectMeta.ResourceVersion
_, err = clientKube.CoreV1().ConfigMaps(cm.ObjectMeta.Namespace).Update(context.TODO(), cm, metav1.UpdateOptions{})
if err == nil {
klog.V(1).Infof("configmap %s updated", cm.ObjectMeta.Name)
}
return err
}

func GetConfigMap(opt TestOptions, isHub bool, name string,
namespace string) (error, *corev1.ConfigMap) {
clientKube := getKubeClientForCluster(clusterConfig, isHub)
Expand Down

0 comments on commit 0fdcef9

Please sign in to comment.