-
Notifications
You must be signed in to change notification settings - Fork 34
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
Introduce new component config flag #325
base: main
Are you sure you want to change the base?
Conversation
Welcome @ardaguclu! |
Hi @ardaguclu. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
This PR is mostly inspired by kubernetes-sigs/jobset#609 and nearly all credit should still go to @rainfd :) |
/ok-to-test |
func validateInternalCertManagement(c *configapi.Configuration) field.ErrorList { | ||
var allErrs field.ErrorList | ||
if c.InternalCertManagement == nil || !ptr.Deref(c.InternalCertManagement.Enable, false) { | ||
return allErrs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would return a nil error.
Maybe you should add an error message here that if certManagement is enabled we need the internalCertManager filed out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for review @kannon92.
I'm not sure I fully understand, If internal certificate management is disabled, shouldn't we return nil?. As far as I understand from the code block, if internal cert management is nil or false, we don't need to pursue further validation for the other fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea that is true. Maybe we just return nil there to make it clear we don’t expect an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as is. I was thinking we could validate if the settings are set if it’s enabled false so we bring awareness that they don’t be used
The e2e tests are failing due to some oddities with the docker file. https://github.com/kubernetes-sigs/lws/blob/main/Dockerfile#L19 I think you need to add config to the dockerfile. |
@ahg-g is there a reason why we copy all the folders inside |
/label tide/merge-method-squash |
I think this comes from the default template for kubebuilder. |
Could you update manager to use component config as default for kustomize and helm? https://github.com/kubernetes-sigs/lws/blob/main/config/manager/manager.yaml see https://github.com/kubernetes-sigs/jobset/pull/724/files for an example |
@kannon92 I believe that I've successfully updated the required configurations for this. |
LGTM /assign @ahg-g @kerthcet @Edwinhr716 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ardaguclu This is great, generally LGTM.
Can we have one more test to cover that: the flags will overwrite the config file? And left another comment about Remove the flags in the future.
kubeConfig.QPS = float32(qps) | ||
kubeConfig.Burst = burst | ||
|
||
kubeConfig.QPS = *cfg.ClientConnection.QPS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the flags then since we have configuration files. We can mark them as deprecated in the follow up and remove them finally. And no need to handle the fallback here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you about the deprecation of the flags and can be done in a followup PR.
7a1249e
to
39cc492
Compare
/retest |
/test pull-lws-test-integration-main |
@kerthcet thank you for review. I've added unit tests based on your suggestions. |
@@ -116,6 +143,10 @@ func main() { | |||
c.NextProtos = []string{"http/1.1"} | |||
} | |||
|
|||
if !flagsSet["metrics-bind-address"] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move this logic to the apply
function as well, right, to make that function more pure. But it's ok to defer this with the deprecation PR together, this one is good enough to me. Feel free to unhold the PR.
/lgtm
/approve
/hold
Thanks @ardaguclu also cc @ahg-g especially about the deprecation decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for review. I'll give one day for lazy consensus and unhold the PR.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu, kerthcet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -0,0 +1,54 @@ | |||
--- | |||
apiVersion: apiextensions.k8s.io/v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kerthcet Component config is not a CRD (not an object api), do we really need this definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not stored in API server. You are right, we can remove this.
What type of PR is this?
/kind feature
What this PR does / why we need it
This PR adds configuration file and flag to customize the functionality via new config file resource which is already supported by Kueue and JobSet.
Which issue(s) this PR fixes
Fixes #170, #322
Does this PR introduce a user-facing change?