Description of problem: There is a set of fields that are displayed as `null` in Build custom resources, rather than getting omitted, for example: ``` apiVersion: build.openshift.io/v1 kind: Build [...] spec: nodeSelector: null [...] source: - as: null from: [...] triggeredBy: null ``` Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. `oc get build -o yaml` 2. 3. Actual results: Expected results: Unset fields are omitted, rather than shown with a `null` value Additional info:
It can be reproduced, but now latest accepted payload is 4.5.0-0.nightly-2020-04-21-103613, will wait newer payload to check it. ''' nodeSelector: null output: pushSecret: name: builder-dockercfg-55m9g to: kind: ImageStreamTag name: test:latest postCommit: {} resources: {} serviceAccount: builder source: binary: asFile: Dockerfile type: Binary strategy: dockerStrategy: {} type: Docker triggeredBy: null '''
@aaleman Tested in ci payload, but still met null, if need others update. version: 4.5.0-0.ci-2020-04-23-151503 ''' spec: nodeSelector: null output: pushSecret: name: builder-dockercfg-89pcs to: kind: ImageStreamTag name: test:latest postCommit: {} resources: {} serviceAccount: builder source: binary: asFile: Dockerfile type: Binary strategy: dockerStrategy: {} type: Docker triggeredBy: null '''
Oh, I know why null still exists, seems vendor/github.com/openshift/api/build/v1/types.go in ocm repo also need to bump, @adam could you help to check it, thanks.
Posted https://github.com/openshift/openshift-apiserver/pull/99 to get the changes picked up
Will wait latest payload to check it
Oh, I found nodeSelector is not omitempty, should be ignore, if it's null Version: 4.5.0-0.nightly-2020-05-07-144853 ----- spec: nodeSelector: null output: pushSecret: name: builder-dockercfg-d4gm4 -----
Seems cannot omitempty for nodeSelector as said before:https://github.com/openshift/api/pull/626#discussion_r407503527, but how to resolve null issue about nodeSelector?
Unfortunately, we can not do anything about the nodeSelector being displayed as null as that would mean we can not differentiate null from empty anymore.
@aaleman Oh, sorry forgot change status according your comment 11
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409