Bug 1831717 - Unknown object type "nil" in MachineSet.spec.template.spec.providerSpec.value.publicIp
Summary: Unknown object type "nil" in MachineSet.spec.template.spec.providerSpec.value...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.5.0
Assignee: Joel Speed
QA Contact: Milind Yadav
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-05 14:21 UTC by Joel Speed
Modified: 2020-07-13 17:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: An empty value in the provider spec was being marshalled to null by the JSON encoder Consequence: The value became a string, when it should have been a bool Fix: Allow the JSON encoder to ignore the value if it was empty Result: The value is no longer rendered as the string null
Clone Of:
Environment:
Last Closed: 2020-07-13 17:35:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-api-provider-aws pull 320 0 None closed BUG 1831717: Ensure PublicIP is left out of JSON encoding if empty 2020-10-19 13:58:16 UTC
Github openshift installer pull 3550 0 None closed BUG 1831717: Ensure AWS PublicIP is omitted from MachineSet when empty 2020-10-19 13:58:28 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:35:20 UTC

Description Joel Speed 2020-05-05 14:21:20 UTC
Description of problem:

A freshly installed cluster will create MachineSets with `publicIp: null` as the value is not specified and the JSON encoder attempts to encode the nil value.

This causes errors if a user tries to edit the MachineSet `oc edit machineset`

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


How reproducible: Very


Steps to Reproduce:
1. Create a cluster
2. Check that the MachineSet has a value for publicIp
3. Attempt to edit the MachineSet eg, add `spotMarketOptions: {}` to the providerSpec.value

Actual results:

Returns an error: 
```
Unknown object type "nil" in MachineSet.spec.template.spec.providerSpec.value.publicIp
```

Expected results:
Modifications should be accepted without issue


Additional info:

Comment 3 Milind Yadav 2020-05-14 09:36:56 UTC
Validated on:
 
[miyadav@miyadav bugaws]$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.0-0.nightly-2020-05-12-224129   True        False         27h     Cluster version is 4.5.0-0.nightly-2020-05-12-224129


As per the fix the default installation did not had publicIp: true 

Additional Info to validate we dont get error while editing machineset

Steps : 
1. oc get machineset
 NAME                                  DESIRED   CURRENT   READY   AVAILABLE   AGE
zhsunaws513-j6sch-worker-us-east-2a   1         1         1       1           30h
zhsunaws513-j6sch-worker-us-east-2b   1         1         1       1           30h
zhsunaws513-j6sch-worker-us-east-2c   1         1         1       1           30h

[miyadav@miyadav bugvsphere]$ oc edit machineset zhsunaws513-j6sch-worker-us-east-2a 

Updating machinset with  below :

.
.
    spec:
      metadata: {}
      providerSpec:
        value:
          spotMarketOptions:
              maxPrice: "0.01"
          
Actual & Expected :
machineset.machine.openshift.io/zhsunaws513-j6sch-worker-us-east-2a edited

2.oc describe machineset zhsunaws513-j6sch-worker-us-east-2a
.
  Placement:
            Availability Zone:  us-east-2a
            Region:             us-east-2
          Security Groups:
            Filters:
              Name:  tag:Name
              Values:
                zhsunaws513-j6sch-worker-sg
          Spot Market Options:
            Max Price:  0.01
          Subnet:
            Filters:
              Name:  tag:Name
              Values:
                zhsunaws513-j6sch-private-us-east-2a
          Tags:
            Name:   kubernetes.io/cluster/zhsunaws513-j6sch
            Value:  owned
          User Data Secret:
            Name:  worker-user-data
Status:
  Available Replicas:      1
  Fully Labeled Replicas:  1
  Observed Generation:     2
  Ready Replicas:          1
  Replicas:                1
Events:                    <none>.
.
.

Moving to VERIFIED

Comment 4 errata-xmlrpc 2020-07-13 17:35:00 UTC
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


Note You need to log in before you can comment on or make changes to this bug.