Skip to content

Commit 181f807

Browse files
authored
Merge pull request #6 from pulumi/rshade/update-helm-base
Updating helmbase, kubernetes, and pulumi dependencies, fixes #4
2 parents 14f007c + ef01a17 commit 181f807

34 files changed

+699
-1639
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ ci-scripts/
1616
*.tar.gz
1717

1818
/provider/cmd/pulumi-resource-*/schema.go
19+
.vscode/
20+
**/*.bak

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PROJECT := github.com/pulumi/pulumi-${PACK}
55

66
PROVIDER := pulumi-resource-${PACK}
77
CODEGEN := pulumi-gen-${PACK}
8-
VERSION_PATH := provider/pkg/version.Version
8+
VERSION_PATH := pkg/version.Version
99

1010
WORKING_DIR := $(shell pwd)
1111
SCHEMA_PATH := ${WORKING_DIR}/schema.json

examples/simple-nginx-ts/index.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import * as k8s from "@pulumi/kubernetes";
66
import * as nginx from "@pulumi/kubernetes-ingress-nginx";
77

8+
// Create a sandbox namespace.
9+
const ns = new k8s.core.v1.Namespace("sandbox-ns");
10+
811
// Install the NGINX ingress controller to our cluster. The controller
912
// consists of a Pod and a Service. Install it and configure the controller
1013
// to publish the load balancer IP address on each Ingress so that
@@ -15,6 +18,9 @@ const ctrl = new nginx.IngressController("myctrl", {
1518
enabled: true,
1619
},
1720
},
21+
helmOptions: {
22+
namespace: ns.metadata.name,
23+
},
1824
});
1925

2026
// Now let's deploy two applications which are identical except for the
@@ -25,15 +31,21 @@ const appBase = "hello-k8s";
2531
const appNames = [ `${appBase}-first`, `${appBase}-second` ];
2632
for (const appName of appNames) {
2733
const appSvc = new k8s.core.v1.Service(`${appName}-svc`, {
28-
metadata: { name: appName },
34+
metadata: {
35+
name: appName,
36+
namespace: ns.metadata.name
37+
},
2938
spec: {
3039
type: "ClusterIP",
3140
ports: [{ port: 80, targetPort: 8080 }],
3241
selector: { app: appName },
3342
},
3443
});
3544
const appDep = new k8s.apps.v1.Deployment(`${appName}-dep`, {
36-
metadata: { name: appName },
45+
metadata: {
46+
name: appName,
47+
namespace: ns.metadata.name
48+
},
3749
spec: {
3850
replicas: 3,
3951
selector: {
@@ -64,6 +76,7 @@ const appIngress = new k8s.networking.v1.Ingress(`${appBase}-ingress`, {
6476
annotations: {
6577
"kubernetes.io/ingress.class": "nginx",
6678
},
79+
namespace: ns.metadata.name
6780
},
6881
spec: {
6982
rules: [

provider/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/pulumi/pulumi-kubernetes-ingress-nginx
22

3-
go 1.15
3+
go 1.16
44

55
require (
6-
github.com/joeduffy/pulumi-go-helmbase v0.0.11
76
github.com/pkg/errors v0.9.1
8-
github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.7.3
9-
github.com/pulumi/pulumi/pkg/v3 v3.12.0
10-
github.com/pulumi/pulumi/sdk/v3 v3.13.2
7+
github.com/pulumi/pulumi-go-helmbase v0.0.14
8+
github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.19.1
9+
github.com/pulumi/pulumi/pkg/v3 v3.32.1
10+
github.com/pulumi/pulumi/sdk/v3 v3.32.1
1111
)

provider/go.sum

Lines changed: 372 additions & 54 deletions
Large diffs are not rendered by default.

provider/pkg/provider/chart.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package provider
1616

1717
import (
18+
helmbase "github.com/pulumi/pulumi-go-helmbase"
1819
corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/core/v1"
1920
helmv3 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/helm/v3"
2021
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
@@ -68,10 +69,10 @@ type IngressControllerArgs struct {
6869

6970
// HelmOptions is an escape hatch that lets the end user control any aspect of the
7071
// Helm deployment. This exposes the entirety of the underlying Helm Release component args.
71-
HelmOptions *helmv3.ReleaseType `pulumi:"helmOptions" pschema:"ref=#/types/chart-ingress-nginx:index:Release" json:"-"`
72+
HelmOptions *helmbase.ReleaseType `pulumi:"helmOptions" pschema:"ref=#/types/chart-ingress-nginx:index:Release" json:"-"`
7273
}
7374

74-
func (args *IngressControllerArgs) R() **helmv3.ReleaseType { return &args.HelmOptions }
75+
func (args *IngressControllerArgs) R() **helmbase.ReleaseType { return &args.HelmOptions }
7576

7677
type Controller struct {
7778
Name *string `pulumi:"name"`

provider/pkg/provider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package provider
1616

1717
import (
18-
helmbase "github.com/joeduffy/pulumi-go-helmbase"
18+
helmbase "github.com/pulumi/pulumi-go-helmbase"
1919

2020
"github.com/pulumi/pulumi/pkg/v3/resource/provider"
2121
"github.com/pulumi/pulumi/sdk/v3/go/common/util/cmdutil"

sdk/dotnet/Pulumi.KubernetesIngressNginx.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,19 @@
3939
<None Include="version.txt" Pack="True" PackagePath="content" />
4040
</ItemGroup>
4141

42+
<ItemGroup>
43+
<EmbeddedResource Include="pulumi-plugin.json" />
44+
<None Include="pulumi-plugin.json" Pack="True" PackagePath="content" />
45+
</ItemGroup>
46+
4247
<ItemGroup>
4348
<PackageReference Include="Pulumi" Version="3.*" />
4449
<PackageReference Include="Pulumi.Kubernetes" Version="3.*" ExcludeAssets="contentFiles" />
4550
</ItemGroup>
4651

52+
<ItemGroup>
53+
</ItemGroup>
54+
4755
<ItemGroup>
4856
<None Include="logo.png">
4957
<Pack>True</Pack>

sdk/dotnet/Utilities.cs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// *** WARNING: this file was generated by Pulumi SDK Generator. ***
22
// *** Do not edit by hand unless you're certain you know what you are doing! ***
33

4-
using System;
5-
using System.IO;
6-
using System.Reflection;
7-
using Pulumi;
8-
94
namespace Pulumi.KubernetesIngressNginx
105
{
116
static class Utilities
@@ -14,7 +9,7 @@ static class Utilities
149
{
1510
foreach (var n in names)
1611
{
17-
var value = Environment.GetEnvironmentVariable(n);
12+
var value = global::System.Environment.GetEnvironmentVariable(n);
1813
if (value != null)
1914
{
2015
return value;
@@ -30,11 +25,11 @@ static class Utilities
3025
var s = GetEnv(names);
3126
if (s != null)
3227
{
33-
if (Array.IndexOf(trueValues, s) != -1)
28+
if (global::System.Array.IndexOf(trueValues, s) != -1)
3429
{
3530
return true;
3631
}
37-
if (Array.IndexOf(falseValues, s) != -1)
32+
if (global::System.Array.IndexOf(falseValues, s) != -1)
3833
{
3934
return false;
4035
}
@@ -46,28 +41,29 @@ static class Utilities
4641

4742
public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null;
4843

49-
public static InvokeOptions WithVersion(this InvokeOptions? options)
44+
[global::System.Obsolete("Please use WithDefaults instead")]
45+
public static global::Pulumi.InvokeOptions WithVersion(this global::Pulumi.InvokeOptions? options)
5046
{
51-
if (options?.Version != null)
52-
{
53-
return options;
54-
}
55-
return new InvokeOptions
56-
{
57-
Parent = options?.Parent,
58-
Provider = options?.Provider,
59-
Version = Version,
60-
};
47+
var dst = options ?? new global::Pulumi.InvokeOptions{};
48+
dst.Version = options?.Version ?? Version;
49+
return dst;
50+
}
51+
52+
public static global::Pulumi.InvokeOptions WithDefaults(this global::Pulumi.InvokeOptions? src)
53+
{
54+
var dst = src ?? new global::Pulumi.InvokeOptions{};
55+
dst.Version = src?.Version ?? Version;
56+
return dst;
6157
}
6258

6359
private readonly static string version;
6460
public static string Version => version;
6561

6662
static Utilities()
6763
{
68-
var assembly = typeof(Utilities).GetTypeInfo().Assembly;
64+
var assembly = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Utilities)).Assembly;
6965
using var stream = assembly.GetManifestResourceStream("Pulumi.KubernetesIngressNginx.version.txt");
70-
using var reader = new StreamReader(stream ?? throw new NotSupportedException("Missing embedded version.txt file"));
66+
using var reader = new global::System.IO.StreamReader(stream ?? throw new global::System.NotSupportedException("Missing embedded version.txt file"));
7167
version = reader.ReadToEnd().Trim();
7268
var parts = version.Split("\n");
7369
if (parts.Length == 2)

sdk/dotnet/pulumi-plugin.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"resource": true,
3+
"name": "kubernetes-ingress-nginx"
4+
}

0 commit comments

Comments
 (0)