[SDCICD-1812] update region if cluster id is provided#3207
[SDCICD-1812] update region if cluster id is provided#3207openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
Conversation
|
There are test jobs defined for this repository which are not configured to run automatically. Comment |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe changes introduce a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: varunraokadaparthi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@coderabbitai review |
|
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pkg/krknai/krknai.go (1)
66-73: Keep region keys synchronized after cluster lookup.Line 72 updates only
config.AWSRegion.AnalyzeLogsreadsconfig.CloudProvider.Region(Line 438), so region state can diverge. Set both keys on success.Suggested patch
viper.Set(config.AWSRegion, clusterRegion) + viper.Set(config.CloudProvider.Region, clusterRegion) }As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/krknai/krknai.go` around lines 66 - 73, The code sets viper key config.AWSRegion after fetching clusterRegion via provider.GetClusterRegion but AnalyzeLogs reads config.CloudProvider.Region, so keep both keys synchronized: after successful GetClusterRegion in the block around viper.Set(config.AWSRegion, clusterRegion), also set viper.Set(config.CloudProvider.Region, clusterRegion) (and ensure any other consumers expect the same key); update the cluster lookup block that calls provider.GetClusterRegion to set both config.AWSRegion and config.CloudProvider.Region to the returned clusterRegion so AnalyzeLogs and other code read the same region value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/parameterized-job-krknai.sh`:
- Line 63: The job runner currently hard-codes AWS region via the literal
AWS_REGION="us-east-1" in scripts/parameterized-job-krknai.sh; replace that
hard-coded value with a caller-provided environment variable fallback (e.g., use
shell parameter expansion for AWS_REGION with a default) so callers can override
the region without editing the script and the runner still has a sensible
default; update any references that set or export AWS_REGION in the script
(search for AWS_REGION) and ensure the script documents/accepts an env var or
argument for region.
---
Nitpick comments:
In `@pkg/krknai/krknai.go`:
- Around line 66-73: The code sets viper key config.AWSRegion after fetching
clusterRegion via provider.GetClusterRegion but AnalyzeLogs reads
config.CloudProvider.Region, so keep both keys synchronized: after successful
GetClusterRegion in the block around viper.Set(config.AWSRegion, clusterRegion),
also set viper.Set(config.CloudProvider.Region, clusterRegion) (and ensure any
other consumers expect the same key); update the cluster lookup block that calls
provider.GetClusterRegion to set both config.AWSRegion and
config.CloudProvider.Region to the returned clusterRegion so AnalyzeLogs and
other code read the same region value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: c7c2eb5b-d7b3-4488-bba5-e073fcee35e1
📒 Files selected for processing (5)
pkg/common/providers/ocmprovider/cluster.gopkg/common/providers/rosaprovider/wrapped_calls.gopkg/common/spi/provider.gopkg/krknai/krknai.goscripts/parameterized-job-krknai.sh
15d8083 to
355eb4d
Compare
|
/lgtm |
|
/override ci/prow/hypershift-pr-check |
|
@varunraokadaparthi: Overrode contexts on behalf of varunraokadaparthi: ci/prow/hypershift-pr-check DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@varunraokadaparthi: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
fix for region not set error in jenkins job
Co-authored-by: Cursor cursor@cursor.com