Bridge what Dokploy v0.30 added, and let the docs through
Six new resources from terraform-provider-dokploy v0.2.0 -- Network, DnsProvider, VaultProvider, Schedule, VolumeBackup and Libsql -- plus the new properties on Domain (`enabled`), Compose (`serviceNetworks`, `createEnvFile`, `icon`) and Application. Verified with `pulumi up` against a live v0.30.2 instance: create, preview-clean, and destroy. The upstream provider also now refuses a volume Mount with no `volumeName`, which Dokploy would otherwise turn into an anonymous Docker volume recreated on every deploy. That surfaces here at preview time, before anything exists. Two things made that fix nearly invisible to Pulumi users, so this commit fixes the second one: the bridge resolves the upstream `docs/` through the Go module cache, where a locally `replace`d dependency never lands, so tfgen was emitting every resource with no description at all. UpstreamRepoPath now points at the checkout and all 445 inputs carry documentation -- with names rendered per language, so Python readers see `volume_name` where TypeScript readers see `volumeName`.
This commit is contained in:
@@ -7,6 +7,7 @@ package dokploy
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"os"
|
||||
|
||||
pfbridge "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfbridge"
|
||||
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
|
||||
@@ -67,6 +68,16 @@ func Provider(version string) tfbridge.ProviderInfo {
|
||||
TFProviderVersion: version,
|
||||
MetadataInfo: tfbridge.NewProviderMetadata(bridgeMetadata),
|
||||
|
||||
// Where tfgen reads the upstream `docs/` from when generating schema
|
||||
// descriptions. Without it the bridge looks in the Go module cache,
|
||||
// finds nothing for a `replace`d local dependency, and every resource
|
||||
// reaches Pulumi users undocumented -- including the warnings that
|
||||
// matter, such as a volume mount needing a name to persist anything.
|
||||
//
|
||||
// Only read at tfgen time, and the result is baked into the
|
||||
// checked-in schema.json, so a consumer never needs this path.
|
||||
UpstreamRepoPath: upstreamRepoPath(),
|
||||
|
||||
// The upstream provider is plugin-framework based, so opt in to the
|
||||
// bridge's accurate preview and raw state handling.
|
||||
EnableAccurateBridgePreview: true,
|
||||
@@ -99,6 +110,7 @@ func Provider(version string) tfbridge.ProviderInfo {
|
||||
"dokploy_mariadb": res("MariaDb"),
|
||||
"dokploy_mongo": res("Mongo"),
|
||||
"dokploy_redis": res("Redis"),
|
||||
"dokploy_libsql": res("Libsql"),
|
||||
|
||||
// Networking and service attachments.
|
||||
"dokploy_domain": res("Domain"),
|
||||
@@ -112,6 +124,18 @@ func Provider(version string) tfbridge.ProviderInfo {
|
||||
"dokploy_ssh_key": res("SshKey"),
|
||||
"dokploy_certificate": res("Certificate"),
|
||||
"dokploy_destination": res("Destination"),
|
||||
|
||||
// Docker networks, added in Dokploy v0.30.0. Services attach to
|
||||
// them through `networkIds`.
|
||||
"dokploy_network": res("Network"),
|
||||
|
||||
// Scheduling, added in Dokploy v0.30.0.
|
||||
"dokploy_schedule": res("Schedule"),
|
||||
"dokploy_volume_backup": res("VolumeBackup"),
|
||||
|
||||
// External integrations, added in Dokploy v0.30.0.
|
||||
"dokploy_dns_provider": res("DnsProvider"),
|
||||
"dokploy_vault_provider": res("VaultProvider"),
|
||||
},
|
||||
|
||||
DataSources: map[string]*tfbridge.DataSourceInfo{
|
||||
@@ -156,6 +180,16 @@ func Provider(version string) tfbridge.ProviderInfo {
|
||||
return prov
|
||||
}
|
||||
|
||||
// upstreamRepoPath locates the terraform-provider-dokploy checkout that
|
||||
// `go.mod` replaces in. It is overridable so a CI job that lays the two repos
|
||||
// out differently can still generate documented schemas.
|
||||
func upstreamRepoPath() string {
|
||||
if override := os.Getenv("DOKPLOY_TF_PROVIDER_PATH"); override != "" {
|
||||
return override
|
||||
}
|
||||
return "../dokploy-teraform"
|
||||
}
|
||||
|
||||
// pythonInfo exists because PyProject is an anonymous struct field and cannot
|
||||
// be set inside a composite literal.
|
||||
func pythonInfo() *tfbridge.PythonInfo {
|
||||
|
||||
Reference in New Issue
Block a user