-
Notifications
You must be signed in to change notification settings - Fork 104
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
OCPBUGS-29934: Add support to inject owner-ref argument to render command #960
OCPBUGS-29934: Add support to inject owner-ref argument to render command #960
Conversation
edc4976
to
3b6ebd1
Compare
this works, but IMO it should work the other way around: the owner-ref should be on by default, and opted-out only in the few (currently, exactly one and only) cases which don't need it |
hack/render-sync.sh
Outdated
rendersync manual-cluster/performance base/performance default label-name |
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 mixing directories and ownership reference arguments is confusing a bit. The traditional unix way would be something like:
rendersync --owner-ref label-name -- manual-cluster/performance base/performance default
In other words, extra arguments followed by -- separator and then the rendering arguments.
The code to implement this is a bit more complicated than what you have here, but I believe it would make the code less error prone.
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 be the best option indeed. I was about to settle for a little less, but if we can get this far that would be great.
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.
The only thing that bothers me with this approach is that we basically implement render
command line again but in the lesser convenient way which is using bash for parsing the arguments.
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.
Maybe we can enhance render command to read its configuration from yaml file something like:
config:
- inputDir: "foo"
outputDir: "bar"
ownerRef: none
- inputDir: "foo2"
outputDir: "bar2"
ownerRef: k8s
- inputDir: "foo2"
outputDir: "bar2"
// use default owner-ref
This way we can list all the different rendering configuration in a single file, parsing it as part of the code and avoid error-prone shell scripting
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 would be fine with a stopgap solution (but with the defaults swapped per my comment above) to unblock this work and with a cleaner design later while we figure out the best tradeoff
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 implement my proposal like this. Just below line 7 include
EXTRA_ARGS=()
if [[ "$1" =~ ^-.* ]]; then
while [[ "x$1" != "x--" ]]; do
EXTRA_ARGS+=("$1")
shift
done
shift
fi
And then in the execution of render use "${EXTRA_ARGS[@]}"
We should make the right value the default one in the render command so we do not have to use this method too often.
We need this change because we want to use also non default values for the owner-ref like the value none.
3b6ebd1
to
b4d7df3
Compare
/retest-required |
LGTM |
There was a test which was failing and exposed the issue. if the test will pass then it mean we're out of the woods |
/approve per #960 (comment) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ffromani, rbaturov 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 |
/label acknowledge-critical-fixes-only |
this PR won't affect the payload |
/retitle NO-JIRA: Add support to inject owner-ref argument to render command |
@rbaturov: This pull request explicitly references no jira issue. In response to this:
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. |
/retest-required |
@rbaturov: all tests passed! Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
[ART PR BUILD NOTIFIER] This PR has been included in build cluster-node-tuning-operator-container-v4.16.0-202402210139.p0.g631e03c.assembly.stream.el9 for distgit cluster-node-tuning-operator. |
/cherry-pick release-4.15 |
@rbaturov: new pull request created: #966 In response to this:
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/test-infra repository. |
@rbaturov: Jira Issue OCPBUGS-29934: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-29934 has been moved to the MODIFIED state. In response to this:
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. |
/cherry-pick release-4.14 |
@rbaturov: #960 failed to apply on top of branch "release-4.14":
In response to this:
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/test-infra repository. |
…ner reference ehnancements (#989) * NO-JIRA: perfprof: render: make ownerReference optional (#907) * perfprof: render: make ownerReference optional When we set OwnerReference for dependant object, we must use the object UID the apiserver set. Apiserver owns this field (obviously) so setting it when missing, like the code did in the past, is wrong and will cause conflicts on updates. I the pre-render flow we can't wait for the apiserver to set a UID, so the only possible option is to not set any OwnerReference at all. Signed-off-by: Francesco Romani <fromani@redhat.com> * perfprof: render: add weak owner reference support There are cases on which we can't use the real owner reference in the render flow, because: - we don't own the performanceprofile uid - we can't wait to learn back the apiserver-decided uid because we need to render all the manifest at once. so, to group objects together and enable to safely and easily rebuild the ownerReference graph later, we add an annotation which serves as weaker owner reference, using the profile name and adding it to all the related objects. Note this form of weak reference is meant to serve to a placeholder for the real ownerReference which should be added by the relevant controller later on, when the cluster is started and is running. Signed-off-by: Francesco Romani <fromani@redhat.com> --------- Signed-off-by: Francesco Romani <fromani@redhat.com> (cherry picked from commit 0e31943) (cherry picked from commit 5308f47) * release-4.14: render: align expected machineconfig the backported expected machineconfig output was including the changes in 4.15, we need to update with the 4.14-specific content, excluding unrelated changes. Signed-off-by: Francesco Romani <fromani@redhat.com> * render: perfprofile: don't annotate perfprof (#951) don't add weak ref to the perfprof and don't write back an updated version in output. Signed-off-by: Francesco Romani <fromani@redhat.com> (cherry picked from commit fd8ea4e) (cherry picked from commit 34926bd) * e2e: testdata: remove the annotated profile after #951 merged, we don't need these anymore Signed-off-by: Francesco Romani <fromani@redhat.com> (cherry picked from commit 0d157b5) * CNF-11145: Enhance render sync to include bootstrap rendering tests (#932) * Enhance render sync to include bootstrap rendering tests * make render-sync (cherry picked from commit e225a86) * Add support to inject owner-ref argument to render command (#960) We need this change because we want to use also non default values for the owner-ref like the value none. (cherry picked from commit 631e03c) * release-4.14: hack: branch-specific updates remove lines not relevant for this branch Signed-off-by: Francesco Romani <fromani@redhat.com> --------- Signed-off-by: Francesco Romani <fromani@redhat.com> Co-authored-by: Martin Sivák <msivak@redhat.com> Co-authored-by: Ronny Baturov <rbaturov@redhat.com>
We need this change because we also want to use also non default values for the owner-ref like the value none.
The work on this PR depends on these modifications to be merged.