-
Notifications
You must be signed in to change notification settings - Fork 225
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
Reopen "get k8s config from requestConfig. and added test." #1692
base: master
Are you sure you want to change the base?
Conversation
IIUC, this PR will allow to configure K8 in workflow 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.
Please check my comment
@yoyama I'm sorry if it's not what I intended. I would like to add a parameter that allows setting using the parameter of "kubernetes" from the workflow.
If this parameter is true, requestConfig is merged with systemConfig and used like PR. If false, only systemConfig is used. (As an image, the original createFromSystemConfig method) If this parameter is not set or defaults, it is treated as false. |
if (extractedSystemConfig != null && extractedRequestConfig != null) { | ||
config = extractedSystemConfig.merge(extractedRequestConfig); | ||
|
||
} else if (extractedRequestConfig != null) { |
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.
May I ask you to change the format ?
}
else if (
// from system config | ||
return KubernetesClientConfig.createFromSystemConfig(name, systemConfig); | ||
|
||
String clusterName = null; |
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.
Better to use Optional
|
||
// Create a config that merges RequestConfig with SystemConfig | ||
final Config config; | ||
if (extractedSystemConfig != null && extractedRequestConfig != null) { |
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 you set empty Config as default value in both extractedSystemConfig
and extractedRequestConfig
.
You can simply merge them without if ... else if ...
?
And at last check required keys are set.
config = extractedSystemConfig; | ||
|
||
} else { | ||
throw new ConfigException("systemConfig and requestConfig does not exist"); |
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 might be better to improve the message to make users understand what is wrong.
@yoyama I don't know if this is intended by yoyama san, so please tell me your opinion. I fixed it based on some indications in the code. Please review. |
@hnarimiya Could you rebase your PR to the latest master and fix the CI failures ? |
0b6b32c
to
7646259
Compare
I rebased this PR(#1279) from master.
Please review.