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

Remove retracted k8s package #29953

Merged
merged 2 commits into from
Nov 16, 2021
Merged

Remove retracted k8s package #29953

merged 2 commits into from
Nov 16, 2021

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Nov 16, 2021

Rebase #28639 to remove the retracted k8s module replace directive.
Update to the latest compatible k8s packages.

@jbardin jbardin requested a review from jrhouston November 16, 2021 19:36
jbardin and others added 2 commits November 16, 2021 14:42
Use the latest k8s.io packages from v0.21
Signed-off-by: Jared Ledvina <jared.ledvina@datadoghq.com>
@jbardin jbardin force-pushed the jbardin/k8s-mod-update branch from df053a0 to 61a5808 Compare November 16, 2021 19:46
Copy link
Contributor

@jrhouston jrhouston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working for me:

cat main.tf                                                                                                                                                            jbardin/k8s-mod-update ◼
terraform {
  backend "kubernetes" {
    secret_suffix    = "state"
    load_config_file = true
    config_path = "/Users/john/.kube/config"
  }
}

provider kubernetes {
  config_path = "/Users/john/.kube/config"
}

resource kubernetes_config_map example {
  metadata {
    name = "test"
  }

  data = {
    TEST = "test"
  }
}
~/d/h/t/scratch ❯❯❯ terraform-dev init                                                                                                                                                  jbardin/k8s-mod-update ◼

Initializing the backend...

Successfully configured the backend "kubernetes"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Finding latest version of hashicorp/kubernetes...
- Installing hashicorp/kubernetes v2.6.1...
- Installed hashicorp/kubernetes v2.6.1 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
~/d/h/t/scratch ❯❯❯ terraform-dev apply --auto-approve                                                                                                                                  jbardin/k8s-mod-update ◼
kubernetes_config_map.example: Refreshing state... [id=default/test]

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # kubernetes_config_map.example has been deleted
  - resource "kubernetes_config_map" "example" {
      - data = {
          - "TEST" = "test"
        } -> null
      - id   = "default/test" -> null

      - metadata {
          - generation       = 0 -> null
          - name             = "test" -> null
          - namespace        = "default" -> null
          - resource_version = "879618" -> null
          - uid              = "f7607d8b-fa3f-4ec2-af8c-78ef218e1a1f" -> null
        }
    }


Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes.

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # kubernetes_config_map.example will be created
  + resource "kubernetes_config_map" "example" {
      + data = {
          + "TEST" = "test"
        }
      + id   = (known after apply)

      + metadata {
          + generation       = (known after apply)
          + name             = "test"
          + namespace        = "default"
          + resource_version = (known after apply)
          + uid              = (known after apply)
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.
kubernetes_config_map.example: Creating...
kubernetes_config_map.example: Creation complete after 0s [id=default/test]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
~/d/h/t/scratch ❯❯❯ k get secret -o yaml --selector tfstate=true                                                                                                                       ✘ 1 jbardin/k8s-mod-update ◼
apiVersion: v1
items:
- apiVersion: v1
  data:
    tfstate: H4sIAAAAAAAA/3yTz46bMBDG73kKy+eQQBIWEmkPPfQJuuolG6HBHhKrYCN7iBpFefcKJyx/RPeCGH8/fx8zNvcFY/yK1imj+YHtlm1NaC0UxlZZr/BoFa1C7nWHVkHJD2zry1JphDO2UBzHxWYXb4LiLRHBFjEMokhuApEXuXyTcp+k4ulhGqobcvzA7g+/YNGZxgpsl44Lxhi7+ydjvDLSu1eg4YzSG3iBbrUX/jQ5Wo2ELhNGF+qcVVD3mIbKY/gXqrrEXqituSqJthW79+Mnt3hWjuxt9TWIlTLrC7iLEsbW6z7uk596N6UdgR52MOzCI05csILBWMPlUAYiq/KGvMVwI2M8VxrsLZNAwA9MN2W5HAMvZbyNMf7x89dH2yChIz4SHxMHJVtOYgFNSWvPT4gKCV45x0nONLdtR2tDQMpoN/vJHjqjRguEWXdK/P/QzMxeQAk5lt+kdOYzTX3prgaBgwnMcd0tHf4ZaRqGaTpHN8+JpvtiF8dhEiSR2Ae7zT4NYBNtgyRJRY5RhCLa8snux6g+DarRqXGH2ilSV8xGl+d4GlG1VVcg31yuf7v8x/t7H9hFPUPa6rR4LP4FAAD//5hSGm4aBAAA
  kind: Secret
  metadata:
    annotations:
      encoding: gzip
    creationTimestamp: "2021-11-16T19:28:15Z"
    labels:
      app.kubernetes.io/managed-by: terraform
      tfstate: "true"
      tfstateSecretSuffix: state
      tfstateWorkspace: default
    name: tfstate-default-state
    namespace: default
    resourceVersion: "880089"
    uid: eb608bc5-b4dc-46af-a62c-388118eeb862
  type: Opaque
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

@jbardin jbardin marked this pull request as ready for review November 16, 2021 19:48
@jbardin jbardin added the 1.1-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Nov 16, 2021
@jbardin jbardin merged commit 0045e71 into main Nov 16, 2021
@jbardin jbardin deleted the jbardin/k8s-mod-update branch November 16, 2021 20:02
jbardin added a commit that referenced this pull request Nov 16, 2021
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.1-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants