-
Notifications
You must be signed in to change notification settings - Fork 810
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
.*: implement the DNS chaos CRD API #935
.*: implement the DNS chaos CRD API #935
Conversation
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Codecov Report
@@ Coverage Diff @@
## master #935 +/- ##
==========================================
- Coverage 55.78% 48.61% -7.17%
==========================================
Files 68 76 +8
Lines 4383 4371 -12
==========================================
- Hits 2445 2125 -320
- Misses 1768 2042 +274
- Partials 170 204 +34
Continue to review full report at Codecov.
|
/run-all-tests |
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
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.
Rest LGTM
api/v1alpha1/dnschaos_webhook.go
Outdated
return ValidatePodMode(in.Spec.Value, in.Spec.Mode, spec.Child("value")) | ||
} | ||
|
||
func (in *DNSChaosSpec) validateAction(action *field.Path) field.ErrorList { |
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 found a similar logic above using kubebuilder:validation
.
// +kubebuilder:validation:Enum=error;random
Action DNSChaosAction `json:"action"`
kubebuilder:validation
is enough.
I don't think this method is necessary at present.
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.
OK, I removed these two functions
api/v1alpha1/dnschaos_webhook.go
Outdated
return allErrs | ||
} | ||
|
||
func (in *DNSChaosSpec) validateScope(scope *field.Path) field.ErrorList { |
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.
ditto
// +kubebuilder:validation:Enum=outer;inner;all
Scope DNSChaosScope `json:"scope"`
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.
removed
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
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
Codecov Report
@@ Coverage Diff @@
## master #935 +/- ##
==========================================
- Coverage 55.78% 47.40% -8.39%
==========================================
Files 68 72 +4
Lines 4383 4367 -16
==========================================
- Hits 2445 2070 -375
- Misses 1768 2087 +319
- Partials 170 210 +40
Continue to review full report at Codecov.
|
@Gallardot PTAL 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.
LGTM
@WangXiangUSTC Do we need to update helm files and |
Signed-off-by: xiang <xiang13225080@163.com>
2c29f32
OK, seems that I forget to update them |
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
@cwen0 this pr is refactored by chaos-builder, PTAL 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.
LGTM
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
/merge |
/run-all-tests |
What problem does this PR solve?
Add a new CRD DNS chaos, and implement this CRD's API.
This pr is part of #860, #860 is too big, so I will split it to multiple small prs.
Checklist
Tests
Side effects
Related changes
Does this PR introduce a user-facing change?