Skip to content

Commit d7ef09e

Browse files
Merge pull request #4915 from cheesesashimi/zzlotnik/fix-onclustertesting-helper
"NO-ISSUE: ensure that client configs are not mutable"
2 parents d1d9884 + 8bec907 commit d7ef09e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/framework/clientset.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ type ClientSet struct {
3939
mcfgclient mcfgclientset.Interface
4040
}
4141

42-
// Allows the instantiation of additional clients with the same config.
42+
// Returns a copy of the config so that additional clients may be instantiated
43+
// from it. By making a copy, callers are free to modify the config as needed.
4344
func (cs *ClientSet) GetRestConfig() *rest.Config {
44-
return cs.config
45+
return rest.CopyConfig(cs.config)
4546
}
4647

4748
func (cs *ClientSet) GetKubeconfig() (string, error) {

0 commit comments

Comments
 (0)