Skip to content

terraform apply between provider versions giving "Inconsistent plan" error #87

@SangJunBak

Description

@SangJunBak

Steps to reproduce:

  1. Git Checkout v0.4.11
  2. terraform apply on something like:
namespace   = "jun"  // maximum 12 characters, starts with a letter, lowercase alphanumeric and hyphens
environment = "dev"   // maximum 8 characters, lowercase alphanumeric only (e.g., dev, test)

# Once the operator is installed, you can define your Materialize instances here.
# Uncomment the following block (or provide your own instances) to configure them:

materialize_instances = [
]
  1. Install any materialize instance via:
...
materialize_instances = [
  {
  name = "demo"
  namespace = "materialize-environment"
  database_name = "demo_db"
  cpu_request = "1"
  memory_request = "4Gi"
  memory_limit = "4Gi"
  authenticator_kind = "None"
  internal_nlb = false
  }
]
  1. Git Checkout v0.6.3
  2. Upgrade to 25.2.15 with disk support and swap enabled. Then run terraform apply:
...
materialize_instances = [
  {
  name = "demo"
  ...
  environmentd_version = "v0.147.20"
  request_rollout = "00000000-0000-0000-0000-000000000050"
  }
]
operator_version="v25.2.15"
enable_disk_support = true
swap_enabled = true
  1. Observe the error:
╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ module.materialize_infrastructure.module.operator[0].kubernetes_manifest.materialize_instances["demo"]
│ to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/kubernetes" produced an invalid new value for .object: wrong
│ final value type: incorrect object attributes.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

A workaround I found is doing a terraform apply at step 5 without defining the variables:

enable_disk_support = true
swap_enabled = true

then once that succeeds, adding them back and doing a terraform apply

Another instance of this happening:
https://materializeinc.slack.com/archives/C07PN7KSB0T/p1763413715204969?thread_ts=1763398351.104579&cid=C07PN7KSB0T

Metadata

Metadata

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