megaease/easemesh

Mesh deployment deletion has incorrect behaivor

zhao-kun opened this issue · 1 comments

Background

Imaging we have two MeshDeployment resources, that are same service.

apiVersion: mesh.megaease.com/v1beta1
kind: MeshDeployment
metadata:
  namespace: spring-petclinic
  name: customers-service
spec:
  service:
    name: customers-service
    labels: {}
  deploy:
    replicas: 1
    selector:
...
apiVersion: mesh.megaease.com/v1beta1
kind: MeshDeployment
metadata:
  namespace: spring-petclinic
  name: customers-service-canary
spec:
  service:
    name: customers-service
    labels: 
     canary: lvl
  deploy:
    replicas: 1
    selector:
...

The First spec is meshdeployment named with customers-service, the second is meshdeployment name with customers-service-canary

When I delete the customer-service, the CRD Operator executes incorrect logic which deletes both customer-service and customers-service-canary deployments

kubectl delete meshdeployments customers-service

Expection

The Operator delete deployment correctly.

It's not a bug, cause by incorrect operation.