Compare commits

...

10 commits

Author SHA1 Message Date
stack72 7f49790d0c Prepare for v2.25.2 release 2021-04-17 13:03:38 +01:00
stack72 6913382549 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v2.25.2 2021-04-17 11:35:31 +01:00
Paul Stack 50be057007
Merge pull request #6794 from pulumi/lee/gocloud 2021-04-17 11:32:46 +01:00
Lee-Ming Zen bbe81fe372 Fix go.sum in tests 2021-04-16 15:18:05 -07:00
Lee-Ming Zen f2cec1463c Fix linting 2021-04-16 14:35:07 -07:00
Lee-Ming Zen 74dfd4ee05 Update CHANGELOG 2021-04-16 14:23:23 -07:00
Lee-Ming Zen 91bfc17d51 Use fork of go-cloud to temporarily unblock #6596 2021-04-16 14:20:08 -07:00
stack72 0b833c832d Cleanup after v2.25.1 release 2021-04-15 20:25:26 +01:00
stack72 c26d89f734 [deps] Ensuring pulumi/pulumi pkg references pulumi sdk v2.25.1 2021-04-15 19:42:00 +01:00
Komal Ali 87906ca395 [PATCH] Fix stack settings serialization 2021-04-15 19:05:30 +01:00
8 changed files with 80 additions and 146 deletions

View file

@ -1,6 +1,20 @@
CHANGELOG
=========
## 2.25.2 (2021-04-17)
### Bug Fixes
- [cli] Fix a bug that prevented copying checkpoint files when using Azure Blob Storage
as the backend provider. [#6794](https://github.com/pulumi/pulumi/pull/6794)
## 2.25.1 (2021-04-15)
### Bug Fixes
- [automation/python] - Fix serialization bug in `StackSettings`
[#6776](https://github.com/pulumi/pulumi/pull/6776)
## 2.25.0 (2021-04-14)
### Breaking

View file

@ -1,118 +1,4 @@
### Breaking
- [automation/dotnet] Rename (Get,Set,Remove)Config(Value)
[#6731](https://github.com/pulumi/pulumi/pull/6731)
The following methods on Workspace and WorkspaceStack classes have
been renamed. Please update your code (before -> after):
* GetConfigValue -> GetConfig
* SetConfigValue -> SetConfig
* RemoveConfigValue -> RemoveConfig
* GetConfig -> GetAllConfig
* SetConfig -> SetAllConfig
* RemoveConfig -> RemoveAllConfig
This change was made to align with the other Pulumi language SDKs.
### Improvements
- [cli] Add option to print absolute rather than relative dates in stack history
[#6742](https://github.com/pulumi/pulumi/pull/6742)
Example:
```bash
pulumi stack history --full-dates
```
- [cli] Enable absolute and relative parent paths for pulumi main
[#6734](https://github.com/pulumi/pulumi/pull/6734)
- [sdk/dotnet] Thread-safe concurrency-friendly global state
[#6139](https://github.com/pulumi/pulumi/pull/6139)
- [tooling] Update pulumi python docker image to python 3.9
[#6706](https://github.com/pulumi/pulumi/pull/6706)
- [sdk/nodejs] Add program side caching for dynamic provider serialization behind env var
[#6673](https://github.com/pulumi/pulumi/pull/6673)
- [sdk/nodejs] Allow prompt values in `construct` for multi-lang components.
[#6522](https://github.com/pulumi/pulumi/pull/6522)
- [automation/dotnet] Allow null environment variables
[#6687](https://github.com/pulumi/pulumi/pull/6687)
- [automation/dotnet] Expose WorkspaceStack.GetOutputsAsync
[#6699](https://github.com/pulumi/pulumi/pull/6699)
Example:
```csharp
var stack = await WorkspaceStack.CreateAsync(stackName, workspace);
await stack.SetConfigAsync(config);
var initialOutputs = await stack.GetOutputsAsync();
```
- [automation/dotnet] Implement (Import,Export)StackAsync methods on LocalWorkspace and WorkspaceStack and expose StackDeployment helper class.
[#6728](https://github.com/pulumi/pulumi/pull/6728)
Example:
```csharp
var stack = await WorkspaceStack.CreateAsync(stackName, workspace);
var upResult = await stack.UpAsync();
deployment = await workspace.ExportStackAsync(stackName);
```
- [automation/dotnet] Implement CancelAsync method on WorkspaceStack
[#6729](https://github.com/pulumi/pulumi/pull/6729)
Example:
```csharp
var stack = await WorkspaceStack.CreateAsync(stackName, workspace);
var cancelTask = stack.CancelAsync();
```
- [automation/python] - Expose structured logging for Stack.up/preview/refresh/destroy.
[#6527](https://github.com/pulumi/pulumi/pull/6527)
You can now pass in an `on_event` callback function as a keyword arg to `up`, `preview`, `refresh`
and `destroy` to process streaming json events defined in `automation/events.py`
Example:
```python
stack.up(on_event=print)
```
### Bug Fixes
- [cli] Handle non-existent creds file in `pulumi logout --all`
[#6741](https://github.com/pulumi/pulumi/pull/6741)
- [automation/nodejs] Do not run the promise leak checker if an inline program has errored.
[#6758](https://github.com/pulumi/pulumi/pull/6758)
- [sdk/nodejs] Explicitly create event log file for NodeJS Automation API.
[#6730](https://github.com/pulumi/pulumi/pull/6730)
- [sdk/nodejs] Fix error handling for failed logging statements
[#6714](https://github.com/pulumi/pulumi/pull/6714)
- [sdk/nodejs] Fix `Construct` to wait for child resources of a multi-lang components to be created.
[#6452](https://github.com/pulumi/pulumi/pull/6452)
- [sdk/python] Fix serialization bug if output contains 'items' property.
[#6701](https://github.com/pulumi/pulumi/pull/6701)
- [automation] Set default value for 'main' for inline programs to support relative paths, assets, and closure serialization.
[#6743](https://github.com/pulumi/pulumi/pull/6743)
- [automation/dotnet] Environment variable value type is now nullable.
[#6520](https://github.com/pulumi/pulumi/pull/6520)
- [automation/dotnet] Fix GetConfigValueAsync failing to deserialize
[#6698](https://github.com/pulumi/pulumi/pull/6698)
- [automation] Fix (de)serialization of StackSettings in .NET, Node, and Python.
[#6752](https://github.com/pulumi/pulumi/pull/6752)
[#6754](https://github.com/pulumi/pulumi/pull/6754)
[#6749](https://github.com/pulumi/pulumi/pull/6749)
- [cli] Fix a bug that prevented copying checkpoint files when using Azure Blob Storage
as the backend provider. [#6794](https://github.com/pulumi/pulumi/pull/6794)

View file

@ -5,6 +5,7 @@ go 1.16
replace (
github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.5.0
github.com/pulumi/pulumi/sdk/v2 => ../sdk
gocloud.dev => github.com/pulumi/go-cloud v0.0.0-20210416195059-50874ed4c504
)
require (
@ -12,7 +13,7 @@ require (
cloud.google.com/go/storage v1.12.0
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Sirupsen/logrus v1.0.5 // indirect
github.com/aws/aws-sdk-go v1.36.1
github.com/aws/aws-sdk-go v1.37.31
github.com/blang/semver v3.5.1+incompatible
github.com/djherbis/times v1.2.0
github.com/docker/docker v0.0.0-20170504205632-89658bed64c2
@ -33,7 +34,7 @@ require (
github.com/opentracing/opentracing-go v1.1.0
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386
github.com/pkg/errors v0.9.1
github.com/pulumi/pulumi/sdk/v2 v2.25.0
github.com/pulumi/pulumi/sdk/v2 v2.25.2
github.com/rjeczalik/notify v0.9.2
github.com/sergi/go-diff v1.1.0
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect

View file

@ -140,8 +140,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.36.1 h1:rDgSL20giXXu48Ycx6Qa4vWaNTVTltUl6vA73ObCSVk=
github.com/aws/aws-sdk-go v1.36.1/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.37.31 h1:eK7hgg1H4xivwopAbnzfQ7ZBbDb9cEkGDivd9rUMnJs=
github.com/aws/aws-sdk-go v1.37.31/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
@ -362,8 +362,8 @@ github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.4.0 h1:kXcsA/rIGzJImVqPdhfnr6q0xsS9gU0515q1EPpJ9fE=
github.com/google/wire v0.4.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8=
github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
@ -583,8 +583,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzr
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pulumi/pulumi/sdk/v2 v2.23.0 h1:uyTvI6axYV3feeMbcWLnNtHZQsbkx98OoY5Jpq7acSM=
github.com/pulumi/pulumi/sdk/v2 v2.23.0/go.mod h1:sHQdzD0/cIopR5uLeoikXi1pNBv5SwA4M617VqdIA3E=
github.com/pulumi/go-cloud v0.0.0-20210416195059-50874ed4c504 h1:PJMevh3ReqNqWOG/w4d9TjxBs1NT6g5BuSMfjLCOinM=
github.com/pulumi/go-cloud v0.0.0-20210416195059-50874ed4c504/go.mod h1:vue/5w3xHaYFrd9vJ7+OQrfkE1ew0wuPaOeASycD+1E=
github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8=
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng=
@ -700,8 +700,6 @@ go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
gocloud.dev v0.22.0 h1:psFb4EJ+bF9bjns7XR3n3tMMMB1LNs97YURcyh4oVWM=
gocloud.dev v0.22.0/go.mod h1:z3jKIQ0Es9LALVZFQ3wOvwqAsSLq1R5c/2RdmghDucw=
gocloud.dev/secrets/hashivault v0.22.0 h1:0rLZDs7sMSs7Jhby/tH91o0gkVSqpoXgQDFvmajx9X4=
gocloud.dev/secrets/hashivault v0.22.0/go.mod h1:FPYXspcfN9sWef3ISbMPqfurxLzkjL3n4MxuFt01pMU=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional, Mapping, Any, Union, Dict
from typing import Optional, Any, Dict
class StackSettingsSecureConfigValue:
@ -28,38 +28,52 @@ class StackSettings:
secrets_provider: Optional[str]
encrypted_key: Optional[str]
encryption_salt: Optional[str]
config: Optional[Mapping[str, Any]]
config: Optional[Dict[str, Any]]
def __init__(self,
secrets_provider: Optional[str] = None,
encrypted_key: Optional[str] = None,
encryption_salt: Optional[str] = None,
config: Optional[Mapping[str, Any]] = None):
config: Optional[Dict[str, Any]] = None):
self.secrets_provider = secrets_provider
self.encrypted_key = encrypted_key
self.encryption_salt = encryption_salt
if config:
stack_config: Dict[str, Union[str, StackSettingsSecureConfigValue]] = {}
for key in config:
val = config[key]
self.config = config
@classmethod
def _deserialize(cls, data: dict):
config = data.get("config")
if config is not None:
stack_config: Dict[str, Any] = {}
for key, val in config.items():
if isinstance(val, str):
stack_config[key] = val
elif "secure" in val:
stack_config[key] = StackSettingsSecureConfigValue(**val)
if len(stack_config.keys()) > 0:
self.config = stack_config
@classmethod
def _deserialize(cls, data: dict):
config = stack_config
return cls(secrets_provider=data.get("secretsprovider"),
encrypted_key=data.get("encryptedkey"),
encryption_salt=data.get("encryptionsalt"),
config=data.get("config"))
config=config)
def _serialize(self):
return {
"secretsprovider": self.secrets_provider,
"encryptedkey": self.encrypted_key,
"encryptionsalt": self.encryption_salt,
"config": self.config
}
serializable = {}
# Only add the keys that are present to avoid writing nulls to the
# Pulumi.[stack].yaml file.
if self.secrets_provider:
serializable["secretsprovider"] = self.secrets_provider
if self.encrypted_key:
serializable["encryptedkey"] = self.encrypted_key
if self.encryption_salt:
serializable["encryptionsalt"] = self.encryption_salt
if self.config:
config = {}
for key, val in self.config.items():
if isinstance(val, StackSettingsSecureConfigValue):
config[key] = {"secure": val.secure}
else:
config[key] = val
serializable["config"] = config
return serializable

View file

@ -34,6 +34,7 @@ from pulumi.x.automation import (
ProjectSettings,
StackSummary,
Stack,
StackSettings,
StackAlreadyExistsError,
fully_qualified_stack_name,
)
@ -106,6 +107,24 @@ class TestLocalWorkspace(unittest.TestCase):
self.assertEqual(settings.config["plain"], "plain")
self.assertEqual(settings.config["secure"].secure, "secret")
settings_with_no_config = StackSettings(secrets_provider="blah",
encrypted_key="thisiskey",
encryption_salt="salty")
self.assertEqual(settings_with_no_config._serialize(), {
"secretsprovider": "blah",
"encryptedkey": "thisiskey",
"encryptionsalt": "salty"
})
config = {
"cool": "sup",
"foo": {"secure": "thisisasecret"},
}
settings_with_only_config = StackSettings(config=config)
self.assertEqual(settings_with_only_config._serialize(), {
"config": config
})
def test_plugin_functions(self):
ws = LocalWorkspace()
# Install aws 3.0.0 plugin

View file

@ -14,6 +14,6 @@ require (
github.com/pkg/errors v0.9.1
github.com/pulumi/pulumi-random/sdk/v2 v2.4.2
github.com/pulumi/pulumi/pkg/v2 v2.0.0
github.com/pulumi/pulumi/sdk/v2 v2.25.0
github.com/pulumi/pulumi/sdk/v2 v2.25.2
github.com/stretchr/testify v1.6.1
)

View file

@ -142,6 +142,8 @@ github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZo
github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.36.1 h1:rDgSL20giXXu48Ycx6Qa4vWaNTVTltUl6vA73ObCSVk=
github.com/aws/aws-sdk-go v1.36.1/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.37.31 h1:eK7hgg1H4xivwopAbnzfQ7ZBbDb9cEkGDivd9rUMnJs=
github.com/aws/aws-sdk-go v1.37.31/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=