chore: Validate artifact drivers on server start. re #10219#36
Conversation
|
@Joibel - let me know when the base |
|
Rebase is done |
b7a017a to
772114c
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds validation for artifact drivers during server startup to ensure they are properly configured and accessible. The validation checks that artifact driver images are present in the server pod and that connections to the drivers can be established.
- Adds image validation to verify artifact driver images are included in the server deployment
- Adds connection validation to test artifact driver accessibility during startup
- Includes a new utility function to get the hostname from environment variables
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| util/env/env.go | Adds GetHostname utility function to retrieve HOSTNAME environment variable |
| util/env/env_test.go | Updates test assertions from assert to require and adds tests for GetHostname function |
| server/apiserver/argoserver.go | Implements artifact driver validation logic with image and connection checks |
| server/apiserver/argoserver_test.go | Adds comprehensive test coverage for artifact driver image validation |
| } | ||
|
|
||
| if len(images) > 0 { | ||
| errorMsg := fmt.Sprintf("Artifact driver validation failed: The following artifact driver images are not present in the server pod: %v. Please ensure all artifact driver images are included in the argo-server pod.", images) |
There was a problem hiding this comment.
The error message mentions 'server pod' but should be more specific about checking the deployment, since the validation logic in the test suggests it should check the deployment template rather than just the current pod.
| errorMsg := fmt.Sprintf("Artifact driver validation failed: The following artifact driver images are not present in the server pod: %v. Please ensure all artifact driver images are included in the argo-server pod.", images) | |
| errorMsg := fmt.Sprintf("Artifact driver validation failed: The following artifact driver images are not present in the current pod: %v. Please ensure all artifact driver images are included in the deployment template for the argo-server.", images) |
server/apiserver/argoserver.go
Outdated
| defer wg.Done() | ||
|
|
||
| // Create a new driver connection | ||
| pluginDriver, err := plugin.NewDriver(ctx, driver.Name, driver.Name.SocketPath(), 5) // 5 second timeout |
There was a problem hiding this comment.
This '5' is a configuration element from the yaml: driver.ConnectionTimeoutSeconds so use that please
There was a problem hiding this comment.
Do you want me to add it as a field on the ArtifactDriver type? I don't see it currently or anywhere else on the configmap? https://github.com/pipekit/argo-workflows/blob/artifact-plugins/config/config.go#L127
There was a problem hiding this comment.
Ah, yes. We should move it to where you've suggested from
I think.Does that make more sense, I think it does.
There was a problem hiding this comment.
It would let you specify a timeout for each grpc server, which might be useful but also might be lots of config. Maybe default to 5 if not set?
Joibel
left a comment
There was a problem hiding this comment.
I feel like this is missing a change to workflow_types.go or something - generated.pb.go has changed but that's a generated file. The file from which it is generated should be included too.
Missing a change with respect to the default branch that I should rebase on top of or missing a change that I should implement? |
bf04d54 to
a8217b1
Compare
|
@Joibel - I think I've updated. Can you confirm? |
|
Some of these changes are some strays that got brought in from the master branch. If we rebase artifact-plugins on top of master, it'll fix the non-related additions |
9e6b415 to
0344a8f
Compare
a8217b1 to
0a1a897
Compare
Signed-off-by: Alan Clucas <alan@clucas.org>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com> test connections Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com> refactor get images Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
0a1a897 to
0387c96
Compare
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
|
@Joibel if it's a one line change, feel free to just push a commit, approve, and merge for the sake of time |
Signed-off-by: J.P. Zivalich <j.p.zivalich@gmail.com>
Fixes argoproj#10219
Please do not open a pull request until you have checked ALL of these:
make pre-commit -Bto fix codegen and lint problems.If changes were requested, and you've made them, dismiss the review to get it reviewed again.