Kubernetes get-started create-component.md: Go and C# silently default isMinikube instead of requiring it, unlike TS/Python/Java/HCL

Open Beginner friendly
#21,762 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
94/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, go
Domain
documentation

Research direction

Open content/docs/iac/get-started/kubernetes/create-component.md and inspect the Go and C# snippets in the mid-page example and full assembled program. Replace the four documented get-with-fallback calls with the specified require calls, then compare all six language tracks to confirm missing isMinikube configuration produces an error consistently.

Written by the indexing model from the issue text.

Description

area/docs-content Bug pulumi/docs

Page: content/docs/iac/get-started/kubernetes/create-component.md

The page walks readers through building a KubernetesNginxService component whose behavior branches on a stack config value isMinikube (bool): when true, the Service is ClusterIP; when false, it's LoadBalancer. Six language tracks show the same step, and four of them read this config value with "require" semantics (error if the reader hasn't run pulumi config set isMinikube true), while Go and C# use "get" semantics with an implicit false fallback, so a reader who skips or mistypes the config-set step gets a silently wrong deployment (LoadBalancer) instead of an actionable error.

This occurs in two places on the page: the illustrative mid-page snippet, and the full assembled program later on.

Correct (require semantics), for comparison:

  • TypeScript, line 30: config.requireBoolean("isMinikube")
  • Python, line 40 / 897: config.require_bool("isMinikube")
  • Java, line 80 / 980: config.requireBoolean("isMinikube")
  • HCL, line 302 / 1005: variable "isMinikube" { type = bool } with no default (Pulumi HCL treats an undefaulted variable as mandatory)

Incorrect (get semantics with silent fallback):

  • Go, line 50: IsMinikube: config.GetBool(ctx, "isMinikube"), — should be config.RequireBool(ctx, "isMinikube")
  • Go, line 918: isMinikube := config.GetBool(ctx, "isMinikube") — should be config.RequireBool(ctx, "isMinikube")
  • C#, line 65: IsMinikube = config.GetBoolean("isMinikube") ?? false — should be config.RequireBoolean("isMinikube")
  • C#, line 952: IsMinikube = config.GetBoolean("isMinikube") ?? false — should be config.RequireBoolean("isMinikube")

Verification:

  • RequireBool(ctx *pulumi.Context, key string) bool confirmed to exist in the current Go SDK (github.com/pulumi/pulumi/sdk/v3 v3.263.0) via go doc github.com/pulumi/pulumi/sdk/v3/go/pulumi/config run against a real scratch module resolving that exact SDK version.
  • RequireBoolean(string key) confirmed on Pulumi.Config (.NET) via the official reference page https://www.pulumi.com/docs/reference/pkg/dotnet/Pulumi/pulumi.config.html: "Loads a configuration value, as a boolean, by its given key. If it doesn't exist, ... an error is thrown" — versus GetBoolean's documented "or null if it doesn't exist" behavior, which the current snippet papers over with ?? false.

Fix: swap GetBool/GetBoolean(...) ?? false for RequireBool/RequireBoolean in the four locations above so all six language tracks behave identically: erroring clearly if the reader forgets to set isMinikube, rather than two of six silently deploying the production (LoadBalancer) path.

Dominant language
HTML
Stars
178
Forks
271
Avg merge
1d 1h
Merged PRs (30d)
546

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pulumi/docs

All issues in pulumi/docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.