Skip to content
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

fix webhook panic #307

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ resources:
kind: NebulaRestore
path: github.com/vesoft-inc/nebula-operator/apis/apps/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: nebula-graph.io
group: autoscaling
kind: NebulaAutoscaler
path: github.com/vesoft-inc/nebula-operator/apis/autoscaling/v1alpha1
version: v1alpha1
version: "3"
2 changes: 1 addition & 1 deletion cmd/autoscaler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (o *Options) AddFlags(flags *pflag.FlagSet) {
flags.DurationVar(&o.HPAOpts.HorizontalPodAutoscalerUpscaleForbiddenWindow.Duration, "autoscaler-upscale-delay", defaultAutoscalerUpscaleForbiddenWindow.Duration, "The period since last upscale, before another upscale can be performed in nebula autoscaler.")
flags.DurationVar(&o.HPAOpts.HorizontalPodAutoscalerDownscaleStabilizationWindow.Duration, "autoscaler-downscale-stabilization", defaultAutoscalerDownscaleStabilizationWindow.Duration, "The period for which nebula autoscaler will look backwards and not scale down below any recommendation it made during that period.")
flags.DurationVar(&o.HPAOpts.HorizontalPodAutoscalerDownscaleForbiddenWindow.Duration, "autoscaler-downscale-delay", defaultAutoscalerDownscaleForbiddenWindow.Duration, "The period since last downscale, before another downscale can be performed in nebula autoscaler.")
flags.Float64Var(&o.HPAOpts.HorizontalPodAutoscalerTolerance, "autscaler-tolerance", 0.1, "The minimum change (from 1.0) in the desired-to-actual metrics ratio for the nebula autoscaler to consider scaling.")
flags.Float64Var(&o.HPAOpts.HorizontalPodAutoscalerTolerance, "autoscaler-tolerance", 0.1, "The minimum change (from 1.0) in the desired-to-actual metrics ratio for the nebula autoscaler to consider scaling.")
flags.DurationVar(&o.HPAOpts.HorizontalPodAutoscalerCPUInitializationPeriod.Duration, "autoscaler-cpu-initialization-period", defaultAutoscalerCPUInitializationPeriod.Duration, "The period after pod start when CPU samples might be skipped.")
flags.DurationVar(&o.HPAOpts.HorizontalPodAutoscalerInitialReadinessDelay.Duration, "autoscaler-initial-readiness-delay", defaultAutoscalerInitialReadinessDelay.Duration, "The period after pod start during which readiness changes will be treated as initial readiness.")

Expand Down
3 changes: 2 additions & 1 deletion pkg/webhook/nebulacluster/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ func validateNebulaClusterUpdateStoragedDataVolume(nc, oldNC *v1alpha1.NebulaClu
if len(nc.Spec.Storaged.DataVolumeClaims) != len(oldNC.Spec.Storaged.DataVolumeClaims) {
allErrs = append(allErrs, field.Forbidden(
field.NewPath("spec", "storaged", "dataVolumeClaims"),
"storaged dataVolumeClaims len is immutable",
"storaged dataVolumeClaims is immutable",
))
return allErrs
}
for i, pvc := range nc.Spec.Storaged.DataVolumeClaims {
if pvc.Resources.Requests.Storage().Cmp(*oldNC.Spec.Storaged.DataVolumeClaims[i].Resources.Requests.Storage()) == -1 {
Expand Down