-
Notifications
You must be signed in to change notification settings - Fork 136
fix: pulumi postgres chart version #1139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughA new ChartVersion field is added to the PostgreSQL installation configuration and threaded into the component arguments so the Helm chart Version is taken from configuration instead of a hard-coded value. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Config as Config (PostgresInstall)
participant Component as Component (PostgresInstallArgs)
participant Helm as Helm Chart deploy
rect rgb(230, 245, 255)
Config->>Component: pass ChartVersion (string) into PostgresInstallArgs
end
rect rgb(245, 255, 230)
Component->>Helm: provide Chart values (including Version from ChartVersion)
Helm->>Helm: deploy chart using provided Version
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
5ffbf3a to
a44053e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1139 +/- ##
==========================================
- Coverage 78.38% 78.35% -0.03%
==========================================
Files 190 190
Lines 9408 9408
==========================================
- Hits 7374 7372 -2
- Misses 1305 1307 +2
Partials 729 729 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
deployments/pulumi/pkg/storage/component_postgres.go (1)
65-84: Add default value handling for ChartVersion.The
SetDefaults()method sets defaults forUsernameandPassword, but not forChartVersion. Without a default, an empty chart version will be passed to Helm if users don't specify it in their configuration, causing deployment failures.Apply this diff to add default handling:
args.Password = pulumix.Apply(args.Password, func(password string) string { if password == "" { return "password" } return password }) + if args.ChartVersion == nil { + args.ChartVersion = pulumix.Val("") + } + args.ChartVersion = pulumix.Apply(args.ChartVersion, func(version string) string { + if version == "" { + return "16.4.7" + } + return version + }) }
🧹 Nitpick comments (1)
deployments/pulumi/pkg/config/config.go (1)
160-162: Consider using lowercase naming for consistency.The JSON/YAML tag
chartVersionuses camelCase, while other fields in the same struct (username,password) use lowercase. For consistency within the struct, consider using lowercasechartversion.Apply this diff if you prefer consistency:
- // ChartVersion is the bitnami/postgres chart version - ChartVersion string `json:"chartVersion" yaml:"chartVersion"` + // ChartVersion is the bitnami/postgres chart version + ChartVersion string `json:"chartversion" yaml:"chartversion"`
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
deployments/pulumi/pkg/config/config.go(2 hunks)deployments/pulumi/pkg/storage/component_postgres.go(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Tests
🔇 Additional comments (2)
deployments/pulumi/pkg/storage/component_postgres.go (2)
62-62: Field addition looks good, but needs default value handling.The
ChartVersionfield is properly added to the struct. However, ensure theSetDefaults()method (see comment on lines 65-84) is updated to provide a default value.
102-102: Good change to enable configurable chart version.The switch from a hardcoded version to the configurable
ChartVersionfield properly enables dynamic chart version selection. The.ToOutput().Untyped()pattern is standard for Pulumi input conversions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
deployments/pulumi/pkg/storage/component_postgres.go(2 hunks)
🔇 Additional comments (2)
deployments/pulumi/pkg/storage/component_postgres.go (2)
59-63: LGTM! Field addition follows existing patterns.The
ChartVersionfield is properly added to the struct and follows the same pattern as the existingUsernameandPasswordfields.
105-105: Chart version properly propagated through configuration layer.Verification confirms that
ChartVersionis correctly threaded from the configuration layer to the component. ThePostgresDatabase.toInput()method indeployments/pulumi/pkg/config/config.go(line 191) explicitly mapsa.Install.ChartVersiontostorage.PostgresInstallArgs.ChartVersionusingpulumix.Val(), converting it from a string topulumix.Input[string]. The type assertion pattern used on line 105 aligns with idiomatic usage in this codebase.
No description provided.