Skip to content

Commit d2e85fc

Browse files
committed
Add an option to skip EKS hostname checks
1 parent 70df53c commit d2e85fc

File tree

1 file changed

+4
-1
lines changed
  • cmd/managed-kubernetes-auditing-toolkit/eks

1 file changed

+4
-1
lines changed

cmd/managed-kubernetes-auditing-toolkit/eks/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import (
99
"github.com/spf13/cobra"
1010
)
1111

12+
var ignoreEksHostnameCheck bool
13+
1214
func BuildEksSubcommand() *cobra.Command {
1315
eksCommand := &cobra.Command{
1416
Use: "eks",
1517
Short: "Commands to audit your EKS cluster",
1618
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
1719
figure.NewFigure("mkat", "", true).Print()
1820
println()
19-
if !utils.IsEKS() {
21+
if !ignoreEksHostnameCheck && !utils.IsEKS() {
2022
return errors.New("you do not seem to be connected to an EKS cluster. Connect to an EKS cluster and try again")
2123
}
2224
clusterName := utils.GetEKSClusterName()
@@ -27,6 +29,7 @@ func BuildEksSubcommand() *cobra.Command {
2729
},
2830
}
2931

32+
eksCommand.PersistentFlags().BoolVarP(&ignoreEksHostnameCheck, "skip-eks-hostname-check", "", false, "Don't check that the hostname of your current API server ends with .eks.amazonaws.com")
3033
eksCommand.AddCommand(buildEksRoleRelationshipsCommand())
3134
eksCommand.AddCommand(buildEksFindSecretsCommand())
3235
eksCommand.AddCommand(buildTestImdsAccessCommand())

0 commit comments

Comments
 (0)