Skip to content

Commit a96fe1e

Browse files
committed
Delete unused LimitRangerActions
We call limitranger.NewLimitRanger(nil) where the nil means use default actions. Also remove type limitRangerActions.
1 parent 4185cb1 commit a96fe1e

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

pkg/quota/admission/clusterresourceoverride/admission.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/golang/glog"
99

1010
"k8s.io/apimachinery/pkg/api/resource"
11-
"k8s.io/apimachinery/pkg/runtime"
1211
"k8s.io/apiserver/pkg/admission"
1312
kapi "k8s.io/kubernetes/pkg/apis/core"
1413
kclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
@@ -60,10 +59,8 @@ type clusterResourceOverridePlugin struct {
6059
ProjectCache *cache.ProjectCache
6160
LimitRanger admission.Interface
6261
}
63-
type limitRangerActions struct{}
6462

6563
var _ = oadmission.WantsProjectCache(&clusterResourceOverridePlugin{})
66-
var _ = limitranger.LimitRangerActions(&limitRangerActions{})
6764
var _ = kadmission.WantsInternalKubeInformerFactory(&clusterResourceOverridePlugin{})
6865
var _ = kadmission.WantsInternalKubeClientSet(&clusterResourceOverridePlugin{})
6966

@@ -100,20 +97,6 @@ func (d *clusterResourceOverridePlugin) SetInternalKubeClientSet(c kclientset.In
10097
d.LimitRanger.(kadmission.WantsInternalKubeClientSet).SetInternalKubeClientSet(c)
10198
}
10299

103-
// these serve to satisfy the interface so that our kept LimitRanger limits nothing and only provides defaults.
104-
func (d *limitRangerActions) SupportsAttributes(a admission.Attributes) bool {
105-
return true
106-
}
107-
func (d *limitRangerActions) SupportsLimit(limitRange *kapi.LimitRange) bool {
108-
return true
109-
}
110-
func (d *limitRangerActions) MutateLimit(limitRange *kapi.LimitRange, resourceName string, obj runtime.Object) error {
111-
return nil
112-
}
113-
func (d *limitRangerActions) ValidateLimit(limitRange *kapi.LimitRange, resourceName string, obj runtime.Object) error {
114-
return nil
115-
}
116-
117100
func (a *clusterResourceOverridePlugin) SetProjectCache(projectCache *cache.ProjectCache) {
118101
a.ProjectCache = projectCache
119102
}

0 commit comments

Comments
 (0)