-
Notifications
You must be signed in to change notification settings - Fork 98
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): Adding dynamic client & deploymentconfig object support #199
Conversation
Signed-off-by: Raj <raj.das@mayadata.io>
Signed-off-by: Raj <raj.das@mayadata.io>
7b00ec7
to
c5209e1
Compare
5acb04a
to
1e7d2c8
Compare
Signed-off-by: Raj <raj.das@mayadata.io>
) | ||
|
||
var ( | ||
gvr = schema.GroupVersionResource{ |
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.
Can you name this a little Better? deploymentConfigGVR
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 was there, @chandankumar4 told to change it to gvr
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.
gvr is also good, As this variable is already inside the deploymentconfig file
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.
gvr
is too generic, still would be better to change it something suitable.
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.
gvr is GroupVersionResource
still the variable doesn't explain for which resource GVR we have.
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.
Then we can name it as deploymentConfigGVR
earlier it was dcGVR
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.
Yes, thanks @chandankumar4
} | ||
) | ||
// CheckDeploymentAnnotation will check the annotation of deployment | ||
func CheckDeploymentConfigAnnotation(clientSet dynamic.Interface, engine *chaosTypes.EngineInfo) (*chaosTypes.EngineInfo, error) { |
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.
Can we use this variable dynamicClient
instead to clientSet
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.
In future we will migrating to dynamic-client, its good to have this 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.
Still we will use dynamicClient
and remove clientSet
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.
dynamicClient
set is very different from normal clientSet
thats why it would be better to let anyone going through the code know that this function is using dynamicClient
|
||
// This will check and count the total chaos enabled application | ||
func checkForChaosEnabledDeploymentConfig(deploymentConfigList *unstructured.UnstructuredList, engine *chaosTypes.EngineInfo) (*chaosTypes.EngineInfo, int, error) { | ||
|
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.
Can we validate that the GVR of *unstructured.UnstructuredList
matches with deploymentConfig
GVR, and then start to validate.
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.
Or add the validation in its above function
// This will check and count the total chaos enabled application | ||
func checkForChaosEnabledDeploymentConfig(deploymentConfigList *unstructured.UnstructuredList, engine *chaosTypes.EngineInfo) (*chaosTypes.EngineInfo, int, error) { | ||
|
||
chaosEnabledDeploymentConfig := 0 |
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.
Add a nil check for *unstructured.UnstructuredList
before iterating into items
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.
Will raised another Pr for this
…uschaos#199) * Adding deploymentconfig annotation check support Signed-off-by: Raj <raj.das@mayadata.io>
Signed-off-by: Raj raj.das@mayadata.io
Issue- litmuschaos/litmus#1406