mirror of
https://github.com/kubevirt/containerized-data-importer.git
synced 2025-06-03 06:30:22 +00:00
Set label operator.cdi.kubevirt.io to deployment spec of cdi-operator
This commit is contained in:
parent
3f663890c9
commit
c72e1d5a18
@ -144,16 +144,15 @@ func CreateRole(name string) *rbacv1.Role {
|
|||||||
|
|
||||||
//CreateOperatorDeploymentSpec creates deployment
|
//CreateOperatorDeploymentSpec creates deployment
|
||||||
func CreateOperatorDeploymentSpec(name, namespace, matchKey, matchValue, serviceAccount string, numReplicas int32) *appsv1.DeploymentSpec {
|
func CreateOperatorDeploymentSpec(name, namespace, matchKey, matchValue, serviceAccount string, numReplicas int32) *appsv1.DeploymentSpec {
|
||||||
|
matchMap := map[string]string{matchKey: matchValue}
|
||||||
spec := &appsv1.DeploymentSpec{
|
spec := &appsv1.DeploymentSpec{
|
||||||
Replicas: &numReplicas,
|
Replicas: &numReplicas,
|
||||||
Selector: &metav1.LabelSelector{
|
Selector: &metav1.LabelSelector{
|
||||||
MatchLabels: map[string]string{
|
MatchLabels: WithOperatorLabels(matchMap),
|
||||||
"name": "cdi-operator",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Template: corev1.PodTemplateSpec{
|
Template: corev1.PodTemplateSpec{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Labels: map[string]string{"name": "cdi-operator"},
|
Labels: WithOperatorLabels(matchMap),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -167,16 +166,12 @@ func CreateOperatorDeploymentSpec(name, namespace, matchKey, matchValue, service
|
|||||||
|
|
||||||
//CreateOperatorDeployment creates deployment
|
//CreateOperatorDeployment creates deployment
|
||||||
func CreateOperatorDeployment(name, namespace, matchKey, matchValue, serviceAccount string, numReplicas int32) *appsv1.Deployment {
|
func CreateOperatorDeployment(name, namespace, matchKey, matchValue, serviceAccount string, numReplicas int32) *appsv1.Deployment {
|
||||||
//matchMap := map[string]string{matchKey: matchValue}
|
|
||||||
deployment := &appsv1.Deployment{
|
deployment := &appsv1.Deployment{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
APIVersion: "apps/v1",
|
APIVersion: "apps/v1",
|
||||||
Kind: "Deployment",
|
Kind: "Deployment",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Labels: map[string]string{
|
|
||||||
"operator.cdi.kubevirt.io": "",
|
|
||||||
},
|
|
||||||
Name: name,
|
Name: name,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user