Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-32442

Need a ptpOperatorConfig webhook to prevent users from creating a new event config (instead of using default)

XMLWordPrintable

    • No
    • CNF Ran Sprint 252
    • 1
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      Description of problem:

        If we create a new ptpOperatorConfig to enable events, it doesn't take effect and no cloud-event-proxy is started. The user should get an error while creating new ptpoperatorconfig instead of processing that CR.
      All changes should be instead applied to "default" PTPOperatorConfig with "oc apply".
      
      # oc get ptpoperatorconfigs.ptp.openshift.io event-config -n openshift-ptp -o yaml
      apiVersion: ptp.openshift.io/v1
      kind: PtpOperatorConfig
      metadata:
        creationTimestamp: "2024-04-13T15:57:22Z"
        generation: 1
        name: event-config
        namespace: openshift-ptp
        resourceVersion: "9598731"
        uid: 37acc727-d329-4386-919d-29ba56dab588
      spec:
        daemonNodeSelector:
          node-role.kubernetes.io/master: ""
        ptpEventConfig:
          enableEventPublisher: true
          transportHost: http://ptp-event-publisher-service-e32-h27-r750.openshift-ptp.svc.cluster.local:9043
      
      
      # oc get ptpoperatorconfigs.ptp.openshift.io -n openshift-ptp
      NAME           EVENT ENABLED
      default
      event-config   true
      
      # ps aux | grep "cloud-event"
      root     3256327  0.0  0.0  12144  1208 pts/8    S+   16:22   0:00 grep --
      

      Version-Release number of selected component (if applicable):

          

      How reproducible:

      1. Install PTP Operator
      2. Create a new PTPOperatorConfig (oc create -f ptpOperatorConfig.yaml)" - see description
      3. Check "oc get ptpoperatorconfigs.ptp.openshift.io -n openshift-ptp"
      New config is getting created alongside the already existing default one.

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

          Able to create new ptpOperatorConfig under a different name than "default"

      Expected results:

          New ptpOperatorConfig should be prevented from getting created with an error message

      Additional info:

          

              aputtur@redhat.com Aneesh Puttur
              nchhabra@redhat.com Noreen Chhabra
              Hen Shay Hassid Hen Shay Hassid
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: