mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #129940 from vinayakankugoyal/gen
cleanup: Remove unused service account creation from node_authn.go
This commit is contained in:
		@@ -23,9 +23,7 @@ import (
 | 
				
			|||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	v1 "k8s.io/api/core/v1"
 | 
						v1 "k8s.io/api/core/v1"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
					 | 
				
			||||||
	"k8s.io/kubernetes/pkg/cluster/ports"
 | 
						"k8s.io/kubernetes/pkg/cluster/ports"
 | 
				
			||||||
	"k8s.io/kubernetes/test/e2e/feature"
 | 
					 | 
				
			||||||
	"k8s.io/kubernetes/test/e2e/framework"
 | 
						"k8s.io/kubernetes/test/e2e/framework"
 | 
				
			||||||
	e2enode "k8s.io/kubernetes/test/e2e/framework/node"
 | 
						e2enode "k8s.io/kubernetes/test/e2e/framework/node"
 | 
				
			||||||
	e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
 | 
						e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
 | 
				
			||||||
@@ -36,7 +34,7 @@ import (
 | 
				
			|||||||
	"github.com/onsi/gomega"
 | 
						"github.com/onsi/gomega"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var _ = SIGDescribe(feature.NodeAuthenticator, func() {
 | 
					var _ = SIGDescribe("NodeAuthenticator", func() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	f := framework.NewDefaultFramework("node-authn")
 | 
						f := framework.NewDefaultFramework("node-authn")
 | 
				
			||||||
	f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
 | 
						f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
 | 
				
			||||||
@@ -68,18 +66,6 @@ var _ = SIGDescribe(feature.NodeAuthenticator, func() {
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ginkgo.It("The kubelet can delegate ServiceAccount tokens to the API server", func(ctx context.Context) {
 | 
						ginkgo.It("The kubelet can delegate ServiceAccount tokens to the API server", func(ctx context.Context) {
 | 
				
			||||||
		ginkgo.By("create a new ServiceAccount for authentication")
 | 
					 | 
				
			||||||
		trueValue := true
 | 
					 | 
				
			||||||
		newSA := &v1.ServiceAccount{
 | 
					 | 
				
			||||||
			ObjectMeta: metav1.ObjectMeta{
 | 
					 | 
				
			||||||
				Namespace: ns,
 | 
					 | 
				
			||||||
				Name:      "node-auth-newsa",
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			AutomountServiceAccountToken: &trueValue,
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		_, err := f.ClientSet.CoreV1().ServiceAccounts(ns).Create(ctx, newSA, metav1.CreateOptions{})
 | 
					 | 
				
			||||||
		framework.ExpectNoError(err, "failed to create service account (%s:%s)", ns, newSA.Name)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		pod := createNodeAuthTestPod(ctx, f)
 | 
							pod := createNodeAuthTestPod(ctx, f)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for _, nodeIP := range nodeIPs {
 | 
							for _, nodeIP := range nodeIPs {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -311,9 +311,6 @@ var (
 | 
				
			|||||||
	// Testing node allocatable validations
 | 
						// Testing node allocatable validations
 | 
				
			||||||
	NodeAllocatable = framework.WithFeature(framework.ValidFeatures.Add("NodeAllocatable"))
 | 
						NodeAllocatable = framework.WithFeature(framework.ValidFeatures.Add("NodeAllocatable"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// TODO: document the feature (owning SIG, when to use this feature for a test)
 | 
					 | 
				
			||||||
	NodeAuthenticator = framework.WithFeature(framework.ValidFeatures.Add("NodeAuthenticator"))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Owner: sig-node
 | 
						// Owner: sig-node
 | 
				
			||||||
	// Node Problem Detect e2e tests in tree.
 | 
						// Node Problem Detect e2e tests in tree.
 | 
				
			||||||
	NodeProblemDetector = framework.WithFeature(framework.ValidFeatures.Add("NodeProblemDetector"))
 | 
						NodeProblemDetector = framework.WithFeature(framework.ValidFeatures.Add("NodeProblemDetector"))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user