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

spec.containers.image is empty when use 'oc new-app' created deploy when build/deploymentconfig are not installed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done-Errata
    • Critical
    • 4.15.0
    • 4.14
    • oc
    • None
    • Important
    • No
    • Approved
    • False
    • Hide

      None

      Show
      None
    • NA
    • Release Note Not Required
    • In Progress

    Description

      Description of problem:

      If not installed capability operator build and deploymentconfig, when use `oc new-app registry.redhat.io/<namespace>/<image>:<tag>` , the created deployment emptied spec.containers[0].image. The deploy will fail to start pod.

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

      oc version
      Client Version: 4.14.0-0.nightly-2023-08-22-221456
      Kustomize Version: v5.0.1
      Server Version: 4.14.0-0.nightly-2023-09-02-132842
      Kubernetes Version: v1.27.4+2c83a9f

      How reproducible:

      Always

      Steps to Reproduce:

      1. Installed cluster without build/deploymentconfig function
      Set "baselineCapabilitySet: None" in install-config
      2.Create a deploy using 'new-app' cmd
      oc new-app registry.redhat.io/ubi8/httpd-24:latest
      3.
      

      Actual results:

      2.
      $oc new-app registry.redhat.io/ubi8/httpd-24:latest
      --> Found container image c412709 (11 days old) from registry.redhat.io for "registry.redhat.io/ubi8/httpd-24:latest"    Apache httpd 2.4
          ----------------
          Apache httpd 2.4 available as container, is a powerful, efficient, and extensible web server. Apache supports a variety of features, many implemented as compiled modules which extend the core functionality. These can range from server-side programming language support to authentication schemes. Virtual hosting allows one Apache installation to serve many different Web sites.    Tags: builder, httpd, httpd-24    * An image stream tag will be created as "httpd-24:latest" that will track this image--> Creating resources ...
          imagestream.image.openshift.io "httpd-24" created
          deployment.apps "httpd-24" created
          service "httpd-24" created
      --> Success
          Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
           'oc expose service/httpd-24'
          Run 'oc status' to view your app
      
      3. oc get deploy -o yaml
       apiVersion: v1
      items:
      - apiVersion: apps/v1
        kind: Deployment
        metadata:
          annotations:
            deployment.kubernetes.io/revision: "1"
            image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"httpd-24:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"httpd-24\")].image"}]'
            openshift.io/generated-by: OpenShiftNewApp
          creationTimestamp: "2023-09-04T07:44:01Z"
          generation: 1
          labels:
            app: httpd-24
            app.kubernetes.io/component: httpd-24
            app.kubernetes.io/instance: httpd-24
          name: httpd-24
          namespace: wxg
          resourceVersion: "115441"
          uid: 909d0c4e-180c-4f88-8fb5-93c927839903
        spec:
          progressDeadlineSeconds: 600
          replicas: 1
          revisionHistoryLimit: 10
          selector:
            matchLabels:
              deployment: httpd-24
          strategy:
            rollingUpdate:
              maxSurge: 25%
              maxUnavailable: 25%
            type: RollingUpdate
          template:
            metadata:
              annotations:
                openshift.io/generated-by: OpenShiftNewApp
              creationTimestamp: null
              labels:
                deployment: httpd-24
            spec:
              containers:
              - image: ' '
                imagePullPolicy: IfNotPresent
                name: httpd-24
                ports:
                - containerPort: 8080
                  protocol: TCP
                - containerPort: 8443
                  protocol: TCP
                resources: {}
                terminationMessagePath: /dev/termination-log
                terminationMessagePolicy: File
              dnsPolicy: ClusterFirst
              restartPolicy: Always
              schedulerName: default-scheduler
              securityContext: {}
              terminationGracePeriodSeconds: 30
        status:
          conditions:
          - lastTransitionTime: "2023-09-04T07:44:01Z"
            lastUpdateTime: "2023-09-04T07:44:01Z"
            message: Created new replica set "httpd-24-7f6b55cc85"
            reason: NewReplicaSetCreated
            status: "True"
            type: Progressing
          - lastTransitionTime: "2023-09-04T07:44:01Z"
            lastUpdateTime: "2023-09-04T07:44:01Z"
            message: Deployment does not have minimum availability.
            reason: MinimumReplicasUnavailable
            status: "False"
            type: Available
          - lastTransitionTime: "2023-09-04T07:44:01Z"
            lastUpdateTime: "2023-09-04T07:44:01Z"
            message: 'Pod "httpd-24-7f6b55cc85-pvvgt" is invalid: spec.containers[0].image:
              Invalid value: " ": must not have leading or trailing whitespace'
            reason: FailedCreate
            status: "True"
            type: ReplicaFailure
          observedGeneration: 1
          unavailableReplicas: 1
      kind: List
      metadata:

      Expected results:

      Should set spec.containers[0].image to registry.redhat.io/ubi8/httpd-24:latest

      Additional info:

       

      Attachments

        Issue Links

          Activity

            People

              aguclu@redhat.com Arda Guclu
              xiuwang xiujuan wang
              Rama Kasturi Narra Rama Kasturi Narra
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: