github.com/verrazzano/verrazzano-monitoring-operator@v0.0.30/pkg/resources/configmaps/configmap.go (about) 1 // Copyright (C) 2020, Oracle and/or its affiliates. 2 // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 3 4 package configmaps 5 6 import ( 7 vmcontrollerv1 "github.com/verrazzano/verrazzano-monitoring-operator/pkg/apis/vmcontroller/v1" 8 "github.com/verrazzano/verrazzano-monitoring-operator/pkg/resources" 9 corev1 "k8s.io/api/core/v1" 10 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 11 ) 12 13 // NewConfig returns a Kubernetes ConfigMap containing the runner config that is volume mounted to /etc/canary-runner/config.yaml 14 func NewConfig(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance, mapname string, data map[string]string) *corev1.ConfigMap { 15 16 configMap := &corev1.ConfigMap{ 17 ObjectMeta: metav1.ObjectMeta{ 18 Labels: resources.GetMetaLabels(vmo), 19 Name: mapname, 20 Namespace: vmo.Namespace, 21 OwnerReferences: resources.GetOwnerReferences(vmo), 22 }, 23 Data: data, 24 } 25 return configMap 26 }