rrajesh-cloudera commented on code in PR #915:
URL: https://github.com/apache/yunikorn-k8shim/pull/915#discussion_r1763081049
##########
test/e2e/user_group_limit/user_group_limit_test.go:
##########
@@ -1022,3 +1249,45 @@ func checkUsageWildcardGroups(testType TestType, name
string, queuePath string,
Ω(resourceUsageDAO.ResourceUsage.Resources["pods"]).To(gomega.Equal(resources.Quantity(len(expectedRunningPods))))
Ω(resourceUsageDAO.RunningApplications).To(gomega.ConsistOf(appIDs...))
}
+
+func createKubeconfig(path, currentContext, clusterCA, clusterServer,
userTokenValue string) error {
+ kubeconfigTemplate := `
+apiVersion: v1
+kind: Config
+current-context: ${CURRENT_CONTEXT}
+contexts:
+- name: ${CURRENT_CONTEXT}
+ context:
+ cluster: ${CURRENT_CONTEXT}
+ user: test-user
+clusters:
+- name: ${CURRENT_CONTEXT}
+ cluster:
+ certificate-authority-data: ${CLUSTER_CA}
+ server: ${CLUSTER_SERVER}
+users:
+- name: test-user
+ user:
+ token: ${USER_TOKEN_VALUE}
+`
+ // Replace placeholders in the template
+ kubeconfigContent := strings.ReplaceAll(kubeconfigTemplate,
"${CURRENT_CONTEXT}", currentContext)
+ kubeconfigContent = strings.ReplaceAll(kubeconfigContent,
"${CLUSTER_CA}", clusterCA)
+ kubeconfigContent = strings.ReplaceAll(kubeconfigContent,
"${CLUSTER_SERVER}", clusterServer)
+ kubeconfigContent = strings.ReplaceAll(kubeconfigContent,
"${USER_TOKEN_VALUE}", userTokenValue)
+
+ // Write the kubeconfig YAML to the file
+ err := os.WriteFile(path, []byte(kubeconfigContent), 0600)
+ gomega.Ω(err).NotTo(gomega.HaveOccurred())
+ return nil
+}
Review Comment:
Sure @pbacsko will accommodate the requested changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]