Skip to content

Commit fde853c

Browse files
committed
fix: removed runincluster property.
1 parent aa50b93 commit fde853c

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

cmd/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ var rootCmd = &cobra.Command{
5858
}
5959

6060
if !utils.ContainsEqual(cmdsWithoutContext, cmd.CommandPath()) {
61-
mokubernetes.InitKubernetes(utils.CONFIG.Kubernetes.RunInCluster)
6261
ctxs := mokubernetes.ListAllContexts()
6362
mokubernetes.ContextAddMany(ctxs)
6463
utils.PrintInfo((fmt.Sprintf("Current context: '%s'", contextId)))

kubernetes/context.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"os"
88

99
"github.com/mogenius/punq/dtos"
10-
"github.com/mogenius/punq/utils"
1110
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1211
"k8s.io/client-go/kubernetes"
1312
"k8s.io/client-go/tools/clientcmd"
@@ -50,10 +49,6 @@ func ContextFlag(id *string) string {
5049
}
5150

5251
func contextWrite(id string) error {
53-
if !utils.CONFIG.Kubernetes.RunInCluster {
54-
return nil
55-
}
56-
5752
ctx := ContextForId(id)
5853
if ctx == nil {
5954
return errors.New("context not found")

utils/config.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ type Config struct {
5151
Kubernetes struct {
5252
ClusterName string `yaml:"cluster_name" env:"cluster_name" env-description:"The Name of the Kubernetes Cluster"`
5353
OwnNamespace string `yaml:"own_namespace" env:"OWN_NAMESPACE" env-description:"The Namespace of mogenius platform"`
54-
RunInCluster bool `yaml:"run_in_cluster" env:"run_in_cluster" env-description:"If set to true, the application will run in the cluster (using the service account token). Otherwise it will try to load your local default context." env-default:"false"`
5554
} `yaml:"kubernetes"`
5655
Misc struct {
5756
Stage string `yaml:"stage" env:"stage" env-description:"Stage to run in" env-default:"prod"`
@@ -94,10 +93,6 @@ func InitConfigYaml(showDebug bool, customConfigName string, stage string) {
9493
logger.Log.Fatal(err)
9594
}
9695

97-
if CONFIG.Kubernetes.RunInCluster {
98-
ConfigPath = "RUNS_IN_CLUSTER_NO_CONFIG_NEEDED"
99-
}
100-
10196
if showDebug {
10297
PrintSettings()
10398
}
@@ -144,7 +139,6 @@ func PrintSettings() {
144139
fmt.Printf("\nKUBERNETES\n")
145140
fmt.Printf("ClusterName: %s\n", CONFIG.Kubernetes.ClusterName)
146141
fmt.Printf("OwnNamespace: %s\n", CONFIG.Kubernetes.OwnNamespace)
147-
fmt.Printf("RunInCluster: %t\n", CONFIG.Kubernetes.RunInCluster)
148142

149143
fmt.Printf("\nMISC\n")
150144
fmt.Printf("Stage: %s\n", CONFIG.Misc.Stage)

0 commit comments

Comments
 (0)