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
Remove the dependency between create priorityclass command and genera… #94893
Remove the dependency between create priorityclass command and genera… #94893
Conversation
Hi @aubm. Thanks for your PR. I'm waiting for a kubernetes 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/test-infra repository. |
/assign soltysh |
/assign @liggitt |
/assign @zhouya0 |
/ok-to-test |
/retest |
3 similar comments
/retest |
/retest |
/retest |
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.
One nit.
/lgtm
/approve
/retest
func NewPriorityClassOptions(ioStreams genericclioptions.IOStreams) *PriorityClassOptions { | ||
return &PriorityClassOptions{ | ||
Value: 0, | ||
PreemptionPolicy: "PreemptLowerPriority", |
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 worth using corev1.PreemptLowerPriority
to ensure there's no typo.
/priority backlog |
/retest Review the full test history for this PR. Silence the bot with an |
5 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/hold |
@soltysh I'll try and take a look by the end of the week, but I find the errors logs to be quite misleading to be honest.
If I isolate the three error lines, three entries appear and don't seem to be related.
Am I reading this right? Any tips on the path for investigation. |
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.
/lgtm cancel
"github.com/spf13/cobra" | ||
|
||
apiv1 "k8s.io/api/core/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
scheduling "k8s.io/api/scheduling/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.
schedulingv1
please to keep convention 😉
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.
done 🙂
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
"k8s.io/cli-runtime/pkg/resource" | ||
schedulingclient "k8s.io/client-go/kubernetes/typed/scheduling/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.
schedulingv1client
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.
done 🙂
func (o *PriorityClassOptions) createPriorityClass() (*scheduling.PriorityClass, error) { | ||
preemptionPolicy := corev1.PreemptionPolicy(o.PreemptionPolicy) | ||
return &scheduling.PriorityClass{ | ||
ObjectMeta: metav1.ObjectMeta{ |
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.
You're missing:
// this is ok because we know exactly how we want to be serialized
TypeMeta: metav1.TypeMeta{APIVersion: scheduling.SchemeGroupVersion.String(), Kind: "PriorityClass"},
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.
done et rebased on master 🙂
createOptions.FieldManager = o.FieldManager | ||
} | ||
if o.DryRunStrategy == cmdutil.DryRunServer { | ||
if err := o.DryRunVerifier.HasSupport(priorityClass.GroupVersionKind()); err != nil { |
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 is having problems b/c you miss setting that TypeMeta
below, which ends up kubectl asking the server for support for non-existent GVK. When you add that, you'll notice that these two lines are passing
Lines 292 to 293 in 396b90f
kubectl create priorityclass test-priorityclass --dry-run=client | |
kubectl create priorityclass test-priorityclass --dry-run=server |
It's best to look through logs looking for last logs with line numbers and try to figure out which might have failed. In your case you'll notice:
core.sh:290: Successful get priorityclasses {{range.items}}{{ if eq .metadata.name \"test-priorityclass\" }}found{{end}}{{end}}:: :
so the next lines of actual code are those create lines I've pointed out earlier. Running locally both will reveal the problem is with the next and from here it's pretty easy to nail down the actual code issue ;)
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.
Great! Thank you for taking the time to walk me through it @soltysh 🙂
Next time I should be more comfortable.
dfcc441
to
9fff7f7
Compare
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.
/lgtm
/approve
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aubm, soltysh 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 |
/retest |
1 similar comment
/retest |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Pursuing the work started in #90676, by removing the generators dependency from the
kubectl create clusterrolebinding
command.Which issue(s) this PR fixes:
Partially #93100