Skip to content

ComputeInstance using Windows images will error resolving externally-managed fields #524

@tonybenchsci

Description

@tonybenchsci

Checklist

Bug Description

KCC can be used to create GCP ComputeInstance VMs with Windows Server images. In order to RDP, there needs to be users created first, which GCP supports via the "Set Windows Password" button. Doing this (it seems like the first user is fine, but more than 1 will fail, but not 100% sure) however, creates a state of UpdateFailed

It seems like KCC needs to let this field "float" i.e. be managed be GCP, or parse it as a map instead of a list and save as string(?), or as a workaround (we haven't tried yet) the user needs a round-trip to re-acquire the GCP generated configs under spec.metadata.[]

Kubernetes Cluster Version

1.19.11-gke.2101

Config Connector Version

1.49.0

Config Connector Mode

cluster

Log Output

Update call failed: error expanding resource configuration: error resolving externally-managed fields: error converting state to typed value: .metadata: expected list, got &{map[windows-keys:{"expireOn":"2021-07-30T00:20:13.267Z","userName":"alice","modulus":"REDACTED","email":"tony@benchsci.com","exponent":"AQAB"}
      {"expireOn":"2021-07-30T00:23:08.573Z","userName":"bob","modulus":"REDACTED","email":"tony@benchsci.com","exponent":"AQAB"}
      {"expireOn":"2021-07-30T00:24:14.715Z","userName":"charlie","modulus":"REDACTED","email":"tony@benchsci.com","exponent":"AQAB"}]}
    

Steps to Reproduce

Steps to reproduce the issue

  1. Use KCC to create the ComputeInstance
  2. Use the GCP console to "Set Windows Password" to create a few login users
  3. Observe KCC reconcile state

YAML snippets

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeInstance
metadata:
  name: windows
spec:
  machineType: e2-medium
  zone: us-east4-a
  serviceAccount:
    serviceAccountRef:
      name: windows
    scopes:
    - storage-ro
  networkInterface:
  - networkRef:
      name: default
    accessConfig:
    - networkTier: PREMIUM
  bootDisk:
    initializeParams:
      sourceImageRef:
        external: projects/windows-cloud/global/images/windows-server-2019-dc-v20210713
  metadataStartupScript: |
    Write-Host 'Hello, World! This is a Windows VM'
  tags:
  - windows-eln

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions