@@ -67,7 +67,7 @@ func TestProxyGetConfig(t *testing.T) {
67
67
g .Expect (err ).NotTo (HaveOccurred ())
68
68
defer os .RemoveAll (dir )
69
69
configFile := filepath .Join (dir , ".test-kubeconfig.yaml" )
70
- g .Expect (ioutil .WriteFile (configFile , []byte (tt .kubeconfigContents ), 0640 )).To (Succeed ())
70
+ g .Expect (ioutil .WriteFile (configFile , []byte (tt .kubeconfigContents ), 0600 )).To (Succeed ())
71
71
72
72
proxy := newProxy (Kubeconfig {Path : configFile , Context : tt .context })
73
73
conf , err := proxy .GetConfig ()
@@ -94,7 +94,7 @@ func TestProxyGetConfig(t *testing.T) {
94
94
g .Expect (err ).NotTo (HaveOccurred ())
95
95
defer os .RemoveAll (dir )
96
96
configFile := filepath .Join (dir , ".test-kubeconfig.yaml" )
97
- g .Expect (ioutil .WriteFile (configFile , []byte (kubeconfig ("management" , "default" )), 0640 )).To (Succeed ())
97
+ g .Expect (ioutil .WriteFile (configFile , []byte (kubeconfig ("management" , "default" )), 0600 )).To (Succeed ())
98
98
99
99
proxy := newProxy (Kubeconfig {Path : configFile , Context : "management" }, InjectProxyTimeout (23 * time .Second ))
100
100
conf , err := proxy .GetConfig ()
@@ -121,7 +121,7 @@ func TestKUBECONFIGEnvVar(t *testing.T) {
121
121
g .Expect (err ).NotTo (HaveOccurred ())
122
122
defer os .RemoveAll (dir )
123
123
configFile := filepath .Join (dir , ".test-kubeconfig.yaml" )
124
- g .Expect (ioutil .WriteFile (configFile , []byte (kubeconfigContents ), 0640 )).To (Succeed ())
124
+ g .Expect (ioutil .WriteFile (configFile , []byte (kubeconfigContents ), 0600 )).To (Succeed ())
125
125
126
126
proxy := newProxy (
127
127
// dont't give an explicit path but rather define the file in the
@@ -149,7 +149,7 @@ func TestKUBECONFIGEnvVar(t *testing.T) {
149
149
g .Expect (err ).NotTo (HaveOccurred ())
150
150
defer os .RemoveAll (dir )
151
151
configFile := filepath .Join (dir , ".test-kubeconfig.yaml" )
152
- g .Expect (ioutil .WriteFile (configFile , []byte (kubeconfigContents ), 0640 )).To (Succeed ())
152
+ g .Expect (ioutil .WriteFile (configFile , []byte (kubeconfigContents ), 0600 )).To (Succeed ())
153
153
154
154
proxy := newProxy (
155
155
// dont't give an explicit path but rather define the file in the
@@ -226,7 +226,7 @@ func TestProxyCurrentNamespace(t *testing.T) {
226
226
g .Expect (err ).NotTo (HaveOccurred ())
227
227
defer os .RemoveAll (dir )
228
228
configFile = filepath .Join (dir , ".test-kubeconfig.yaml" )
229
- g .Expect (ioutil .WriteFile (configFile , []byte (tt .kubeconfigContents ), 0640 )).To (Succeed ())
229
+ g .Expect (ioutil .WriteFile (configFile , []byte (tt .kubeconfigContents ), 0600 )).To (Succeed ())
230
230
}
231
231
232
232
proxy := newProxy (Kubeconfig {Path : configFile , Context : tt .kubeconfigContext })
0 commit comments