- 
                Notifications
    
You must be signed in to change notification settings  - Fork 460
 
🐛 Make topology markers also valid for type definitions #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Make topology markers also valid for type definitions #693
Conversation
| 
           /retitle 🐛 Make topology markers also valid for type definitions  | 
    
| 
           [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, k8s-infra-cherrypick-robot The full list of commands accepted by this bot can be found here. The pull request process is described here 
Needs approval from an approver in each of these files:
 
      
 Approvers can indicate their approval by writing   | 
    
| 
           I took a stab at using the new release with these changes today and am running into an issue with the way my CRD is now being generated. My CRD has fields of type  env:
  items:
    properties:
      name:
        type: string
      value:
        type: string
      valueFrom:
        properties:
          configMapKeyRef:
            properties:
              key:
                type: string
              name:
                type: string
              optional:
                type: boolean
            required:
            - key
            type: object
          fieldRef:
            properties:
              apiVersion:
                type: string
              fieldPath:
                type: string
            required:
            - fieldPath
            type: object
          resourceFieldRef:
            properties:
              containerName:
                type: string
              divisor:
                anyOf:
                - type: integer
                - type: string
                pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                x-kubernetes-int-or-string: true
              resource:
                type: string
            required:
            - resource
            type: object
          secretKeyRef:
            properties:
              key:
                type: string
              name:
                type: string
              optional:
                type: boolean
            required:
            - key
            type: object
        type: object
    required:
    - name
    type: object
  type: array
  x-kubernetes-list-map-keys:
  - name
  x-kubernetes-list-type: mapNow, however, it's generated as env:
  items:
    properties:
      name:
        type: string
      value:
        type: string
      valueFrom:
        properties:
          configMapKeyRef:
            allOf:
            - x-kubernetes-map-type: atomic
            - x-kubernetes-map-type: atomic
            properties:
              key:
                type: string
              name:
                type: string
              optional:
                type: boolean
            required:
            - key
            type: object
          fieldRef:
            properties:
              apiVersion:
                type: string
              fieldPath:
                type: string
            required:
            - fieldPath
            type: object
            x-kubernetes-map-type: atomic
          resourceFieldRef:
            properties:
              containerName:
                type: string
              divisor:
                anyOf:
                - type: integer
                - type: string
                pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                x-kubernetes-int-or-string: true
              resource:
                type: string
            required:
            - resource
            type: object
            x-kubernetes-map-type: atomic
          secretKeyRef:
            allOf:
            - x-kubernetes-map-type: atomic
            - x-kubernetes-map-type: atomic
            properties:
              key:
                type: string
              name:
                type: string
              optional:
                type: boolean
            required:
            - key
            type: object
        type: object
    required:
    - name
    type: object
  type: array
  x-kubernetes-list-map-keys:
  - name
  x-kubernetes-list-type: mapNote the addition of allOf:
- x-kubernetes-map-type: atomic
- x-kubernetes-map-type: atomicto  It looks like the error is coming from here, but I'm not sure what it means. Any ideas? Thanks!  | 
    
          
 Oh, it's so bad. That's what I worried when I commented #692 (comment) . It reminded me of another bug #688 , which generated duplicate   | 
    
| 
           @robbie-demuth could you please also share the go code which this is generated from? (at least the struct parts and markers for  Edit: nevermind, I see that it is also present in the test data. I'll take a look at it 👍 sorry for the circumstances though 😞  | 
    
Bug was introduced in kubernetes-sigs#693.
Bug was introduced in kubernetes-sigs#693.
This is an automated cherry-pick of #692
/assign alvaroaleman