Skip to content

OCPBUGS-99649: Reinstall tzdata if /usr/share/zoneinfo is missing#246

Merged
sdodson merged 1 commit into
openshift:masterfrom
sdodson:tzdata-check-OCPBUGS-99649
Jul 25, 2026
Merged

OCPBUGS-99649: Reinstall tzdata if /usr/share/zoneinfo is missing#246
sdodson merged 1 commit into
openshift:masterfrom
sdodson:tzdata-check-OCPBUGS-99649

Conversation

@sdodson

@sdodson sdodson commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • In base/Dockerfile, base/Dockerfile.rhel, and base/Dockerfile.rhel9, check for /usr/share/zoneinfo after package install and reinstall tzdata if it's absent, falling back to a plain install if reinstall fails (e.g. microdnf's stricter reinstall semantics, or tzdata missing from the rpm db entirely).
  • ubi8-minimal and ubi9-minimal keep the tzdata package installed but strip /usr/share/zoneinfo from the image to save space. This detects that condition and reinstalls tzdata to restore it.

Note: RHEL10 minimal images do not ship tzdata by design, so this check should not be extended to re-add it there. Assuming anyone who has already moved to RHEL10 has tested successfully without it.

Test plan

  • Build each base image and confirm /usr/share/zoneinfo is present
  • Confirm no-op path (directory already present) adds no extra work

Fixes OCPBUGS-99649

Summary by CodeRabbit

  • New Features
    • Added post-quantum cryptography policy support to RHEL 9-based images (enabled on non-CentOS builds).
  • Bug Fixes
    • Improved timezone handling during container builds by automatically restoring or installing missing timezone data, ensuring /usr/share/zoneinfo is available.
    • Applied the same timezone data safeguards across the base, RHEL, and RHEL 9 image variants.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jul 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@sdodson: This pull request references Jira Issue OCPBUGS-99649, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • In base/Dockerfile, base/Dockerfile.rhel, and base/Dockerfile.rhel9, check for /usr/share/zoneinfo after package install and reinstall tzdata if it's absent, falling back to a plain install if reinstall fails (e.g. microdnf's stricter reinstall semantics, or tzdata missing from the rpm db entirely).

Test plan

  • Build each base image and confirm /usr/share/zoneinfo is present
  • Confirm no-op path (directory already present) adds no extra work

Fixes OCPBUGS-99649

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.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: dd12b5c8-81e4-4f90-8c28-5624da775636

📥 Commits

Reviewing files that changed from the base of the PR and between e7a7870 and 906fa34.

📒 Files selected for processing (3)
  • base/Dockerfile
  • base/Dockerfile.rhel
  • base/Dockerfile.rhel9

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting


Walkthrough

The base, RHEL, and RHEL9 Dockerfiles conditionally ensure timezone data is installed. The RHEL9 Dockerfile also adds a builder stage that configures DEFAULT:PQ crypto-policies and copies the generated configuration into the final image.

Changes

Base image updates

Layer / File(s) Summary
RHEL9 crypto-policy builder
base/Dockerfile.rhel9
Adds a builder stage that installs crypto-policies-scripts, sets DEFAULT:PQ for applicable builds, and copies /etc/crypto-policies/ into the final RHEL9 image.
Timezone data provisioning
base/Dockerfile, base/Dockerfile.rhel, base/Dockerfile.rhel9
Adds conditional tzdata reinstallation or installation when /usr/share/zoneinfo is missing.

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

Sequence Diagram(s)

sequenceDiagram
  participant RHEL9Builder
  participant UpdateCryptoPolicies
  participant FinalRHEL9Image
  RHEL9Builder->>UpdateCryptoPolicies: Apply DEFAULT:PQ policy on non-CentOS builds
  UpdateCryptoPolicies-->>RHEL9Builder: Generate crypto-policy configuration
  RHEL9Builder->>FinalRHEL9Image: Copy /etc/crypto-policies/
Loading

Suggested reviewers: csrwng, jupierce

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Stable And Deterministic Test Names ✅ Passed Only Dockerfiles changed; no Ginkgo test titles or specs were added or modified.
Test Structure And Quality ✅ Passed PR only changes Dockerfiles; no Ginkgo tests or test fixtures were added or modified, so this review is not applicable.
Microshift Test Compatibility ✅ Passed HEAD only changes three Dockerfiles; no Go/e2e test files or Ginkgo declarations were added, so MicroShift compatibility isn’t impacted.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only Dockerfiles were changed; no new Ginkgo/e2e tests were added, so SNO compatibility review is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only Dockerfiles changed; no manifests, controllers, replicas, affinity, nodeSelectors, or PDBs were modified, so no topology-sensitive scheduling risk.
Ote Binary Stdout Contract ✅ Passed Only Dockerfiles changed; no process-level code or stdout writes were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests were added; the PR only changes three Dockerfiles, so IPv4/disconnected-network test compatibility is not implicated.
No-Weak-Crypto ✅ Passed The diff only adds tzdata checks; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto code was introduced.
Container-Privileges ✅ Passed PR only touches three Dockerfiles to add tzdata checks; no container/K8s manifest changes or privilege fields were introduced.
No-Sensitive-Data-In-Logs ✅ Passed Touched Dockerfiles only add tzdata repair/config-append commands; no logging or secret/PII-bearing literals are present.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: reinstalling tzdata when /usr/share/zoneinfo is missing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from csrwng and jupierce July 23, 2026 21:08
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sdodson

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 Jul 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@sdodson: This pull request references Jira Issue OCPBUGS-99649, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Summary

  • In base/Dockerfile, base/Dockerfile.rhel, and base/Dockerfile.rhel9, check for /usr/share/zoneinfo after package install and reinstall tzdata if it's absent, falling back to a plain install if reinstall fails (e.g. microdnf's stricter reinstall semantics, or tzdata missing from the rpm db entirely).

Test plan

  • Build each base image and confirm /usr/share/zoneinfo is present
  • Confirm no-op path (directory already present) adds no extra work

Fixes OCPBUGS-99649

Summary by CodeRabbit

  • New Features

  • Added post-quantum cryptography policy support to RHEL 9-based images.

  • Improved timezone data availability across supported container images.

  • Bug Fixes

  • Container builds now restore or install missing timezone data automatically.

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.

@sdodson
sdodson force-pushed the tzdata-check-OCPBUGS-99649 branch 2 times, most recently from 25a070b to e6f71a8 Compare July 23, 2026 21:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@base/Dockerfile`:
- Line 17: Add a Dockerfile HEALTHCHECK for the final image, using an
appropriate command that verifies the container’s primary service is healthy and
returns a failure status when it is not. Place it with the final image
configuration alongside the existing runtime instructions.
- Line 17: Convert base/Dockerfile lines 17-17 and base/Dockerfile.rhel lines
20-20 to multi-stage builds with distinct builder and final stages. Install and
use build tooling only in the builder stages, then copy only the required
runtime artifacts into the final images so no build tools remain.

In `@base/Dockerfile.rhel9`:
- Around line 9-12: Add a HEALTHCHECK instruction to the final image definition
in Dockerfile.rhel9, after the base image and configuration copy setup, using a
command that verifies the container's primary service is responsive and returns
a nonzero status when unhealthy.
- Around line 9-12: Set an explicit non-root USER after privileged setup in
base/Dockerfile.rhel9 (lines 9-12), and add a non-root USER to the final image
in base/Dockerfile (line 17) and base/Dockerfile.rhel (line 20); ensure all
three images never run as root.
- Around line 9-12: Define the required HEALTHCHECK in each final image: add it
to base/Dockerfile.rhel9 near the final image setup, and add the equivalent
required health check to base/Dockerfile and base/Dockerfile.rhel at the
specified sites. Use a consistent valid health-check command across all three
Dockerfiles.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b628f943-569d-4a97-9113-41cca0d2fe7e

📥 Commits

Reviewing files that changed from the base of the PR and between e7a7870 and fba8b4e.

📒 Files selected for processing (3)
  • base/Dockerfile
  • base/Dockerfile.rhel
  • base/Dockerfile.rhel9

Comment thread base/Dockerfile
Comment thread base/Dockerfile.rhel9 Outdated
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 23, 2026
ubi8-minimal and ubi9-minimal keep the tzdata package installed but
strip /usr/share/zoneinfo from the image to save space. Detect that
and reinstall tzdata to restore it.

Note: RHEL10 minimal images do not ship tzdata by design, so this
check should not be extended to re-add it there. Assuming anyone
who has already moved to RHEL10 has tested successfully without it.

OCPBUGS-99649
@sdodson
sdodson force-pushed the tzdata-check-OCPBUGS-99649 branch from e6f71a8 to 906fa34 Compare July 23, 2026 21:19
@sdodson

sdodson commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai please update the walkthrough as commits were removed

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

@sdodson Updated the walkthrough request to reflect the current PR state after the removed commits.

✅ Action performed

Summary regeneration triggered.

@sdodson

sdodson commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai your summary and walk through are still out of sync with the current commits in this PR.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

@sdodson Apologies—the previous regeneration did not reflect the current PR head. I’ve requested a fresh walkthrough and summary based on the current commits only.

✅ Action performed

Summary regeneration triggered.

@sdodson

sdodson commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

/retest-required

@sdodson

sdodson commented Jul 25, 2026

Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-aws-upgrade

@openshift-ci

openshift-ci Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@sdodson: Overrode contexts on behalf of sdodson: ci/prow/e2e-aws-upgrade

Details

In response to this:

/override ci/prow/e2e-aws-upgrade

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.

@openshift-ci

openshift-ci Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@sdodson: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@sdodson
sdodson merged commit 13118bf into openshift:master Jul 25, 2026
8 of 9 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@sdodson: Jira Issue OCPBUGS-99649: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-99649 has been moved to the MODIFIED state.

Details

In response to this:

Summary

  • In base/Dockerfile, base/Dockerfile.rhel, and base/Dockerfile.rhel9, check for /usr/share/zoneinfo after package install and reinstall tzdata if it's absent, falling back to a plain install if reinstall fails (e.g. microdnf's stricter reinstall semantics, or tzdata missing from the rpm db entirely).
  • ubi8-minimal and ubi9-minimal keep the tzdata package installed but strip /usr/share/zoneinfo from the image to save space. This detects that condition and reinstalls tzdata to restore it.

Note: RHEL10 minimal images do not ship tzdata by design, so this check should not be extended to re-add it there. Assuming anyone who has already moved to RHEL10 has tested successfully without it.

Test plan

  • Build each base image and confirm /usr/share/zoneinfo is present
  • Confirm no-op path (directory already present) adds no extra work

Fixes OCPBUGS-99649

Summary by CodeRabbit

  • New Features
  • Added post-quantum cryptography policy support to RHEL 9-based images (enabled on non-CentOS builds).
  • Bug Fixes
  • Improved timezone handling during container builds by automatically restoring or installing missing timezone data, ensuring /usr/share/zoneinfo is available.
  • Applied the same timezone data safeguards across the base, RHEL, and RHEL 9 image variants.

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.

@sdodson

sdodson commented Jul 25, 2026

Copy link
Copy Markdown
Member Author

Moving forward with this change unilaterally, need to be able to measure this success by Monday. Or more importantly prove that it didn't negatively impact anything or break the build.

@sdodson

sdodson commented Jul 25, 2026

Copy link
Copy Markdown
Member Author

/cherry-pick release-4.22 release-4.21 release-4.20

@openshift-cherrypick-robot

Copy link
Copy Markdown

@sdodson: new pull request created: #247

Details

In response to this:

/cherry-pick release-4.22 release-4.21 release-4.20

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.

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-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants