-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: instanceID support for argo server. Closes #2004 #2365
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2365 +/- ##
=========================================
Coverage ? 13.26%
=========================================
Files ? 71
Lines ? 25230
Branches ? 0
=========================================
Hits ? 3346
Misses ? 21450
Partials ? 434
Continue to review full report at Codecov.
|
if err != nil { | ||
return nil, err | ||
} | ||
return &cronworkflowpkg.CronWorkflowDeletedResponse{}, nil | ||
} | ||
|
||
func (c *cronWorkflowServiceServer) withInstanceID(opt metav1.ListOptions) metav1.ListOptions { | ||
if c.mode == KubeClientMode { |
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.
should also work for kube client - should not need the guard condition
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 needed.
The expected behaviors for workflow list
on GRPC server
and kube-client
are different.
-
On
GRPC server
, we expect it to list the workflows either noinstanceID
(instanceID == "") orinstanceID
is the same (intanceID != ""). -
When it's
kube-client
, we wantargo list
to list all the workflows without any instanceID relatedlabelSelector
, without this we can not achieve that.
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'm not sure about this. As much as possible, both clients should work in the same manner.
This would mean that the GRPC server should be the same as the kube-client.
Can you merge the labels together?
I think you're doing great work btw.
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.
argo server client
works the same as GRPC server
, but I don't think kube-client
does.
A simple question, what is expected behavior for kube-client
if there are multiple workflow controllers with different instanceid
installed in one cluster? As a kube-client
, you can not be the same as any of the argo servers, instead of being limited to a subset of the objects (intanceid
lableselector), by default you should have the ability to see whatever you want to see.
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.
No, I don't think we want that. The kube-client is legacy code really, so we should not make extra effort to maintain any esoteric features. If you need to make a choice here, can you do whatever is simpler. I can even accept breaking changes to the kube-client.
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.
If this is the case, let's pick up the legacy client code, if later on we decide not to support it any more, we can easily dump it.
@alexec - could you review it again? |
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 stuff!
Closes #2004
Make Argo server behaves the same as workflow controller:
Argo server only manages the workflows/CronWorkflows with the same
instanceID
(labelxxxx/controller-instanceid
), or wfs/cronWfs withoutinstanceID
, depends on ifinstanceID
is configured in the ConfigMap.argo
cli withoutARGO_SERVER
ENV goes through kube api,argo list
orargo cron list
can see all the results.argo submit
orargo cron create
needs to give--instanceid=xxxx
to create wf/cronWf targeting a specific controller.argo
cli withARGO_SERVER
ENV uses argo server, results ofargo list
andargo cron list
might be different, depends oninstanceID
configuration in the ConfigMap. As a result,argo submit
orargo cron create
by default will include theinstanceID
in the labels if it's configured in the ConfigMap.Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.