botkube icon indicating copy to clipboard operation
botkube copied to clipboard

Delete PVC not sending event to webhook

Open prasenforu opened this issue 5 years ago • 0 comments

When I am deleting PVC in namespace () its throwing PV resource instead of PVC, & namespace coming empty. Seems its a BUG

[root@minio-nfs ~]# oc get pvc -n piggyapp
NAME           STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
test-nfs-pvc   Bound    pvc-ae3c5854-8dd4-11ea-b269-42010a800005   50Mi       RWX            kubenfs-storage   10s
[root@minio-nfs ~]# oc delete pvc test-nfs-pvc -n piggyapp
persistentvolumeclaim "test-nfs-pvc" deleted
[root@minio-nfs ~]# oc get pvc -n piggyapp

in my webhook, I am getting following json data.

{\"meta\":{\"cluster\":\"not-configured\",\"kind\":\"PersistentVolume\",\"name\":\"pvc-ae3c5854-8dd4-11ea-b269-42010a800005\",\"namespace\":\"\"},\"status\":{\"level\":\"critical\",\"type\":\"delete\"},\"summary\":\"PersistentVolume *pvc-ae3c5854-8dd4-11ea-b269-42010a800005* has been deleted in *not-configured* cluster\\n\",\"timestamp\":\"2020-05-04T06:59:07Z\"}

Namespace coming blank, resource name ac PersistentVolume not PVC

My configuration as follows..

apiVersion: v1
kind: ConfigMap
metadata:
  name: botkube-configmap
  namespace: velero-auto
  labels:
    app: botkube
data:
  resource_config.yaml: |
    ## Resources you want to watch
    resources:
      - name: service
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: ingress
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: namespace
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: persistentvolume
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: persistentvolumeclaim
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: role
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: rolebinding
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: clusterrole
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: clusterrolebinding
        namespaces:
          include:
            - all
          ignore:
            -
        events:
          - delete
      - name: configmap
        namespaces:
          include:
            - demo-mongo
          ignore:
            -
        events:
          - delete
    # Check true if you want to receive recommendations
    # about the best practices for the created resource
    recommendations: true
    # Setting to support multiple clusters
    settings:
      # Cluster name to differentiate incoming messages
      clustername: not-configured
      # Kubectl executor configs
      kubectl:
        # Set true to enable kubectl commands execution
        enabled: false
        # set Namespace to execute botkube kubectl commands by default
        defaultNamespace: default
        # Set true to enable commands execution from configured channel only
        restrictAccess: false
      # Set true to enable config watcher
      configwatcher: true
      # Set false to disable upgrade notification
      upgradeNotifier: true

prasenforu avatar May 04 '20 06:05 prasenforu