Uploaded image for project: 'Machine Config Operator'
  1. Machine Config Operator
  2. MCO-470

Get applyconfiguration-gen to handle MachineConfigPoolStatus properly

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • None
    • 5
    • False
    • Hide

      None

      Show
      None
    • False
    • MCO Sprint 240
    • 0

       

      If you try to run applyconfiguration-gen on MachineConfigControllerStatus, the embedded (non-pointer) ObjectReference seems to confuse it, and it generates code that doesn't work quite right:

       

      # github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:27:11: cannot use &value (value of type *string) as type string in assignment
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:35:16: cannot use &value (value of type *string) as type string in assignment
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:43:11: cannot use &value (value of type *string) as type string in assignment
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:51:10: cannot use &value (value of type *types.UID) as type types.UID in assignment
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:59:17: cannot use &value (value of type *string) as type string in assignment
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:67:22: cannot use &value (value of type *string) as type string in assignment
      vendor/github.com/openshift/client-go/machineconfiguration/applyconfigurations/machineconfiguration/v1/machineconfigpoolstatusconfiguration.go:75:16: cannot use &value (value of type *string) as type string in assignment
      make: *** [Makefile:40: _build-machine-config-daemon] Error 2

      It looks like it's the only place in our types we have an embedded non-pointer object like that?

      The rest of the generators seem to be okay with it, so I'm assuming it's not just a "this is terrible practice, don't ever embed an object like that".

      Might be able to change it to a pointer but I haven't tried that yet.

       

      I think it's in here somewhere:

      https://github.com/kubernetes/code-generator/blob/master/cmd/applyconfiguration-gen/generators/applyconfiguration.go

       

              jkyros@redhat.com John Kyros
              jkyros@redhat.com John Kyros
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: