megaease / easemesh

A service mesh implementation for connecting, control, and observe services in spring-cloud.
https://megaease.com/easemesh
Apache License 2.0
507 stars 61 forks source link

Mesh deployment deletion has incorrect behaivor #31

Closed zhao-kun closed 3 years ago

zhao-kun commented 3 years ago

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.

zhao-kun commented 3 years ago

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