Skip to content

workspace not inheriting new image tag defined in coder parameter #7442

Closed as not planned
@ericpaulsen

Description

@ericpaulsen

we have customers who do not overwrite image tags, but instead push new tags to an existing image. when updating an image/tag value via coder parameters, the workspace does not inherit the change.

steps to reproduce

1. initial template with image tag & k8s pod

data "coder_parameter" "image" {
  name    = "image"
  type    = "string"
  mutable = "true"
  option {
    value = "ericpaulsen/code-server:v1"
    name  = "code-server"
  }
}

resource "kubernetes_pod" "main" {
  spec {
    container {
      image             = "docker.io/${data.coder_parameter.image.value}"
      image_pull_policy = "Always"
    }
  }
}

2. push new version of the template with new tag

data "coder_parameter" "image" {
  name    = "image"
  type    = "string"
  mutable = "true"
  option {
    value = "ericpaulsen/code-server:v2"
    name  = "code-server"
  }
}

3. rebuild workspace to apply new template version

upon rebuild, the kubernetes pod is shown to have pulled the old image tag v1:

Normal  Pulled  52s  kubelet  Successfully pulled image "docker.io/ericpaulsen/code-server:v1"

4. manually edit the workspace parameters in the UI

navigate to Settings > Parameters and notice that the image parameters is unset, while all other parmameters (mutable & non-mutable) are set correctly.

Screenshot 2023-05-05 at 4 21 09 PM

5. set the image value and rebuild workspace

when selecting ericpaulsen/code-server and clicking Submit, the workspace rebuilds, and correctly inherits the updated value with the new image and tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    s2Broken use cases or features (with a workaround). Only humans may set this.use-caseA novel and interesting way to use Coder

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions