Skip to content

NO-JIRA: chore: default 24h cluster expiration in integration and stage - #806

Merged
openshift-ci[bot] merged 1 commit into
openshift-online:mainfrom
typeid:chore/default-cluster-expiration-int-stage
Sep 14, 2026
Merged

openshift-ci[bot] merged 1 commit into
openshift-online:mainfrom
typeid:chore/default-cluster-expiration-int-stage

Conversation

@typeid

@typeid typeid commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

What

Enable platform-api's --default-cluster-expiration in the integration and stage environments so clusters created without an explicit spec.expirationTimestamp are automatically expired 24h after creation.

Why

Keeps non-production environments from accumulating orphaned test clusters. Callers can still override by supplying their own expirationTimestamp in the create request.

Changes

  • platform-api chart (argocd/config/regional-cluster/platform-api/): render --default-cluster-expiration only when platformApi.app.args.defaultClusterExpiration is set; default is empty (flag omitted = disabled), so environments without a value are unaffected.
  • config: new cluster_lifecycle.default_expiration key in config/defaults.yaml (global default empty), overridden to 24h in config/integration/defaults.yaml and config/stage/defaults.yaml. Wired into the chart via applications.regional-cluster.platformApi, following the existing per-env application-values pattern.
  • Regenerated deploy/ overlays via render.py.

Notes

  • Value is 24h, not 1d — the flag is a Go time.Duration (max unit is hours).
  • Only affects newly created clusters without an explicit timestamp; updates never recompute it.

Verification

  • render.py: argocd-values-regional-cluster.yaml renders defaultClusterExpiration: 24h for integration and stage; empty ('') elsewhere.
  • helm template renders the flag when the value is set and omits it when empty.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d8fc8c15-a525-48a3-b2f0-daa4fae8c17b

📥 Commits

Reviewing files that changed from the base of the PR and between 7fd0d3e and e8cb5f2.

📒 Files selected for processing (9)
  • config/defaults.yaml
  • config/integration/defaults.yaml
  • config/stage/defaults.yaml
  • deploy/ephemeral/us-east-1/_merged_config.yaml
  • deploy/ephemeral/us-east-1/argocd-values-regional-cluster.yaml
  • deploy/integration/us-east-1/_merged_config.yaml
  • deploy/integration/us-east-1/argocd-values-regional-cluster.yaml
  • deploy/stage/us-east-1/_merged_config.yaml
  • deploy/stage/us-east-1/argocd-values-regional-cluster.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The change adds an optional cluster_lifecycle.default_expiration setting and maps it to the regional Platform API. Helm renders --default-cluster-expiration only when the setting is configured. Integration and stage environments use 24h; ephemeral environments leave it empty.

Changes

Cluster expiration configuration

Layer / File(s) Summary
Platform API argument contract
argocd/config/regional-cluster/platform-api/templates/deployment.yaml, argocd/config/regional-cluster/platform-api/values.yaml
Defines defaultClusterExpiration and conditionally renders the --default-cluster-expiration argument.
Global configuration wiring
config/defaults.yaml
Defines cluster_lifecycle.default_expiration and maps it to the regional Platform API argument.
Environment configuration rollout
config/integration/defaults.yaml, config/stage/defaults.yaml, deploy/*/us-east-1/_merged_config.yaml, deploy/*/us-east-1/argocd-values-regional-cluster.yaml
Sets 24h expiration defaults for integration and stage, while ephemeral configuration keeps expiration disabled by default.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant EnvironmentConfig
  participant HelmConfiguration
  participant PlatformAPI
  EnvironmentConfig->>HelmConfiguration: set cluster_lifecycle.default_expiration
  HelmConfiguration->>PlatformAPI: pass --default-cluster-expiration when non-empty
  PlatformAPI->>PlatformAPI: apply the configured default expiration
Loading

Suggested reviewers: slopezz

Merge Risk: ⚪ Minimal · up to e8cb5

The expiration configuration is consistent across environments and preserves the intended optional behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: setting a 24-hour default cluster expiration in the integration and stage environments.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Enable platform-api's --default-cluster-expiration so clusters created
without an explicit spec.expirationTimestamp are auto-expired 24h after
creation in the integration and stage environments. Other environments
are unaffected (empty value = flag omitted = disabled).

- platform-api chart: render --default-cluster-expiration only when
  platformApi.app.args.defaultClusterExpiration is set (default empty)
- config: new cluster_lifecycle.default_expiration key (global default
  empty), overridden to 24h in integration and stage; wired into the
  chart via applications.regional-cluster.platformApi
- regenerate deploy/ overlays via render.py

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@typeid
typeid force-pushed the chore/default-cluster-expiration-int-stage branch from 7fd0d3e to e8cb5f2 Compare September 11, 2026 19:28
@typeid

typeid commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

/test on-demand-e2e

@cdoan1 cdoan1 changed the title chore: default 24h cluster expiration in integration and stage NO-JIRA: chore: default 24h cluster expiration in integration and stage Sep 11, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Collaborator

@typeid: This pull request explicitly references no jira issue.

Details

In response to this:

What

Enable platform-api's --default-cluster-expiration in the integration and stage environments so clusters created without an explicit spec.expirationTimestamp are automatically expired 24h after creation.

Why

Keeps non-production environments from accumulating orphaned test clusters. Callers can still override by supplying their own expirationTimestamp in the create request.

Changes

  • platform-api chart (argocd/config/regional-cluster/platform-api/): render --default-cluster-expiration only when platformApi.app.args.defaultClusterExpiration is set; default is empty (flag omitted = disabled), so all other environments are unaffected.
  • argocd-bootstrap template (config/templates/argocd-bootstrap/applicationset.yaml.j2): set defaultClusterExpiration: 24h, gated to integration and stage via the render environment.
  • Regenerated deploy/ overlays for integration and stage via render.py.

Notes

  • Value is 24h, not 1d — the flag is a Go time.Duration (max unit is hours).
  • Only affects newly created clusters without an explicit timestamp; updates never recompute it.
  • The value also surfaces in the management-cluster applicationsets (shared template block, same as the existing dynamodb* keys); it's a no-op there since platform-api runs only on the regional cluster.

Verification

  • helm template renders the flag with the value and omits it when unset.
  • render.py output for ephemeral is unchanged; only integration + stage overlays differ.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
  • Added configurable default expiration periods for clusters.
  • Integration and stage environments now apply a 24-hour default expiration.
  • Platform API deployments use the configured expiration when provided.
  • Other environments leave expiration unset unless explicitly configured.

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 openshift-eng/jira-lifecycle-plugin repository.

@cdoan1

cdoan1 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 11, 2026
@openshift-ci

openshift-ci Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdoan1

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 11, 2026
@typeid

typeid commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 11, 2026
@typeid

typeid commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 14, 2026
@openshift-ci
openshift-ci Bot merged commit fc9ddcb into openshift-online:main Sep 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants