github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/caas/kubernetes/provider/constraints.go (about) 1 // Copyright 2018 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package provider 5 6 import ( 7 "github.com/juju/juju/core/constraints" 8 "github.com/juju/juju/environs/context" 9 ) 10 11 var unsupportedConstraints = []string{ 12 constraints.Cores, 13 constraints.VirtType, 14 constraints.Container, 15 constraints.InstanceType, 16 constraints.Spaces, 17 constraints.AllocatePublicIP, 18 constraints.ImageID, 19 } 20 21 // ConstraintsValidator returns a Validator value which is used to 22 // validate and merge constraints. 23 func (k *kubernetesClient) ConstraintsValidator(ctx context.ProviderCallContext) (constraints.Validator, error) { 24 validator := constraints.NewValidator() 25 validator.RegisterUnsupported(unsupportedConstraints) 26 return validator, nil 27 }