Skip to content

Commit

Permalink
Make stack name for object a config item
Browse files Browse the repository at this point in the history
This removes another hard-coding of an account name.

Signed-off-by: Michael Bridgen <[email protected]>
  • Loading branch information
squaremo committed Oct 21, 2022
1 parent b83b470 commit 13aca21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/flux-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ To run the program:

```console
app$ pulumi config set git-url https://github.com/squaremo/pko-dev
app$ pulumi config set stack-name $(pulumi whoami)/app/dev
app$ pulumi up
```

Expand Down
6 changes: 4 additions & 2 deletions examples/flux-source/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
import * as random from "@pulumi/random";

export const gitURL = new pulumi.Config().require('git-url');
const config = new pulumi.Config();
export const gitURL = config.require('git-url');
export const stackName = config.require('stack-name');

// A git repository source for our Pulumi program
const gitRepo = new k8s.apiextensions.CustomResource("pko-dev", {
Expand Down Expand Up @@ -37,7 +39,7 @@ const stack = new k8s.apiextensions.CustomResource("basic", {
'namespace': 'default',
},
spec: {
stack: 'squaremo/basic/docker-desktop',
stack: stackName,
envRefs: {
'PULUMI_ACCESS_TOKEN': {
'type': 'Secret',
Expand Down

0 comments on commit 13aca21

Please sign in to comment.