Files
pulumi-docker-build/provider/internal/provider.go
pulumi-renovate[bot] 13acd934b6 Update first-party Pulumi dependencies (#760)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/pulumi/esc](https://redirect.github.com/pulumi/esc) |
indirect | minor | `v0.21.0` -> `v0.22.0` |
|
[github.com/pulumi/pulumi/pkg/v3](https://redirect.github.com/pulumi/pulumi)
| require | minor | `v3.219.0` -> `v3.220.0` |

---

### Release Notes

<details>
<summary>pulumi/esc (github.com/pulumi/esc)</summary>

###
[`v0.22.0`](https://redirect.github.com/pulumi/esc/releases/tag/v0.22.0)

[Compare
Source](https://redirect.github.com/pulumi/esc/compare/v0.21.0...v0.22.0)

##### Improvements

##### Bug Fixes

##### Breaking changes

</details>

<details>
<summary>pulumi/pulumi (github.com/pulumi/pulumi/pkg/v3)</summary>

###
[`v3.220.0`](https://redirect.github.com/pulumi/pulumi/releases/tag/v3.220.0)

[Compare
Source](https://redirect.github.com/pulumi/pulumi/compare/v3.219.0...v3.220.0)

##### 3.220.0 (2026-02-10)

##### Features

- \[cli] Show environment variables that were set if a snapshot
integrity error happens
[#&#8203;21709](https://redirect.github.com/pulumi/pulumi/pull/21709)

- \[cli/{install,package}] Use the Pulumi Cloud Registry by default to
resolve package names

-   \[engine] Pass replacement trigger through to Construct
[#&#8203;21408](https://redirect.github.com/pulumi/pulumi/pull/21408)

- \[engine] Add EnvVarMappings resource option for provider resources,
allowing environment variables to be remapped before being passed to the
provider
[#&#8203;21572](https://redirect.github.com/pulumi/pulumi/pull/21572)

- \[pkg] BREAKING: Deprecate
github.com/pulumi/pulumi/pkg/v3/codegen/dotnet in favor of
github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/codegen. This
package will be removed from pulumi/pulumi soon!
[#&#8203;21720](https://redirect.github.com/pulumi/pulumi/pull/21720)

##### Bug Fixes

- \[cli] Retry `yarn install` when it fails (e.g. during `pulumi
install`)
[#&#8203;21707](https://redirect.github.com/pulumi/pulumi/pull/21707)

-   \[engine] Deal with errors in elided journal entries correctly
[#&#8203;21576](https://redirect.github.com/pulumi/pulumi/pull/21576)

- \[sdk/nodejs] Fix remote components with
PULUMI_NODEJS_SKIP_COMPONENT_INPUTS

- \[sdk/python] Fix `_LazyModule` to not trigger full module load for
introspection attributes
[#&#8203;21620](https://redirect.github.com/pulumi/pulumi/pull/21620)

- \[sdkgen/python] Remove workaround for slow typechecking with MyPy and
PyCharm
[#&#8203;21722](https://redirect.github.com/pulumi/pulumi/pull/21722)

##### Miscellaneous

- \[cli] Write logfile location if verbosity is >= 1 to stderr instead
of stdout
[#&#8203;21663](https://redirect.github.com/pulumi/pulumi/pull/21663)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - Monday through Friday ( * * * * 1-5 ) (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yNjQuMCIsInVwZGF0ZWRJblZlciI6IjM5LjI2NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJpbXBhY3Qvbm8tY2hhbmdlbG9nLXJlcXVpcmVkIl19-->

---------

Co-authored-by: pulumi-renovate[bot] <189166143+pulumi-renovate[bot]@users.noreply.github.com>
Co-authored-by: pulumi-bot <bot@pulumi.com>
Co-authored-by: Ian Wahbe <me@iwahbe.com>
2026-02-11 10:27:46 +00:00

148 lines
4.6 KiB
Go

// Copyright 2024, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package internal
import (
"context"
"fmt"
csgen "github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/codegen"
provider "github.com/pulumi/pulumi-go-provider"
"github.com/pulumi/pulumi-go-provider/infer"
pschema "github.com/pulumi/pulumi-go-provider/middleware/schema"
"github.com/pulumi/pulumi-java/pkg/codegen/java"
gogen "github.com/pulumi/pulumi/pkg/v3/codegen/go"
tsgen "github.com/pulumi/pulumi/pkg/v3/codegen/nodejs"
pygen "github.com/pulumi/pulumi/pkg/v3/codegen/python"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
)
var (
_ infer.CustomConfigure = (*Config)(nil)
_ infer.Annotated = (*Config)(nil)
_ infer.Annotated = (*Registry)(nil)
)
// Config configures the buildx provider.
type Config struct {
Host string `pulumi:"host,optional"`
Registries []Registry `pulumi:"registries,optional"`
host *host
}
// Annotate provides user-facing descriptions and defaults for Config's fields.
func (c *Config) Annotate(a infer.Annotator) {
a.Describe(&c.Host, "The build daemon's address.")
a.SetDefault(&c.Host, "", "DOCKER_HOST")
}
// Configure validates and processes user-provided configuration values.
func (c *Config) Configure(ctx context.Context) error {
h, err := newHost(ctx, c)
if err != nil {
return fmt.Errorf("getting host: %w", err)
}
c.host = h
return nil
}
// GetRegistries returns the config's registries, if any.
func (c Config) GetRegistries() []Registry {
return c.Registries
}
// getHost returns the config's host, or nil if the config is also nil.
func (c *Config) getHost() *host {
if c == nil {
return nil
}
return c.host
}
// NewBuildxProvider returns a new buildx provider.
func NewBuildxProvider(clientF clientF) provider.Provider {
config := &Config{}
prov := infer.Provider(
infer.Options{
Metadata: pschema.Metadata{
DisplayName: "docker-build",
Keywords: []string{"docker", "buildkit", "buildx", "kind/native"},
Description: "A Pulumi provider for building modern Docker images with buildx and BuildKit.",
Homepage: "https://pulumi.com",
Publisher: "Pulumi",
License: "Apache-2.0",
Repository: "https://github.com/pulumi/pulumi-docker-build",
LanguageMap: map[string]any{
"go": gogen.GoPackageInfo{
// GenerateResourceContainerTypes: true,
RespectSchemaVersion: true,
Generics: gogen.GenericsSettingSideBySide,
PackageImportAliases: map[string]string{
"github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild": "dockerbuild",
},
ImportBasePath: "github.com/pulumi/pulumi-docker-build/sdk/go/dockerbuild",
},
"csharp": csgen.CSharpPackageInfo{
RespectSchemaVersion: true,
PackageReferences: map[string]string{
"Pulumi": "3.*",
},
},
"java": java.PackageInfo{
BuildFiles: "gradle",
GradleNexusPublishPluginVersion: "1.1.0",
Dependencies: map[string]string{
"com.pulumi:pulumi": "0.20.0",
"com.google.code.gson:gson": "2.8.9",
"com.google.code.findbugs:jsr305": "3.0.2",
},
},
"nodejs": tsgen.NodePackageInfo{
RespectSchemaVersion: true,
},
"python": pygen.PackageInfo{
RespectSchemaVersion: true,
PyProject: struct {
Enabled bool `json:"enabled,omitempty"`
}{Enabled: true},
},
},
},
Resources: []infer.InferredResource{
infer.Resource(&Image{clientF: clientF, config: config}),
infer.Resource(&Index{clientF: clientF, config: config}),
},
ModuleMap: map[tokens.ModuleName]tokens.ModuleName{
"internal": "index",
},
Config: infer.Config(config),
},
)
return prov
}
// Schema returns our package specification.
func Schema(ctx context.Context, version string) schema.PackageSpec {
p := NewBuildxProvider(nil)
spec, err := provider.GetSchema(ctx, "docker-build", version, p)
contract.AssertNoErrorf(err, "missing schema")
return spec
}