Skip to content

Commit

Permalink
chore: preview
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbaehler committed May 27, 2024
1 parent dde44bf commit 3de8719
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 33 deletions.
2 changes: 1 addition & 1 deletion pkg/webhook/namespace/freezed.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *freezedHandler) OnCreate(client client.Client, decoder admission.Decode
}

for _, objectRef := range ns.ObjectMeta.OwnerReferences {
if !isTenantOwnerReference(objectRef) {
if !utils.IsTenantOwnerReference(objectRef) {

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.26.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.24.7)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.23.6)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.25.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.27.2)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.28.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.29.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/freezed.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.22.4)

undefined: utils.IsTenantOwnerReference
continue
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/namespace/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (r *prefixHandler) OnCreate(clt client.Client, decoder admission.Decoder, r
tnt := &capsulev1beta2.Tenant{}

for _, or := range ns.ObjectMeta.OwnerReferences {
if !isTenantOwnerReference(or) {
if !utils.IsTenantOwnerReference(or) {

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.26.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.24.7)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.23.6)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.25.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.27.2)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.28.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.29.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 52 in pkg/webhook/namespace/prefix.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.22.4)

undefined: utils.IsTenantOwnerReference
continue
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/namespace/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (r *quotaHandler) OnCreate(client client.Client, decoder admission.Decoder,
}

for _, objectRef := range ns.ObjectMeta.OwnerReferences {
if !isTenantOwnerReference(objectRef) {
if !utils.IsTenantOwnerReference(objectRef) {

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.26.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.24.7)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.23.6)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.25.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.27.2)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.28.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.29.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 34 in pkg/webhook/namespace/quota.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.22.4)

undefined: utils.IsTenantOwnerReference
continue
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/namespace/user_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *userMetadataHandler) OnCreate(client client.Client, decoder admission.D
tnt := &capsulev1beta2.Tenant{}

for _, objectRef := range ns.ObjectMeta.OwnerReferences {
if !isTenantOwnerReference(objectRef) {
if !utils.IsTenantOwnerReference(objectRef) {

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.26.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.24.7)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.23.6)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.25.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.27.2)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.28.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.29.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 38 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.22.4)

undefined: utils.IsTenantOwnerReference
continue
}

Expand Down Expand Up @@ -90,7 +90,7 @@ func (r *userMetadataHandler) OnUpdate(client client.Client, decoder admission.D
tnt := &capsulev1beta2.Tenant{}

for _, objectRef := range newNs.ObjectMeta.OwnerReferences {
if !isTenantOwnerReference(objectRef) {
if !utils.IsTenantOwnerReference(objectRef) {

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / lint

undefined: utils.IsTenantOwnerReference (typecheck)

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.26.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.24.7)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.23.6)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.25.3)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.27.2)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.28.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.29.0)

undefined: utils.IsTenantOwnerReference

Check failure on line 93 in pkg/webhook/namespace/user_metadata.go

View workflow job for this annotation

GitHub Actions / Kubernetes (v1.22.4)

undefined: utils.IsTenantOwnerReference
continue
}

Expand Down
27 changes: 0 additions & 27 deletions pkg/webhook/namespace/utils.go

This file was deleted.

5 changes: 4 additions & 1 deletion pkg/webhook/utils/ownerreference.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2023 Project Capsule Authors.
// SPDX-License-Identifier: Apache-2.0

package utils

import (
Expand All @@ -12,7 +15,7 @@ const (
ObjectReferenceTenantKind = "Tenant"
)

func IsTenantOwnerReference(or metav1.OwnerReference) bool {
func isTenantOwnerReference(or metav1.OwnerReference) bool {
parts := strings.Split(or.APIVersion, "/")
if len(parts) != 2 {
return false
Expand Down

0 comments on commit 3de8719

Please sign in to comment.