Skip to content
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

Error computing the JSON patch describing the resource changes: unrecognized type: string #679

Closed
ncsibra opened this issue Aug 1, 2019 · 4 comments · Fixed by #682
Closed
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer
Milestone

Comments

@ncsibra
Copy link

ncsibra commented Aug 1, 2019

I have some resources like(not the whole code):

  const ec2Instance = new aws.ec2.Instance(`${env}-wordpress-node`, {
    ami: 'ami-089037cef52672912',
    keyName: 'worker-key',
    monitoring: false,
    subnetId: dliverOutput.vpc.privateIpSubnetIds[0],
    instanceType: 't3.small',
    securityGroups: [cluster.workerSecurityGroupId],
    iamInstanceProfile: instanceProfile,
    userData: userData,
    rootBlockDevice: {
      volumeSize: 10,
      volumeType: 'gp2',
      deleteOnTermination: true
    },
    tags: {
      Name: `${env}-wordpress-node`,
      [`kubernetes.io/cluster/${cluster.name}`]: 'owned'
    }
  })

  const dataVolume = new aws.ebs.Volume(
    `${env}-wordpress-content`,
    {
      size: 10,
      type: 'gp2',
      availabilityZone: ec2Instance.availabilityZone,
      encrypted: false,
      tags: {
        Name: `${env}-wordpress-content`
      }
    },
    {
      protect: true
    }
  )

  const pvName = 'wordpress-content-pv'
  const pvCapacity = '10Gi'
  const pvAccessModes = ['ReadWriteOnce']
  const pvStorageClass = ''

  const pv = new k8s.core.v1.PersistentVolume(
    `${env}-k8s-pv`,
    {
      metadata: {
        name: pvName
      },
      spec: {
        accessModes: pvAccessModes,
        capacity: {
          storage: pvCapacity
        },
        awsElasticBlockStore: {
          volumeID: dataVolume.id
        },
        persistentVolumeReclaimPolicy: 'Retain',
        storageClassName: pvStorageClass
      }
    },
    {
      provider: k8sProvider,
      dependsOn: ec2Instance
    }
  )

First I successfully created the stack, without any error, now I updated the ec2 instance only and it shows:

Previewing update (sbx):

     Type                                 Name                   Plan        Info
     pulumi:pulumi:Stack                  k8s-wordpress-sbx                  2 messages
 +-  ├─ aws:ec2:Instance                  sbx-wordpress-node     replace     [diff: ~ami,securityGroups]
 +-  ├─ aws:ebs:Volume                    sbx-wordpress-content  replace     [diff: ~availabilityZone]
     └─ kubernetes:core:PersistentVolume  sbx-k8s-pv                         1 error
 
Diagnostics:
  kubernetes:core:PersistentVolume (sbx-k8s-pv):
    error: Failed to check for changes in resource /wordpress-content-pv because of an error computing the JSON patch describing the resource changes: unrecognized type: string
 
  pulumi:pulumi:Stack (k8s-wordpress-sbx):
    2019/08/01 14:55:30 Warning: Merging destination map for chart 'wordpress'. The destination item 'annotations' is a table and ignoring the source 'annotations' as it has a non-table value of: <nil>
    2019/08/01 14:55:30 Warning: Merging destination map for chart 'wordpress'. The destination item 'annotations' is a table and ignoring the source 'annotations' as it has a non-table value of: <nil>

Relevant debug logs(these are the only occurences of the PersistentVolume urn):

I0801 14:58:18.778834   16583 provider_plugin.go:505] Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv): executing (#olds=6,#news=4)
I0801 14:58:18.778860   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: __inputs={map[apiVersion:{v1} kind:{PersistentVolume} metadata:{map[labels:{map[app.kubernetes.io/managed-by:{pulumi}]} name:{wordpress-content-pv}]} spec:{map[accessModes:{[{ReadWriteOnce}]} awsElasticBlockStore:{map[volumeID:{vol-00179d029af600a39}]} capacity:{map[storage:{10Gi}]} persistentVolumeReclaimPolicy:{Retain} storageClassName:{}]}]}
I0801 14:58:18.778951   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: apiVersion={v1}
I0801 14:58:18.778975   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: kind={PersistentVolume}
I0801 14:58:18.778995   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: metadata={map[labels:{map[app.kubernetes.io/managed-by:{pulumi}]} name:{wordpress-content-pv}]}
I0801 14:58:18.779041   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: labels={map[app.kubernetes.io/managed-by:{pulumi}]}
I0801 14:58:18.779073   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: app.kubernetes.io/managed-by={pulumi}
I0801 14:58:18.779116   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: name={wordpress-content-pv}
I0801 14:58:18.779138   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: spec={map[accessModes:{[{ReadWriteOnce}]} awsElasticBlockStore:{map[volumeID:{vol-00179d029af600a39}]} capacity:{map[storage:{10Gi}]} persistentVolumeReclaimPolicy:{Retain} storageClassName:{}]}
I0801 14:58:18.779195   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: accessModes={[{ReadWriteOnce}]}
I0801 14:58:18.779224   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: awsElasticBlockStore={map[volumeID:{vol-00179d029af600a39}]}
I0801 14:58:18.779251   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: volumeID={vol-00179d029af600a39}
I0801 14:58:18.779273   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: capacity={map[storage:{10Gi}]}
I0801 14:58:18.779299   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: storage={10Gi}
I0801 14:58:18.779320   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: persistentVolumeReclaimPolicy={Retain}
I0801 14:58:18.779340   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: storageClassName={}
I0801 14:58:18.779362   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: apiVersion={v1}
I0801 14:58:18.779382   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: kind={PersistentVolume}
I0801 14:58:18.779401   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: metadata={map[annotations:{map[kubectl.kubernetes.io/last-applied-configuration:{{"apiVersion":"v1","kind":"PersistentVolume","metadata":{"labels":{"app.kubernetes.io/managed-by":"pulumi"},"name":"wordpress-content-pv"},"spec":{"accessModes":["ReadWriteOnce"],"awsElasticBlockStore":{"volumeID":"vol-00179d029af600a39"},"capacity":{"storage":"10Gi"},"persistentVolumeReclaimPolicy":"Retain","storageClassName":""}}
I0801 14:58:18.779466   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: annotations={map[kubectl.kubernetes.io/last-applied-configuration:{{"apiVersion":"v1","kind":"PersistentVolume","metadata":{"labels":{"app.kubernetes.io/managed-by":"pulumi"},"name":"wordpress-content-pv"},"spec":{"accessModes":["ReadWriteOnce"],"awsElasticBlockStore":{"volumeID":"vol-00179d029af600a39"},"capacity":{"storage":"10Gi"},"persistentVolumeReclaimPolicy":"Retain","storageClassName":""}}
I0801 14:58:18.779510   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: kubectl.kubernetes.io/last-applied-configuration={{"apiVersion":"v1","kind":"PersistentVolume","metadata":{"labels":{"app.kubernetes.io/managed-by":"pulumi"},"name":"wordpress-content-pv"},"spec":{"accessModes":["ReadWriteOnce"],"awsElasticBlockStore":{"volumeID":"vol-00179d029af600a39"},"capacity":{"storage":"10Gi"},"persistentVolumeReclaimPolicy":"Retain","storageClassName":""}}
I0801 14:58:18.779533   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: pv.kubernetes.io/bound-by-controller={yes}
I0801 14:58:18.779554   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: creationTimestamp={2019-07-17T07:15:10Z}
I0801 14:58:18.779578   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: finalizers={[{kubernetes.io/pv-protection}]}
I0801 14:58:18.779603   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: labels={map[app.kubernetes.io/managed-by:{pulumi}]}
I0801 14:58:18.779630   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: app.kubernetes.io/managed-by={pulumi}
I0801 14:58:18.779652   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: name={wordpress-content-pv}
I0801 14:58:18.779672   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: resourceVersion={11246614}
I0801 14:58:18.779691   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: selfLink={/api/v1/persistentvolumes/wordpress-content-pv}
I0801 14:58:18.779711   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: uid={9d3cf5eb-a862-11e9-8011-0a022f072758}
I0801 14:58:18.779732   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: spec={map[accessModes:{[{ReadWriteOnce}]} awsElasticBlockStore:{map[volumeID:{vol-00179d029af600a39}]} capacity:{map[storage:{10Gi}]} claimRef:{map[apiVersion:{v1} kind:{PersistentVolumeClaim} name:{wordpress-content-pvc} namespace:{sbx} resourceVersion:{8693905} uid:{9dd11601-a862-11e9-8011-0a022f072758}]} persistentVolumeReclaimPolicy:{Retain} volumeMode:{Filesystem}]}
I0801 14:58:18.779804   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: accessModes={[{ReadWriteOnce}]}
I0801 14:58:18.779839   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: awsElasticBlockStore={map[volumeID:{vol-00179d029af600a39}]}
I0801 14:58:18.779865   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: volumeID={vol-00179d029af600a39}
I0801 14:58:18.779886   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: capacity={map[storage:{10Gi}]}
I0801 14:58:18.779914   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: storage={10Gi}
I0801 14:58:18.779936   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: claimRef={map[apiVersion:{v1} kind:{PersistentVolumeClaim} name:{wordpress-content-pvc} namespace:{sbx} resourceVersion:{8693905} uid:{9dd11601-a862-11e9-8011-0a022f072758}]}
I0801 14:58:18.779980   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: apiVersion={v1}
I0801 14:58:18.780009   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: kind={PersistentVolumeClaim}
I0801 14:58:18.780035   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: name={wordpress-content-pvc}
I0801 14:58:18.780060   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: namespace={sbx}
I0801 14:58:18.780084   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: resourceVersion={8693905}
I0801 14:58:18.780105   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: uid={9dd11601-a862-11e9-8011-0a022f072758}
I0801 14:58:18.780126   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: persistentVolumeReclaimPolicy={Retain}
I0801 14:58:18.780148   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: volumeMode={Filesystem}
I0801 14:58:18.780172   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: status={map[phase:{Bound}]}
I0801 14:58:18.780200   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).olds]: phase={Bound}
I0801 14:58:18.780227   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: apiVersion={v1}
I0801 14:58:18.780265   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: kind={PersistentVolume}
I0801 14:58:18.780287   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: metadata={map[labels:{map[app.kubernetes.io/managed-by:{pulumi}]} name:{wordpress-content-pv}]}
I0801 14:58:18.780325   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: labels={map[app.kubernetes.io/managed-by:{pulumi}]}
I0801 14:58:18.780356   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: app.kubernetes.io/managed-by={pulumi}
I0801 14:58:18.780381   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: name={wordpress-content-pv}
I0801 14:58:18.780401   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: spec={map[accessModes:{[{ReadWriteOnce}]} awsElasticBlockStore:{map[volumeID:output<string>{}]} capacity:{map[storage:{10Gi}]} persistentVolumeReclaimPolicy:{Retain} storageClassName:{}]}
I0801 14:58:18.780455   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: accessModes={[{ReadWriteOnce}]}
I0801 14:58:18.780481   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: awsElasticBlockStore={map[volumeID:output<string>{}]}
I0801 14:58:18.780510   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: volumeID=output<string>{}
I0801 14:58:18.780535   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: capacity={map[storage:{10Gi}]}
I0801 14:58:18.780573   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: storage={10Gi}
I0801 14:58:18.780596   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: persistentVolumeReclaimPolicy={Retain}
I0801 14:58:18.780616   16583 rpc.go:69] Marshaling property for RPC[Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv).news]: storageClassName={}
I0801 14:58:19.380221   16583 provider_plugin.go:549] Provider[kubernetes, 0xc001664420].Diff(urn:pulumi:sbx::k8s-wordpress::kubernetes:core/v1:PersistentVolume::sbx-k8s-pv,wordpress-content-pv) failed: Failed to check for changes in resource /wordpress-content-pv because of an error computing the JSON patch describing the resource changes: unrecognized type: string

Versions:

➜  pulumi ✗ pulumi version
v0.17.27
➜  pulumi ✗ yarn list --pattern "@pulumi"
yarn list v1.15.2
warning package.json: No license field
warning prmrgt-infra: No license field
├─ @pulumi/aws@0.18.25
├─ @pulumi/cloudflare@0.17.8
├─ @pulumi/kubernetes@0.25.3
├─ @pulumi/pulumi@0.17.27
├─ @pulumi/query@0.3.0
└─ @pulumi/random@0.5.6
Done in 0.17s.
➜  pulumi ✗ pulumi plugin ls
NAME        KIND      VERSION  SIZE    INSTALLED  LAST USED
aws         resource  0.18.25  209 MB  n/a        1 day ago
aws         resource  0.18.24  209 MB  n/a        2 days ago
aws         resource  0.18.10  204 MB  n/a        1 day ago
cloudflare  resource  0.17.8   41 MB   n/a        2 days ago
cloudflare  resource  0.17.3   40 MB   n/a        1 day ago
kubernetes  resource  0.25.3   51 MB   n/a        1 day ago
kubernetes  resource  0.25.2   51 MB   n/a        2 days ago
kubernetes  resource  0.24.0   53 MB   n/a        1 day ago
random      resource  0.5.6    36 MB   n/a        2 days ago
random      resource  0.5.3    36 MB   n/a        1 day ago
random      resource  0.5.1    28 MB   n/a        2 days ago
@lukehoban lukehoban added the kind/bug Some behavior is incorrect or out of spec label Aug 1, 2019
@lukehoban lukehoban added this to the 0.25 milestone Aug 1, 2019
@lblackstone lblackstone assigned lblackstone and unassigned pgavlin Aug 1, 2019
@lblackstone
Copy link
Member

awsElasticBlockStore={map[volumeID:output<string>{}]} looks like the culprit here. It appears that something is not unwrapping the output prior to calculating the diff here.

Still investigating.

@lblackstone
Copy link
Member

@pgavlin As far as I can tell, the problem is that the diff calculation does not account for output values in the input.

Here's what seems to be happening:

  1. The k8s PV depends on the EBS volume
  2. The EBS volume needs to be replaced on update, resulting in an output in the update input object
  3. The Diff operation in the provider fails because of the unhandled output value.

Note that Diff is not called on initial creation, so that explains why it succeeded initially.

@pgavlin
Copy link
Member

pgavlin commented Aug 1, 2019

Yes, that makes sense.

Is there anything reasonable we can do here? I'm worried that this may require schematic knowledge about the expected value types...

@lblackstone
Copy link
Member

Here's a minimal repro:

import * as k8s from "@pulumi/kubernetes";

const cm = new k8s.core.v1.ConfigMap("cm", {data: {"foo": "bar"}});
// After creation, replace the previous cm definition with this one to force a replace.
//const cm = new k8s.core.v1.ConfigMap("cm", {data: {"foo": "baz"}});

const appLabels = { app: "nginx" };
const deployment = new k8s.apps.v1.Deployment("nginx", {
    metadata: { name: "foo"},
    spec: {
        selector: { matchLabels: appLabels },
        replicas: 1,
        template: {
            metadata: { labels: appLabels },
            spec: {
                containers: [{ name: "nginx", image: "nginx:1.14"}],
                volumes: [{name: "cm", configMap: {name: cm.metadata.name}}],
            },
        },
    }
}});

@infin8x infin8x added the p1 A bug severe enough to be the next item assigned to an engineer label Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants