-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
36 lines (32 loc) · 884 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"fmt"
"io/ioutil"
"github.com/MiteshSharma/EksAuth/k8s"
)
var certificateAuthorityDataFile = "cert file path"
var clusterName = ""
var clusterServerUrl = ""
var awsKeyId = ""
var awsSecretKey = ""
var awsRegion = ""
var clusterId = ""
func main() {
certificateAuthorityData, err := ioutil.ReadFile(certificateAuthorityDataFile)
if err != nil {
fmt.Println(err)
return
}
cluster := &k8s.EksCluster{
Name: clusterName,
Server: clusterServerUrl,
CertificateAuthorityData: []byte(certificateAuthorityData),
AwsKeyId: awsKeyId,
AwsSecretKey: awsSecretKey,
AwsRegion: awsRegion,
ClusterID: clusterId,
}
fmt.Println("Testing eks cluster auth by fetching all namespaces")
cluster.TestCluster()
fmt.Println("Testing eks cluster completed")
}