feat: Support startupProbe in pod policy#841
Open
freeznet wants to merge 1 commit into
Open
Conversation
|
@freeznet:Thanks for your contribution. For this PR, do we need to update docs? |
There was a problem hiding this comment.
Pull request overview
This PR adds startupProbe support to the Function Mesh PodPolicy API so users can configure startup probes on Function/Sink/Source workload containers, and ensures the generated CRD schemas include the new field.
Changes:
- Added
startupProbetov1alpha1.PodPolicyand propagated it into generated workload containers (and excluded it from cleanup jobs). - Updated StatefulSet patch/compare logic to account for
StartupProbewhen applying backend config pod policies. - Regenerated/updated CRD schemas and added a unit test covering Function/Sink/Source startup probe behavior.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| manifests/crd.yaml | Adds startupProbe schema into the rendered install CRD manifest. |
| controllers/spec/source.go | Sets StartupProbe on Source container and clears it for Source cleanup job. |
| controllers/spec/sink.go | Sets StartupProbe on Sink container and clears it for Sink cleanup job. |
| controllers/spec/function.go | Sets StartupProbe on Function container and clears it for Function cleanup job. |
| controllers/spec/function_test.go | Adds a unit test asserting startup probe propagation + cleanup job exclusion. |
| controllers/spec/common.go | Applies startup probe from PodPolicy during StatefulSet patching and compares it for equality checks. |
| config/crd/bases/compute.functionmesh.io_sources.yaml | Adds startupProbe to Source CRD schema (but also changes controller-gen version annotation). |
| config/crd/bases/compute.functionmesh.io_sinks.yaml | Adds startupProbe to Sink CRD schema (but also changes controller-gen version annotation). |
| config/crd/bases/compute.functionmesh.io_functions.yaml | Adds startupProbe to Function CRD schema (but also changes controller-gen version annotation). |
| config/crd/bases/compute.functionmesh.io_functionmeshes.yaml | Adds startupProbe to FunctionMesh CRD schema (but also changes controller-gen version annotation). |
| config/crd/bases/compute.functionmesh.io_backendconfigs.yaml | Adds startupProbe to BackendConfig CRD schema (but also changes controller-gen version annotation). |
| charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sources.yaml | Updates Helm CRD template to include startupProbe (but also changes controller-gen version annotation). |
| charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sinks.yaml | Updates Helm CRD template to include startupProbe (but also changes controller-gen version annotation). |
| charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functions.yaml | Updates Helm CRD template to include startupProbe (but also changes controller-gen version annotation). |
| charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functionmeshes.yaml | Updates Helm CRD template to include startupProbe (but also changes controller-gen version annotation). |
| charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-backendconfigs.yaml | Updates Helm CRD template to include startupProbe (but also changes controller-gen version annotation). |
| api/compute/v1alpha1/zz_generated.deepcopy.go | Updates generated deepcopy logic to include PodPolicy.StartupProbe. |
| api/compute/v1alpha1/common.go | Adds StartupProbe field to PodPolicy API type. |
Files not reviewed (1)
- api/compute/v1alpha1/zz_generated.deepcopy.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| {{- include "function-mesh-operator.certManager.annotation" . | nindent 4 -}} | ||
| {{- end }} | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| {{- include "function-mesh-operator.certManager.annotation" . | nindent 4 -}} | ||
| {{- end }} | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
| {{- include "function-mesh-operator.certManager.annotation" . | nindent 4 -}} | ||
| {{- end }} | ||
| controller-gen.kubebuilder.io/version: v0.16.5 | ||
| controller-gen.kubebuilder.io/version: v0.15.0 |
|
|
||
| Liveness *Liveness `json:"liveness,omitempty"` | ||
|
|
||
| // StartupProbe specifies the startup probe for the main function container. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)