Open chenyufeifei opened 2 years ago
What happened: First, I create a nodePool
cat <<EOF | kubectl apply -f - apiVersion: apps.openyurt.io/v1alpha1 kind: NodePool metadata: name: test spec: type: Edge labels: foo: bar EOF
Second, I add a label in a node
kubectl label nodes kind-worker foo=bar
Third, I add the node to the nodepool
kubectl label node kind-worker apps.openyurt.io/desired-nodepool=test
Last, I delete the node from the nodePool
kubectl label node kind-worker apps.openyurt.io/desired-nodepool-
What you expected to happen:
The node should have a label foo=bar
foo=bar
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
I read the source code, find it record the nodePool related attribute. https://github.com/openyurtio/yurt-app-manager/blob/5dc7d07355df12cd63ebc3cb7692f601a932b7a1/pkg/yurtappmanager/controller/nodepool/nodepool_controller.go#L236-L241 https://github.com/openyurtio/yurt-app-manager/blob/5dc7d07355df12cd63ebc3cb7692f601a932b7a1/pkg/yurtappmanager/controller/nodepool/nodepool_controller.go#L325-L327
When the node delete from the nodepool, all label will be deleted include the same label.
https://github.com/openyurtio/yurt-app-manager/blob/5dc7d07355df12cd63ebc3cb7692f601a932b7a1/pkg/yurtappmanager/controller/nodepool/nodepool_controller.go#L268-L304
Environment:
kubectl version
cat /etc/os-release
uname -a
others
/kind bug
@kadisi PTAL
What happened: First, I create a nodePool
Second, I add a label in a node
Third, I add the node to the nodepool
Last, I delete the node from the nodePool
What you expected to happen:
The node should have a label
foo=bar
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
I read the source code, find it record the nodePool related attribute. https://github.com/openyurtio/yurt-app-manager/blob/5dc7d07355df12cd63ebc3cb7692f601a932b7a1/pkg/yurtappmanager/controller/nodepool/nodepool_controller.go#L236-L241 https://github.com/openyurtio/yurt-app-manager/blob/5dc7d07355df12cd63ebc3cb7692f601a932b7a1/pkg/yurtappmanager/controller/nodepool/nodepool_controller.go#L325-L327
When the node delete from the nodepool, all label will be deleted include the same label.
https://github.com/openyurtio/yurt-app-manager/blob/5dc7d07355df12cd63ebc3cb7692f601a932b7a1/pkg/yurtappmanager/controller/nodepool/nodepool_controller.go#L268-L304
Environment:
kubectl version
):cat /etc/os-release
):uname -a
):others
/kind bug