Skip to content

Conversation

@FabianHardt
Copy link
Contributor

@FabianHardt FabianHardt commented Dec 11, 2025

Makes Q10 in CKAD 001 clearer for students


🧾 What this PR does

It's not clear, that MYSQL needs additional ENV vars, until you start the container.
Now it should be clearer.
This fix also fixes issue #43


🧩 Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Other (please describe): ____________

🧪 How to test it

Run the updated lab CKAD 001, Question 10. The pod should start correctly and MYSQL should be up and running.


✅ Acceptance Criteria

  • Pod starts without errors

  • Docker Compose logs are available

  • All relevant tests pass

  • Documentation is updated (if needed - usually it is)

  • New labs pass

  • Answers work as expected


📎 Related Issue(s)

Closes #43


💬 Notes for Reviewers


🧠 Additional Context


📄 Attachments

Summary by CodeRabbit

  • Updates
    • CKAD exam Question 10: MySQL image updated to mysql:9.5.0.
    • Secret schema expanded to include a new random=true field alongside username and password.
    • Pod environment mappings updated to expose MYSQL_RANDOM_ROOT_PASSWORD in addition to DB_USER and DB_PASSWORD.
    • Validation steps enhanced to verify the new secret field and the corresponding environment variable configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Walkthrough

Updated CKAD question 10: MySQL image changed to mysql:9.5.0, the secret now includes random=true, and validation scripts and question text were updated to require and verify the new secret key and the corresponding Pod environment variable MYSQL_RANDOM_ROOT_PASSWORD.

Changes

Cohort / File(s) Summary
Question 10 Assessment & Answers
facilitator/assets/exams/ckad/001/answers.md, facilitator/assets/exams/ckad/001/assessment.json
Question text updated to request three secret values (username=admin, random=true, password=securepass); MySQL image changed to mysql:9.5.0; env vars updated to include MYSQL_RANDOM_ROOT_PASSWORD; verification steps adjusted to validate the expanded secret and pod env mapping.
Secret Validation Script
facilitator/assets/exams/ckad/001/scripts/validation/q10_s1_validate_secret.sh
Added extraction and check for the random key from the db-credentials secret; success condition now requires random == "true" alongside username/password checks; error messages updated.
Pod Environment Variable Validation Script
facilitator/assets/exams/ckad/001/scripts/validation/q10_s3_validate_pod_env_vars.sh
Added extraction and validation for MYSQL_RANDOM_ROOT_PASSWORD environment variable; verifies it references the expected secret and key (random) in addition to existing DB_USER/DB_PASSWORD checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Files are limited to a single question and its validation scripts with consistent, small changes.
  • Review attention:
    • Confirm mysql:9.5.0 is multi-arch (ARM/x86) and available.
    • Ensure validation scripts correctly parse secret key names and pod env var references (MYSQL_RANDOM_ROOT_PASSWORDrandom).

"I hop through fields of YAML bright,
A secret tucked, three keys in sight,
Nine-point-five hums, ARM takes flight,
Validators nod — all snug tonight 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix q10, make it clearer for students' is vague and generic, using non-descriptive language that doesn't clearly convey the specific change (updating MySQL image for ARM compatibility and adding environment variables). Consider using a more specific title like 'Update CKAD Q10 to use multi-architecture MySQL image (9.5.0) and add MYSQL_RANDOM_ROOT_PASSWORD' to better communicate the primary changes.
Out of Scope Changes check ❓ Inconclusive Changes include adding MYSQL_RANDOM_ROOT_PASSWORD and 'random' secret field beyond the core ARM compatibility fix, which may expand scope but appear reasonable for improved clarity. Clarify whether the additional random parameter and MYSQL_RANDOM_ROOT_PASSWORD are essential for the ARM fix or represent separate enhancements that should be tracked separately.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses issue #43 by replacing mysql:5.7 with mysql:9.5.0, which is multi-architecture compatible, enabling the pod to run on ARM devices like Apple M2.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e644990 and 70c1a5e.

📒 Files selected for processing (1)
  • facilitator/assets/exams/ckad/001/answers.md (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • facilitator/assets/exams/ckad/001/answers.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
facilitator/assets/exams/ckad/001/answers.md (1)

252-292: Critical: Pod image version does not match question description.

The question text (line 252) specifies mysql:9.5.0, but the pod YAML template (line 269) uses mysql:latest. This directly contradicts the PR's intent to upgrade MySQL to version 9.5.0 specifically to resolve ARM architecture compatibility. Students following this answer will not implement the fix correctly.

   containers:
   - name: mysql
-    image: mysql:latest
+    image: mysql:9.5.0
     env:
🧹 Nitpick comments (1)
facilitator/assets/exams/ckad/001/scripts/validation/q10_s3_validate_pod_env_vars.sh (1)

31-35: Error message omits the newly-validated environment variable.

The validation for MYSQL_RANDOM_ROOT_PASSWORD (line 28) is checked but not reported in the error message (lines 31-35). For debugging clarity when validation fails, the error output should include all three environment variables.

 else
     echo "❌ Error: Pod '$POD_NAME' does not have the correct secret configuration"
     echo "DB_USER -> Secret: $DB_USER_SECRET, Key: $DB_USER_KEY"
     echo "DB_PASSWORD -> Secret: $DB_PASSWORD_SECRET, Key: $DB_PASSWORD_KEY"
+    echo "MYSQL_RANDOM_ROOT_PASSWORD -> Secret: $MYSQL_RANDOM_ROOT_PASSWORD_SECRET, Key: $MYSQL_RANDOM_ROOT_PASSWORD_KEY"
     exit 1
 fi
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb2bc9a and e644990.

📒 Files selected for processing (4)
  • facilitator/assets/exams/ckad/001/answers.md (2 hunks)
  • facilitator/assets/exams/ckad/001/assessment.json (1 hunks)
  • facilitator/assets/exams/ckad/001/scripts/validation/q10_s1_validate_secret.sh (1 hunks)
  • facilitator/assets/exams/ckad/001/scripts/validation/q10_s3_validate_pod_env_vars.sh (2 hunks)
🔇 Additional comments (2)
facilitator/assets/exams/ckad/001/scripts/validation/q10_s1_validate_secret.sh (1)

6-8: New random field validation is correctly integrated.

The addition of the random secret field is properly extracted (line 6) and validated (line 8) following the same pattern as the existing username and password fields. The error messages (lines 13-14) appropriately reflect all three expected values.

facilitator/assets/exams/ckad/001/assessment.json (1)

273-301: Question definition and verification structure is well-organized.

The assessment question text (line 277) correctly specifies mysql:9.5.0 and all three secret values. The verification section (lines 279-301) logically sequences the three validation steps with appropriate weightages (2, 1, 2) that prioritize secret creation and environment variable validation.

However, note that this assessment definition will validate against the correct image (9.5.0) while the provided answers.md uses mysql:latest, creating a mismatch students will encounter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] CKAD Question 10: Image not available for ARM architecture

1 participant