← Back to Pull requests

feat(ROSAENG-68802): add control-plane EBS volume change notification #991

Closed
fullsend-ai-coder[bot] closed this pull request without merging on Oct 13, 2026 15:48 UTC
View on GitHub
fullsend-ai-coder[bot] fullsend-ai-coder[bot] commented on Oct 06, 2026 15:42 UTC
Author

Summary

  • Add control-plane EBS volume type change notification using a dedicated managed-notifications template (controlplane_volume_type_changed.json), separate from the existing infra template

  • Send the notification right after the CPMS patch succeeds (before rollout monitoring) using servicelog.Post() for the standard confirmation flow

  • Treat omitted CPMS EBS VolumeType as the effective AWS default gp2 so notifications are not skipped when the field is nil

  • Fix monitorCPMSRollout to wait for ObservedGeneration to match Generation before trusting replica counts, preventing stale pre-patch status from prematurely satisfying the completion check

  • Keep service-log failures non-fatal with manual remediation guidance
  • Depends on the template added in managed-notifications#436.

    Testing

  • go test -v ./cmd/cluster/ -- all tests pass (existing + new)

  • go vet ./cmd/cluster/ -- clean

  • New tests cover: nil VolumeType resolution, already-at-target skip, ObservedGeneration stale-generation blocking, and successful rollout completion
  • ---

    Related to https://redhat.atlassian.net/browse/ROSAENG-68802

    Post-script verification

  • Branch is not main/master (agent/ROSAENG-68802-cp-ebs-notification)

  • Secret scan passed (gitleaks — 8f99854ac061a7720c4876947770c222ad9c3a7f..HEAD)

  • PR body secret scan passed (gitleaks — no-git)
  • Diff: 265 lines (+260 / -5) across 2 files Reviewer: joshbranham Review duration: 10085m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.38) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.38 · 265 lines diff across 2 files
    0.38
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.74 · 5 substantive comment(s)
    0.74
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    84%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Real PR Conversation Timeline
    14 items
    coderabbitai[bot] coderabbitai[bot] commented on Oct 06, 2026 15:42 UTC
    Bot

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- This is an auto-generated comment: skip review by coderabbit.ai -->

    [!IMPORTANT]

    ## Review skipped

    > Bot user detected.

    > To trigger a single review, invoke the @coderabbitai review command.

    > <details>

    <summary>⚙️ Run configuration</summary>

    > - Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

    - Review profile: CHILL

    - Plan: Advanced

    - Run ID: 4aabd786-8b33-4530-87d0-1b34517ceee8

    > </details>

    > You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

    > Use the checkbox below for a quick retry:

    - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review

    <!-- end of auto-generated comment: skip review by coderabbit.ai -->

    <!-- tips_start -->

    ---

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    openshift-ci[bot] openshift-ci[bot] commented on Oct 06, 2026 15:45 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by: <a href="https://github.com/openshift/osdctl/pull/991#" title="Author self-approved">fullsend-ai-coder[bot]</a>
    Once this PR has been reviewed and has the lgtm label, please assign bergmannf for approval. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["bergmannf"]} -->

    openshift-ci[bot] openshift-ci[bot] commented on Oct 06, 2026 15:45 UTC
    Bot

    Hi @fullsend-ai-coder[bot]. Thanks for your PR.

    I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

    Regular contributors should join the org to skip this step.

    Once the patch is verified, the new status will be reflected by the ok-to-test label.

    I understand the commands that are listed here.

    <details>

    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.
    </details>

    joshbranham joshbranham commented on code on Oct 06, 2026 15:47 UTC
    Code Review
    cmd/cluster/changevolumetype.go:1
    @@ -29,11 +29,21 @@ import (
     const (
     	changeVolumeTypeCPMSNamespace = "openshift-machine-api"
     	changeVolumeTypeCPMSName      = "cluster"
    +)
     
    +// pollInterval and rolloutPollTimeout are package-level vars so that tests
    +// can use shorter durations without waiting 30 s between poll ticks.
    +var (
     	pollInterval       = 30 * time.Second
     	rolloutPollTimeout = 45 * time.Minute
     )
     
    +// defaultAWSEBSVolumeType is the effective AWS default when the CPMS
    +// EBS VolumeType field is nil. The machine-api-provider-aws passes a
    +// nil VolumeType through to the AWS SDK, which omits it from the
    +// RunInstances call; AWS then defaults to "gp2".
    +const defaultAWSEBSVolumeType = "gp2"

    AWS definitely defaults to gp3

    RaphaelBut RaphaelBut commented on Oct 12, 2026 12:56 UTC
    Contributor

    /fs-fix
    1. Drop defaultAWSEBSVolumeType — don't hardcode an AWS default. Keep currentType := "" and if it's empty after the nil check, skip the automatic service log and print guidance for the SRE to verify the actual type and send the
    service log manually.
    2. Service log placement is good — after patch, before monitoring. Keep it there.
    3. Fix $CLUSTER_ID — line 394 uses a Go string literal "$CLUSTER_ID" instead of o.clusterID. The infra path gets this right.
    4. Use strings.Join for params — same pattern as infra, instead of hardcoding individual -p flags.
    5. ObservedGeneration check is a good fix — the stale-status race was a real bug, keep it.
    7. Error on nil EBS instead of panic — add if awsSpec.BlockDevices[0].EBS == nil { return fmt.Errorf("CPMS blockDevice has no EBS configuration") } before the write path. Stops the operation cleanly instead of a nil-deref panic.
    8. Redundant double timeout in monitorCPMSRollout — context.WithTimeout wraps with rolloutPollTimeout, then PollUntilContextTimeout applies the same timeout again internally. Drop one.
    9. Add rollout monitoring fallback guidance — if monitorCPMSRollout fails or times out, print recovery guidance like CPMS patch was applied successfully but rollout monitoring failed. Monitor manually with: oc get
    controlplanemachineset/cluster -n openshift-machine-api -w. The SRE needs to know the patch went through and how to watch it themselves.

    fullsend-ai-coder[bot] fullsend-ai-coder[bot] commented on Oct 12, 2026 12:58 UTC
    Author

    <!-- fullsend:agent-status:38252251868 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Fix · ❌ Failure (ensuring provider "gitleaks": retries exhausted after 3 attempts: provider create "gitleaks" failed: exit status 1 (output: Error: × unsupported provider type or profile: fullsend-gitleaks ) ensuring…) · Started 12:58 PM UTC · Completed 12:58 PM UTC

    Commit: e45d118 · View workflow run →

    Effort: high

    RaphaelBut RaphaelBut commented on code on Oct 12, 2026 13:06 UTC
    Code Review
    cmd/cluster/changevolumetype.go:1
    @@ -29,11 +29,21 @@ import (
     const (
     	changeVolumeTypeCPMSNamespace = "openshift-machine-api"
     	changeVolumeTypeCPMSName      = "cluster"
    +)
     
    +// pollInterval and rolloutPollTimeout are package-level vars so that tests
    +// can use shorter durations without waiting 30 s between poll ticks.
    +var (
     	pollInterval       = 30 * time.Second
     	rolloutPollTimeout = 45 * time.Minute
     )
     
    +// defaultAWSEBSVolumeType is the effective AWS default when the CPMS
    +// EBS VolumeType field is nil. The machine-api-provider-aws passes a
    +// nil VolumeType through to the AWS SDK, which omits it from the
    +// RunInstances call; AWS then defaults to "gp2".
    +const defaultAWSEBSVolumeType = "gp2"

    Thanks Josh. This was added because the field is optional in cpms.
    The command moves volumes to gp3 so using a default as PREVIOUS_VOLUME_TYPE doesn't make much sense.
    Instead, we can error and send the servicelog manually with the correct previous volume type.

    The other option is for osdctl to pull it from the aws account, but during operations, the previous type will generally be known to the operator before running this command anyhow^^

    RaphaelBut RaphaelBut commented on Oct 12, 2026 13:08 UTC
    Contributor

    /fs-fix
    1. Drop defaultAWSEBSVolumeType — don't hardcode an AWS default. Keep currentType := "" and if it's empty after the nil check, skip the automatic service log and print guidance for the SRE to verify the actual type and send the
    service log manually.
    2. Service log placement is good — after patch, before monitoring. Keep it there.
    3. Fix $CLUSTER_ID — line 394 uses a Go string literal "$CLUSTER_ID" instead of o.clusterID. The infra path gets this right.
    4. Use strings.Join for params — same pattern as infra, instead of hardcoding individual -p flags.
    5. ObservedGeneration check is a good fix — the stale-status race was a real bug, keep it.
    7. Error on nil EBS instead of panic — add if awsSpec.BlockDevices[0].EBS == nil { return fmt.Errorf("CPMS blockDevice has no EBS configuration") } before the write path. Stops the operation cleanly instead of a nil-deref panic.
    8. Redundant double timeout in monitorCPMSRollout — context.WithTimeout wraps with rolloutPollTimeout, then PollUntilContextTimeout applies the same timeout again internally. Drop one.
    9. Add rollout monitoring fallback guidance — if monitorCPMSRollout fails or times out, print recovery guidance like CPMS patch was applied successfully but rollout monitoring failed. Monitor manually with: oc get
    controlplanemachineset/cluster -n openshift-machine-api -w. The SRE needs to know the patch went through and how to watch it themselves.

    fullsend-ai-coder[bot] fullsend-ai-coder[bot] commented on Oct 12, 2026 13:10 UTC
    Author

    <!-- fullsend:agent-status:38253584140 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Fix · ❌ Failure (ensuring provider "package-registries": retries exhausted after 3 attempts: provider create "package-registries" failed: exit status 1 (output: Error: × unsupported provider type or profile: fullsend-…) · Started 1:10 PM UTC · Completed 1:10 PM UTC

    Commit: e45d118 · View workflow run →

    Effort: high

    RaphaelBut RaphaelBut commented on Oct 13, 2026 13:08 UTC
    Contributor

    /fs-fix test

    fullsend-ai-coder[bot] fullsend-ai-coder[bot] commented on Oct 13, 2026 13:10 UTC
    Author

    <!-- fullsend:agent-status:38402673677 -->
    <!-- fullsend:status:terminal -->
    🤖 Finished Fix · ❌ Failure (ensuring provider "github-artifacts": retries exhausted after 3 attempts: provider create "github-artifacts" failed: exit status 1 (output: Error: × unsupported provider type or profile: fullsend-gith…) · Started 1:10 PM UTC · Completed 1:10 PM UTC

    Commit: e45d118 · View workflow run →

    Effort: high

    RaphaelBut RaphaelBut commented on Oct 13, 2026 15:47 UTC
    Contributor

    /close

    openshift-ci[bot] openshift-ci[bot] commented on Oct 13, 2026 15:48 UTC
    Bot

    @RaphaelBut: Closed this PR.

    <details>

    In response to this:

    >/close

    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.
    </details>

    Reviewers
    Assignees
    fullsend-ai-coder[bot] fullsend-ai-coder[bot]
    Labels
    risk: low confidence: 84.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.9% (MEDIUM) · Higher = larger blast radius
    37.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84.7% · Lower = rushed or shallow review
    84.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.8% · Safe to merge
    5.8%