Skip to content

Commit

Permalink
webhook: remove useless code. (#8236)
Browse files Browse the repository at this point in the history
* webhook: remove useless code

Signed-off-by: SpecialYang <[email protected]>

* Remove duplicated codec
  • Loading branch information
SpecialYang authored Feb 13, 2022
1 parent c1be349 commit 53a232f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion internal/admission/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (ia *IngressAdmission) HandleAdmission(obj runtime.Object) (runtime.Object,
codec := json.NewSerializerWithOptions(json.DefaultMetaFactory, scheme, scheme, json.SerializerOptions{
Pretty: true,
})
codec.Decode(review.Request.Object.Raw, nil, nil)
_, _, err := codec.Decode(review.Request.Object.Raw, nil, &ingress)
if err != nil {
klog.ErrorS(err, "failed to decode ingress")
Expand Down
5 changes: 0 additions & 5 deletions internal/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1741,17 +1741,12 @@ func checkOverlap(ing *networking.Ingress, ingresses []*ingress.Ingress, servers
}

// same ingress
skipValidation := false
for _, existing := range existingIngresses {
if existing.ObjectMeta.Namespace == ing.ObjectMeta.Namespace && existing.ObjectMeta.Name == ing.ObjectMeta.Name {
return nil
}
}

if skipValidation {
continue
}

// path overlap. Check if one of the ingresses has a canary annotation
isCanaryEnabled, annotationErr := parser.GetBoolAnnotation("canary", ing)
for _, existing := range existingIngresses {
Expand Down

0 comments on commit 53a232f

Please sign in to comment.