Skip to content

Commit

Permalink
refactor: better name variables in pkg/webhook/namespacequota
Browse files Browse the repository at this point in the history
  • Loading branch information
ludusrusso authored and prometherion committed May 4, 2021
1 parent 01b75a5 commit b87a6c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/webhook/namespacequota/validating.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ func (r *handler) OnCreate(client client.Client, decoder *admission.Decoder) cap
return admission.Errored(http.StatusBadRequest, err)
}

for _, or := range ns.ObjectMeta.OwnerReferences {
for _, objectRef := range ns.ObjectMeta.OwnerReferences {
// retrieving the selected Tenant
t := &capsulev1alpha1.Tenant{}
if err := client.Get(ctx, types.NamespacedName{Name: or.Name}, t); err != nil {
tnt := &capsulev1alpha1.Tenant{}
if err := client.Get(ctx, types.NamespacedName{Name: objectRef.Name}, tnt); err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
if t.IsFull() {
if tnt.IsFull() {
return admission.Denied(NewNamespaceQuotaExceededError().Error())
}
}
Expand Down

0 comments on commit b87a6c0

Please sign in to comment.