Skip to content

Commit

Permalink
Upgrade terraform-provider-confluent to v2.0.0 (#559)
Browse files Browse the repository at this point in the history
The automated version failed in CI. Trying this manual version instead.

Hmmm. ~There should be schema changes, so something is off~. The issue
was that upstream needed to be rebased manually.

Now the Go SDK won't build again, just like with the automated upgrade. 

Edit: It turns out that the examples cache was not sensitive to a major
version update, and all examples in the Go SDK did not have the new `v2`
in the module import.

Several things to do here:
- update playbook
- update upgrade-provider
- make the bridge examples cache logic version change aware.

I'll file the followup work here.
  • Loading branch information
guineveresaenger authored Aug 19, 2024
2 parents 31aed8a + 8d8dce5 commit ef801e9
Show file tree
Hide file tree
Showing 173 changed files with 1,314 additions and 4,753 deletions.
2 changes: 1 addition & 1 deletion .ci-mgmt.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
provider: confluentcloud
lint: false
major-version: 1
major-version: 2
providerDefaultBranch: main
env:
CONFLUENT_CLOUD_API_KEY: ${{ secrets.CONFLUENT_CLOUD_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ builds:
- env GOOS={{ .Os }} GOARCH={{ .Arch }} go clean -modcache
ignore: []
ldflags:
- -X github.com/pulumi/pulumi-confluentcloud/provider/pkg/version.Version={{.Tag}}
- -X github.com/pulumi/pulumi-confluentcloud/provider/v2/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-confluentcloud/
changelog:
skip: true
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ builds:
ignore: []
ldflags:
- -X
github.com/pulumi/pulumi-confluentcloud/provider/pkg/version.Version={{.Tag}}
github.com/pulumi/pulumi-confluentcloud/provider/v2/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-confluentcloud/
changelog:
filters:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PACK := confluentcloud
ORG := pulumi
PROJECT := github.com/$(ORG)/pulumi-$(PACK)
PROVIDER_PATH := provider
PROVIDER_PATH := provider/v2
VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version
TFGEN := pulumi-tfgen-$(PACK)
PROVIDER := pulumi-resource-$(PACK)
Expand All @@ -16,7 +16,7 @@ PULUMI_MISSING_DOCS_ERROR := true

# Override during CI using `make [TARGET] PROVIDER_VERSION=""` or by setting a PROVIDER_VERSION environment variable
# Local & branch builds will just used this fixed default version unless specified
PROVIDER_VERSION ?= 1.0.0-alpha.0+dev
PROVIDER_VERSION ?= 2.0.0-alpha.0+dev
# Use this normalised version everywhere rather than the raw input to ensure consistency.
VERSION_GENERIC = $(shell pulumictl convert-version --language generic --version "$(PROVIDER_VERSION)")

Expand Down
16 changes: 16 additions & 0 deletions patches/0002-Add-Go-module-version-to-upstream-go.mod.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: guineveresaenger <[email protected]>
Date: Fri, 16 Aug 2024 15:50:38 -0700
Subject: [PATCH] Add Go module version to upstream go.mod


diff --git a/go.mod b/go.mod
index 09177a13..37160ebf 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/confluentinc/terraform-provider-confluent
+module github.com/confluentinc/terraform-provider-confluent/v2

go 1.22

23 changes: 3 additions & 20 deletions provider/cmd/pulumi-resource-confluentcloud/bridge-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -626,17 +626,6 @@
}
}
},
"confluent_schema_registry_cluster": {
"current": "confluentcloud:index/schemaRegistryCluster:SchemaRegistryCluster",
"fields": {
"environment": {
"maxItemsOne": true
},
"region": {
"maxItemsOne": true
}
}
},
"confluent_schema_registry_cluster_config": {
"current": "confluentcloud:index/schemaRegistryClusterConfig:SchemaRegistryClusterConfig",
"fields": {
Expand Down Expand Up @@ -1256,9 +1245,6 @@
"fields": {
"environment": {
"maxItemsOne": true
},
"region": {
"maxItemsOne": false
}
}
},
Expand Down Expand Up @@ -1293,12 +1279,12 @@
"fields": {
"environment": {
"maxItemsOne": true
},
"region": {
"maxItemsOne": false
}
}
}
},
"environment": {
"maxItemsOne": true
}
}
},
Expand All @@ -1324,9 +1310,6 @@
}
}
},
"confluent_schema_registry_region": {
"current": "confluentcloud:index/getSchemaRegistryRegion:getSchemaRegistryRegion"
},
"confluent_schemas": {
"current": "confluentcloud:index/getSchemas:getSchemas",
"fields": {
Expand Down
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-confluentcloud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package main
import (
_ "embed"

confluentcloud "github.com/pulumi/pulumi-confluentcloud/provider"
"github.com/pulumi/pulumi-confluentcloud/provider/pkg/version"
confluentcloud "github.com/pulumi/pulumi-confluentcloud/provider/v2"
"github.com/pulumi/pulumi-confluentcloud/provider/v2/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
)

Expand Down
Loading

0 comments on commit ef801e9

Please sign in to comment.