bootstrap_signer.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. Copyright 2019 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package e2e_kubeadm
  14. import (
  15. "k8s.io/kubernetes/test/e2e/framework"
  16. "github.com/onsi/ginkgo"
  17. )
  18. const (
  19. bootstrapTokensSignerRoleName = "system:controller:bootstrap-signer"
  20. )
  21. // Define container for all the test specification aimed at verifying
  22. // that kubeadm creates the bootstrap signer
  23. var _ = KubeadmDescribe("bootstrap signer", func() {
  24. // Get an instance of the k8s test framework
  25. f := framework.NewDefaultFramework("bootstrap token")
  26. // Tests in this container are not expected to create new objects in the cluster
  27. // so we are disabling the creation of a namespace in order to get a faster execution
  28. f.SkipNamespaceCreation = true
  29. ginkgo.It("should be active", func() {
  30. //NB. this is technically implemented a part of the control-plane phase
  31. // and more specifically if the controller manager is properly configured,
  32. // the bootstrapsigner controller is activated and the system:controller:bootstrap-signer
  33. // group will be automatically created
  34. ExpectRole(f.ClientSet, kubeSystemNamespace, bootstrapTokensSignerRoleName)
  35. })
  36. })