Skip to content

Commit

Permalink
[go/sdk] Remove deprecated providers/Provider resource (#1817)
Browse files Browse the repository at this point in the history
A previous codegen bug created a duplicate type for the Provider
resource in the Go SDK. The duplicate type was deprecated about
three months ago, and is now being removed.

Use the Provider resource at
`github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes` instead.

* Remove generated Go SDK before rebuild
  • Loading branch information
lblackstone authored Dec 3, 2021
1 parent 53913b8 commit 237c8f6
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 863 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## HEAD (Unreleased)

Breaking change note:

[#1817](https://github.com/pulumi/pulumi-kubernetes/pull/1817) removed the deprecated providers/Provider
resource definition from the Go SDK. Following this change, use the Provider resource at
`github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes` instead.

- Helm Release: Make RepositoryOpts optional (https://github.com/pulumi/pulumi-kubernetes/pull/1806)
- [go/sdk] Remove deprecated providers/Provider resource (https://github.com/pulumi/pulumi-kubernetes/pull/1817)

## 3.10.1 (November 19, 2021)

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ dotnet_sdk::
dotnet build /p:Version=${DOTNET_VERSION}

go_sdk::
# Delete generated SDK before regenerating.
rm -rf sdk/go/kubernetes
$(WORKING_DIR)/bin/$(CODEGEN) -version=${VERSION} go $(SCHEMA_FILE) $(CURDIR)

nodejs_sdk:: VERSION := $(shell pulumictl get version --language javascript)
Expand Down
13 changes: 0 additions & 13 deletions provider/cmd/pulumi-gen-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,6 @@ func writeGoClient(pkg *schema.Package, outdir string, templateDir string) {
return templateResources.Resources[i].Token < templateResources.Resources[j].Token
})

// We mistakenly included an older version of the Go Provider at
// `github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/providers` that was later removed in v3.6.0.
// Re-add this file with deprecation notices in preparation for future removal.
deprecatedComment := "// Deprecated: Use `github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes` instead"
deprecatedProviderFile := string(files["kubernetes/provider.go"])
deprecatedProviderFile = strings.ReplaceAll(deprecatedProviderFile, "\nfunc", fmt.Sprintf("\n%s\nfunc", deprecatedComment))
deprecatedProviderFile = strings.ReplaceAll(deprecatedProviderFile, "\ntype", fmt.Sprintf("\n%s\ntype", deprecatedComment))
files["kubernetes/providers/provider.go"] = []byte(deprecatedProviderFile)
deprecatedTypesFile := string(files["kubernetes/pulumiTypes.go"])
deprecatedTypesFile = strings.ReplaceAll(deprecatedTypesFile, "\nfunc", fmt.Sprintf("\n%s\nfunc", deprecatedComment))
deprecatedTypesFile = strings.ReplaceAll(deprecatedTypesFile, "\ntype", fmt.Sprintf("\n%s\ntype", deprecatedComment))
files["kubernetes/providers/pulumiTypes.go"] = []byte(deprecatedTypesFile)

files["kubernetes/customPulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "customPulumiTypes.go"))
files["kubernetes/apiextensions/customResource.go"] = mustLoadGoFile(filepath.Join(templateDir, "apiextensions", "customResource.go"))
files["kubernetes/helm/v2/chart.go"] = mustLoadGoFile(filepath.Join(templateDir, "helm", "v2", "chart.go"))
Expand Down
79 changes: 0 additions & 79 deletions sdk/go/kubernetes/config/pulumiTypes.go

This file was deleted.

251 changes: 0 additions & 251 deletions sdk/go/kubernetes/providers/provider.go

This file was deleted.

Loading

0 comments on commit 237c8f6

Please sign in to comment.