Skip to content

Resource cloudsmith_repository does not accept "Open-Source" as repository_type #146

@esolitos

Description

@esolitos

When trying to create a cloudsmith_repository it is not possible to set its type to "Open-Source" as the provider expects repository_type to be set to either "Private" or "Public":

resource "cloudsmith_repository" "oss" {
  name        = "OSS"

  namespace = data.cloudsmith_organization.default.slug
  slug      = "oss"

  repository_type = "Open-Source" # Fails with "expected to be one of [Private Public]"
}

However when trying to import as follows:

import {
  to = cloudsmith_repository.open-source-containers
  id = "myorg.oss"
}

resource "cloudsmith_repository" "oss" {
  name        = "OSS"

  namespace = data.cloudsmith_organization.default.slug
  slug      = "oss"

  repository_type = "Public" # Just to pass the validation
}

the validation passes, but the plan contains a change (as one would expect):

  # cloudsmith_repository.oss will be updated in-place
  # (imported from "myorg.oss")
  ~ resource "cloudsmith_repository" "oss" {
     [...]
      ~ repository_type                      = "Open-Source" -> "Public"
     [...]
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions