Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add simillar labels to the each components #148

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

iamniting
Copy link
Member

@iamniting iamniting commented Apr 11, 2022

Add labels to the topolvm-controller, topolvm-node, vg-manager
for example:
app.lvm.openshift.io: topolvm-controller
app.lvm.openshift.io: topolvm-node
app.lvm.openshift.io: vg-manager

Signed-off-by: Nitin Goyal [email protected]

@iamniting iamniting requested review from nbalacha and leelavg and removed request for nbalacha April 11, 2022 05:22
},
Spec: appsv1.DeploymentSpec{
Replicas: &replicas,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
AppAttr: TopolvmControllerDeploymentName,
AppAttr: TopolvmControllerDeploymentName,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using this existing label anywhere? If not I would like to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

@@ -177,6 +177,8 @@ func getNodeDaemonSet(lvmCluster *lvmv1alpha1.LVMCluster, namespace string, init
}
labels := map[string]string{
"app": topolvmNodeName,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using this existing label anywhere? If not I would like to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

@@ -172,6 +172,7 @@ func newVGManagerDaemonset(lvmCluster *lvmv1alpha1.LVMCluster, namespace string,
}
labels := map[string]string{
"app": VGManagerUnit,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using this existing label anywhere? If not I would like to remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

Copy link
Contributor

@leelavg leelavg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • pardon, forgot to mention earlier, we might also need a label on manager itself.
  • in addition to this label if we can haveapp.kubernetes.io/part-of: lvmo as well then we can get all possible resources under lvmo using a single label.

@iamniting
Copy link
Member Author

/hold

Require discussion before merging the PR, As this will break the upgrades.

The Deployment "nginx-deployment" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"nginx", "nigoyal":"nigoyal"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable```

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 11, 2022
@iamniting
Copy link
Member Author

  • pardon, forgot to mention earlier, we might also need a label on manager itself.

That is a topic of discussion and should be taken care of separately as that is a CSV change and will break upgrades very badly.

  • in addition to this label if we can haveapp.kubernetes.io/part-of: lvmo as well then we can get all possible resources under lvmo using a single label.

We can even list all of them without adding the above labels using only key I added in the PR for example

$ oc get pod -l app
NAME                                READY   STATUS    RESTARTS   AGE
nginx-deployment-74dc8cc494-b4fpn   1/1     Running   0          21m
topolvm-node-lgps4                  4/4     Running   0          2d19h
vg-manager-7k5lf                    1/1     Running   0          2d19h

@iamniting iamniting force-pushed the labels branch 3 times, most recently from d5f04a3 to 7c16ae8 Compare April 14, 2022 07:25
@iamniting
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 14, 2022
@iamniting
Copy link
Member Author

┌─[nigoyalॐ nigoyal ~/code/go/src/github.com/red-hat-storage/lvm-operator  labels]
└──╼$ oc get pods -l app.lvm.topolvm.io
NAME                                  READY   STATUS    RESTARTS   AGE
topolvm-controller-7546d896f6-rqkgh   4/4     Running   0          3m41s
topolvm-node-ljt7d                    4/4     Running   0          3m41s
vg-manager-2mcj2                      1/1     Running   0          3m41s

┌─[nigoyalॐ nigoyal ~/code/go/src/github.com/red-hat-storage/lvm-operator  labels]
└──╼$ oc get pods -l app.lvm.topolvm.io=topolvm-controller
NAME                                  READY   STATUS    RESTARTS   AGE
topolvm-controller-7546d896f6-rqkgh   4/4     Running   0          3m48s

┌─[nigoyalॐ nigoyal ~/code/go/src/github.com/red-hat-storage/lvm-operator  labels]
└──╼$ oc get pods -l app.lvm.topolvm.io=topolvm-node
NAME                 READY   STATUS    RESTARTS   AGE
topolvm-node-ljt7d   4/4     Running   0          4m10s

┌─[nigoyalॐ nigoyal ~/code/go/src/github.com/red-hat-storage/lvm-operator  labels]
└──╼$ oc get pods -l app.lvm.topolvm.io=vg-manager
NAME               READY   STATUS    RESTARTS   AGE
vg-manager-2mcj2   1/1     Running   0          4m14s

@iamniting iamniting requested a review from leelavg April 14, 2022 07:27
Copy link
Contributor

@nbalacha nbalacha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a label to the main controller-manager as well.

Add labels to the topolvm-controller, topolvm-node, vg-manager
for example:
app.lvm.topolvm.io: topolvm-controller
app.lvm.topolvm.io: topolvm-node
app.lvm.topolvm.io: vg-manager

Signed-off-by: Nitin Goyal <[email protected]>
@iamniting
Copy link
Member Author

Please add a label to the main controller-manager as well.

I would like to take it as separate PR as the changes are in the kustomize and related files and not in the controller.

@iamniting iamniting requested a review from nbalacha April 14, 2022 09:32
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iamniting, nbalacha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2022
@openshift-merge-robot openshift-merge-robot merged commit 8ecfd77 into openshift:main Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants