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

[AWS]Webhook prompt should be given when marketType is invalid

    • Moderate
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

          Webhook prompt should be given when marketType is invalid like other features
      liuhuali@Lius-MacBook-Pro huali-test % oc create -f ms1.yaml 
      Error from server (Forbidden): error when creating "ms1.yaml": admission webhook "validation.machineset.machine.openshift.io" denied the request: providerSpec.networkInterfaceType: Invalid value: "1": Valid values are: ENA, EFA and omitted

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

          4.19.0-0.nightly-2025-03-05-160850

      How reproducible:

      always    

      Steps to Reproduce:

          1.Install an AWS cluster
      
      liuhuali@Lius-MacBook-Pro huali-test % oc get clusterversion
      NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
      version   4.19.0-0.nightly-2025-03-05-160850   True        False         5h37m   Cluster version is 4.19.0-0.nightly-2025-03-05-160850
      
          2.Create a machineset with invalid marketType, for example, marketType: "1", the machine stuck in Provisioning, although I can see some messages in the machine providerStatus and machine-controller log, I think we should give explicit webhook prompt to be consistent with other features.
      
      huliu-aws36a-6bslb-worker-us-east-2aa-f89jk   Provisioning                                         8m42s
      
        providerStatus:
          conditions:
          - lastTransitionTime: "2025-03-06T07:49:51Z"
            message: invalid MarketType "1"
            reason: MachineCreationFailed
            status: "False"
            type: MachineCreation
      
      E0306 08:01:07.645341       1 actuator.go:72] huliu-aws36a-6bslb-worker-us-east-2aa-f89jk error: huliu-aws36a-6bslb-worker-us-east-2aa-f89jk: reconciler failed to Create machine: failed to launch instance: invalid MarketType "1"
      W0306 08:01:07.645377       1 controller.go:409] huliu-aws36a-6bslb-worker-us-east-2aa-f89jk: failed to create machine: huliu-aws36a-6bslb-worker-us-east-2aa-f89jk: reconciler failed to Create machine: failed to launch instance: invalid MarketType "1"
      E0306 08:01:07.645427       1 controller.go:341] "msg"="Reconciler error" "error"="huliu-aws36a-6bslb-worker-us-east-2aa-f89jk: reconciler failed to Create machine: failed to launch instance: invalid MarketType \"1\"" "controller"="machine-controller" "name"="huliu-aws36a-6bslb-worker-us-east-2aa-f89jk" "namespace"="openshift-machine-api" "object"={"name":"huliu-aws36a-6bslb-worker-us-east-2aa-f89jk","namespace":"openshift-machine-api"} "reconcileID"="e3aeeeda-2537-4e83-a787-2cbcf9926646"
      I0306 08:01:07.645499       1 recorder.go:104] "msg"="huliu-aws36a-6bslb-worker-us-east-2aa-f89jk: reconciler failed to Create machine: failed to launch instance: invalid MarketType \"1\"" "logger"="events" "object"={"kind":"Machine","namespace":"openshift-machine-api","name":"huliu-aws36a-6bslb-worker-us-east-2aa-f89jk","uid":"a7ef8a7b-87d5-4569-93a4-47a7a2d16325","apiVersion":"machine.openshift.io/v1beta1","resourceVersion":"118757"} "reason"="FailedCreate" "type"="Warning"
      
      
      liuhuali@Lius-MacBook-Pro huali-test % oc get machineset huliu-aws36a-6bslb-worker-us-east-2aa -oyaml
      apiVersion: machine.openshift.io/v1beta1
      kind: MachineSet
      metadata:
        annotations:
          capacity.cluster-autoscaler.kubernetes.io/labels: kubernetes.io/arch=amd64
          machine.openshift.io/GPU: "0"
          machine.openshift.io/memoryMb: "16384"
          machine.openshift.io/vCPU: "4"
        creationTimestamp: "2025-03-06T07:49:50Z"
        generation: 1
        labels:
          machine.openshift.io/cluster-api-cluster: huliu-aws36a-6bslb
        name: huliu-aws36a-6bslb-worker-us-east-2aa
        namespace: openshift-machine-api
        resourceVersion: "118745"
        uid: 65e94786-6c1a-42b8-9bf3-9fe0d3f4adf3
      spec:
        replicas: 1
        selector:
          matchLabels:
            machine.openshift.io/cluster-api-cluster: huliu-aws36a-6bslb
            machine.openshift.io/cluster-api-machineset: huliu-aws36a-6bslb-worker-us-east-2aa
        template:
          metadata:
            labels:
              machine.openshift.io/cluster-api-cluster: huliu-aws36a-6bslb
              machine.openshift.io/cluster-api-machine-role: worker
              machine.openshift.io/cluster-api-machine-type: worker
              machine.openshift.io/cluster-api-machineset: huliu-aws36a-6bslb-worker-us-east-2aa
          spec:
            lifecycleHooks: {}
            metadata: {}
            providerSpec:
              value:
                ami:
                  id: ami-0e763ecd8ccccbc99
                apiVersion: machine.openshift.io/v1beta1
                blockDevices:
                - ebs:
                    encrypted: true
                    iops: 0
                    kmsKey:
                      arn: ""
                    volumeSize: 120
                    volumeType: gp3
                capacityReservationId: ""
                credentialsSecret:
                  name: aws-cloud-credentials
                deviceIndex: 0
                iamInstanceProfile:
                  id: huliu-aws36a-6bslb-worker-profile
                instanceType: m6i.xlarge
                kind: AWSMachineProviderConfig
                marketType: "1"
                metadata:
                  creationTimestamp: null
                metadataServiceOptions: {}
                placement:
                  availabilityZone: us-east-2a
                  region: us-east-2
                securityGroups:
                - filters:
                  - name: tag:Name
                    values:
                    - huliu-aws36a-6bslb-node
                - filters:
                  - name: tag:Name
                    values:
                    - huliu-aws36a-6bslb-lb
                subnet:
                  filters:
                  - name: tag:Name
                    values:
                    - huliu-aws36a-6bslb-subnet-private-us-east-2a
                tags:
                - name: kubernetes.io/cluster/huliu-aws36a-6bslb
                  value: owned
                userDataSecret:
                  name: worker-user-data
      status:
        fullyLabeledReplicas: 1
        observedGeneration: 1
        replicas: 1
      liuhuali@Lius-MacBook-Pro huali-test % 
      
          

      Actual results:

         machine stuck in Provisioning, and some messages shown in the machine providerStatus and machine-controller log

      Expected results:

         give explicit webhook prompt to be consistent with other features. like
      
      liuhuali@Lius-MacBook-Pro huali-test % oc create -f ms1.yaml Error from server (Forbidden): error when creating "ms1.yaml": admission webhook "validation.machineset.machine.openshift.io" denied the request: providerSpec.networkInterfaceType: Invalid value: "1": Valid values are: ENA, EFA and omitted

      Additional info:

      New feature testing for https://issues.redhat.com/browse/OCPCLOUD-2780    

              athiruma@redhat.com Thirumalesh Aaraveti
              huliu@redhat.com Huali Liu
              Huali Liu Huali Liu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: