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

volumes.emptyDir is dropped causes diff #79

Closed
so0k opened this issue Jul 14, 2021 · 1 comment · Fixed by #89
Closed

volumes.emptyDir is dropped causes diff #79

so0k opened this issue Jul 14, 2021 · 1 comment · Fixed by #89

Comments

@so0k
Copy link

so0k commented Jul 14, 2021

command:

k2tf -f test-fixtures/replicationController.yml 

expected

resource "kubernetes_replication_controller" "es" {
  metadata {
    name = "es"

    labels = {
      component = "elasticsearch"
    }
  }

  spec {
    replicas = 1

    template {
      metadata {
        labels = {
          component = "elasticsearch"
        }
      }

      spec {
        volume {
          name = "storage"
          empty_dir {}
        }
...

got

resource "kubernetes_replication_controller" "es" {
  metadata {
    name = "es"

    labels = {
      component = "elasticsearch"
    }
  }

  spec {
    replicas = 1

    template {
      metadata {
        labels = {
          component = "elasticsearch"
        }
      }

      spec {
        volume {
          name = "storage"
        }
...

problem: this causes a diff in plan:

# kubernetes_replication_controller.es will be updated in-place
  ~ resource "kubernetes_replication_controller" "es" {
        id               = "default/es"
        # (1 unchanged attribute hidden)


      ~ spec {
            # (5 unchanged attributes hidden)



          ~ template {

              ~ spec {
                    # (12 unchanged attributes hidden)



                  ~ volume {
                        name = "storage"

                      - empty_dir {}
                    }
                    # (5 unchanged blocks hidden)
                }
                # (1 unchanged block hidden)
            }
            # (2 unchanged blocks hidden)
        }
        # (1 unchanged block hidden)
    }
@so0k
Copy link
Author

so0k commented Jul 14, 2021

I have no idea how k2tf works atm, I use it in make targets to automatically convert upstream bundles using kustomize into terraform modules, so I don't edit the generated results.

maybe this is related #29 ?

sl1pm4t pushed a commit that referenced this issue Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant