Skip to content

Commit

Permalink
Update pulumi/pulumi. (#696)
Browse files Browse the repository at this point in the history
Pick up a recent fix to empty array property conversion.

Fixes #693.
  • Loading branch information
pgavlin authored Aug 7, 2019
1 parent a33c437 commit aea8453
Show file tree
Hide file tree
Showing 12 changed files with 256 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Align YAML parsing with core Kubernetes supported YAML subset. (https://github.com/pulumi/pulumi-kubernetes/pull/690).
- Handle string values in the equalNumbers function. (https://github.com/pulumi/pulumi-kubernetes/pull/691).
- Properly detect readiness for Deployment scaled to 0. (https://github.com/pulumi/pulumi-kubernetes/pull/688).
- Fix a bug that caused crashes when empty array values were added to resource inputs. (https://github.com/pulumi/pulumi-kubernetes/pull/696)

## 0.25.5 (August 2, 2019)

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ require (
github.com/json-iterator/go v1.1.6 // indirect
github.com/mitchellh/go-wordwrap v1.0.0
github.com/pkg/errors v0.8.1
github.com/pulumi/pulumi v0.17.26-0.20190723034217-ed5b8437d126
github.com/pulumi/pulumi v0.17.29-0.20190807184240-6983e2639b4b
github.com/stretchr/testify v1.3.0
google.golang.org/grpc v1.20.1
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.0.0-20190620084959-7cf5895f2711
k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719
Expand Down
69 changes: 65 additions & 4 deletions go.sum

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions tests/integration/empty-array/emptyarray_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2016-2019, 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 ints

import (
"os"
"testing"

"github.com/pulumi/pulumi/pkg/testing/integration"
)

func TestEmptyArray(t *testing.T) {
kubectx := os.Getenv("KUBERNETES_CONTEXT")

if kubectx == "" {
t.Skipf("Skipping test due to missing KUBERNETES_CONTEXT variable")
}

integration.ProgramTest(t, &integration.ProgramTestOptions{
Dir: "step1",
Dependencies: []string{"@pulumi/kubernetes"},
EditDirs: []integration.EditDir{
{
Dir: "step2",
Additive: true,
},
},
})
}
3 changes: 3 additions & 0 deletions tests/integration/empty-array/step1/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: dry-run-tests
description: Tests whether Pulumi uses dry-run support to avoid spurious diffs.
runtime: nodejs
34 changes: 34 additions & 0 deletions tests/integration/empty-array/step1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2016-2019, 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.

import * as k8s from "@pulumi/kubernetes";

const appLabels = { app: "nginx" };

const deployment = new k8s.apps.v1.Deployment("nginx", {
spec: {
selector: { matchLabels: appLabels },
replicas: 1,
template: {
metadata: { labels: appLabels },
spec: {
containers: [{
name: "nginx",
image: "nginx",
}],
}
}
}
});
export const name = deployment.metadata.name;
14 changes: 14 additions & 0 deletions tests/integration/empty-array/step1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "steps",
"version": "0.1.0",
"dependencies": {
"@pulumi/pulumi": "dev",
"@pulumi/random": "dev"
},
"devDependencies": {
"typescript": "^3.0.0"
},
"peerDependencies": {
"@pulumi/kubernetes": "latest"
}
}
22 changes: 22 additions & 0 deletions tests/integration/empty-array/step1/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"stripInternal": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
},
"files": [
"index.ts"
]
}

3 changes: 3 additions & 0 deletions tests/integration/empty-array/step2/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: dry-run-tests
description: Tests whether Pulumi uses dry-run support to avoid spurious diffs.
runtime: nodejs
36 changes: 36 additions & 0 deletions tests/integration/empty-array/step2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2016-2019, 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.

import * as k8s from "@pulumi/kubernetes";

const appLabels = { app: "nginx" };

const deployment = new k8s.apps.v1.Deployment("nginx", {
spec: {
selector: { matchLabels: appLabels },
replicas: 1,
template: {
metadata: { labels: appLabels },
spec: {
containers: [{
name: "nginx",
image: "nginx:latest",
volumeMounts: [],
}],
volumes: [],
}
}
}
});
export const name = deployment.metadata.name;
14 changes: 14 additions & 0 deletions tests/integration/empty-array/step2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "steps",
"version": "0.1.0",
"dependencies": {
"@pulumi/pulumi": "dev",
"@pulumi/random": "dev"
},
"devDependencies": {
"typescript": "^3.0.0"
},
"peerDependencies": {
"@pulumi/kubernetes": "latest"
}
}
22 changes: 22 additions & 0 deletions tests/integration/empty-array/step2/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"stripInternal": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
},
"files": [
"index.ts"
]
}

0 comments on commit aea8453

Please sign in to comment.