Skip to content

Commit

Permalink
Test without any tenant annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann committed Nov 21, 2024
1 parent bfa57a2 commit 48ad2c4
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions pkg/admission/validator/shoot.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
apismetal "github.com/metal-stack/gardener-extension-provider-metal/pkg/apis/metal"
"github.com/metal-stack/gardener-extension-provider-metal/pkg/apis/metal/helper"
metalvalidation "github.com/metal-stack/gardener-extension-provider-metal/pkg/apis/metal/validation"
"github.com/metal-stack/metal-lib/pkg/tag"

extensionswebhook "github.com/gardener/gardener/extensions/pkg/webhook"
"github.com/gardener/gardener/pkg/apis/core"
Expand Down Expand Up @@ -56,11 +55,6 @@ func (s *shoot) validateShoot(ctx context.Context, shoot *core.Shoot) error {
// Provider validation
fldPath := field.NewPath("spec", "provider")

_, ok := shoot.Annotations[tag.ClusterTenant]
if !ok {
return field.Required(field.NewPath("metadata", "annotations"), fmt.Sprintf("cluster must be annotated with a tenant using the annotations: %s", tag.ClusterTenant))
}

// InfrastructureConfig
infraConfigFldPath := fldPath.Child("infrastructureConfig")

Expand Down Expand Up @@ -152,10 +146,6 @@ func (s *shoot) validateShootUpdate(ctx context.Context, oldShoot, shoot *core.S
}
}

if shoot.Annotations[tag.ClusterTenant] != oldShoot.Annotations[tag.ClusterTenant] {
return field.Forbidden(field.NewPath("metadata", "annotations"), "tenant annotation of a shoot is immutable")
}

return s.validateShoot(ctx, shoot)
}

Expand Down

0 comments on commit 48ad2c4

Please sign in to comment.