Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chart-readme): Use correct indentation in lifecyce examples #2588

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

defrank
Copy link

@defrank defrank commented Sep 21, 2024

Proposed changes

Problem: The Helm chart example configuration for configuring lifecycle.preStop uses a misleading indentation that can confuse users.

Solution: Updated the Helm chart's README by fixing the indentation of the example code block to showcase the proper JSON paths of nginxGateway.lifecycle.preStop.exec.command and nginx.lifecycle.preStop.exec.command. The PreStop hook is described as having exec as a handler in https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution and https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/#define-poststart-and-prestop-handlers.

Testing:

Successfully deployed this chart into my cluster with the updated paths:

› kubectl -n nginx-gateway get pod -o json | jq '.items[].spec.containers[] | {name, lifecycle}'
{
  "name": "nginx-gateway",
  "lifecycle": {
    "preStop": {
      "exec": {
        "command": [
          "/usr/bin/gateway",
          "sleep",
          "--duration=30s"
        ]
      }
    }
  }
}
{
  "name": "nginx",
  "lifecycle": {
    "preStop": {
      "exec": {
        "command": [
          "/bin/sh",
          "-c",
          "/bin/sleep 30"
        ]
      }
    }
  }
}
  • make unit-test
  • make lint
  • make lint-helm
  • make generate-all
  • kubectl -n nginx-gateway exec deployment/gateway-nginx-gateway-fabric -c nginx -- nginx -T

make unit-test looks like everything passed except this single failure at the end:

PASS
coverage: 57.7% of statements
composite coverage: 93.6% of statements

Ginkgo ran 27 suites in 56.33843625s

There were failures detected in the following suites:
  static ./internal/mode/static

Test Suite Failed
exit status 1
gmake: *** [Makefile:196: unit-test] Error 1

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

NONE

@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation helm-chart Relates to helm chart labels Sep 21, 2024
@defrank defrank force-pushed the fix/chart-lifecycle-value-examples branch from f89105d to bda9581 Compare September 21, 2024 19:33
Copy link
Contributor

github-actions bot commented Sep 21, 2024

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@defrank
Copy link
Author

defrank commented Sep 21, 2024

I have hereby read the F5 CLA and agree to its terms

@defrank defrank marked this pull request as ready for review September 21, 2024 20:18
@defrank defrank requested a review from a team as a code owner September 21, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation helm-chart Relates to helm chart
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

1 participant