@@ -71,7 +71,7 @@ func TestReadAndParseKubernetesYaml(t *testing.T) {
7171 tests := []struct {
7272 name string
7373 src YamlSrc
74- fs afero.Afero
74+ fs * afero.Afero
7575 wantErr bool
7676 wantDeploymentNames []string
7777 wantServiceNames []string
@@ -84,7 +84,7 @@ func TestReadAndParseKubernetesYaml(t *testing.T) {
8484 src : YamlSrc {
8585 URL : "http://" + serverIP ,
8686 },
87- fs : fs ,
87+ fs : nil ,
8888 wantDeploymentNames : []string {"deploy-sample" , "deploy-sample-2" },
8989 wantServiceNames : []string {"service-sample" , "service-sample-2" },
9090 wantRouteNames : []string {"route-sample" , "route-sample-2" },
@@ -96,19 +96,27 @@ func TestReadAndParseKubernetesYaml(t *testing.T) {
9696 src : YamlSrc {
9797 Path : "../../../tests/yamls/resources.yaml" ,
9898 },
99- fs : fs ,
99+ fs : & fs ,
100100 wantDeploymentNames : []string {"deploy-sample" , "deploy-sample-2" },
101101 wantServiceNames : []string {"service-sample" , "service-sample-2" },
102102 wantRouteNames : []string {"route-sample" , "route-sample-2" },
103103 wantIngressNames : []string {"ingress-sample" , "ingress-sample-2" },
104104 wantOtherNames : []string {"pvc-sample" , "pvc-sample-2" },
105105 },
106+ {
107+ name : "Read the YAML from the Path with no fs passed" ,
108+ src : YamlSrc {
109+ Path : "../../../tests/yamls/resources.yaml" ,
110+ },
111+ fs : nil ,
112+ wantErr : true ,
113+ },
106114 {
107115 name : "Read the YAML from the Data" ,
108116 src : YamlSrc {
109117 Data : data ,
110118 },
111- fs : fs ,
119+ fs : nil ,
112120 wantDeploymentNames : []string {"deploy-sample" , "deploy-sample-2" },
113121 wantServiceNames : []string {"service-sample" , "service-sample-2" },
114122 wantRouteNames : []string {"route-sample" , "route-sample-2" },
@@ -120,23 +128,23 @@ func TestReadAndParseKubernetesYaml(t *testing.T) {
120128 src : YamlSrc {
121129 URL : "http://badurl" ,
122130 },
123- fs : fs ,
131+ fs : nil ,
124132 wantErr : true ,
125133 },
126134 {
127135 name : "Bad Path" ,
128136 src : YamlSrc {
129137 Path : "$%^&" ,
130138 },
131- fs : fs ,
139+ fs : & fs ,
132140 wantErr : true ,
133141 },
134142 {
135143 name : "Bad Data" ,
136144 src : YamlSrc {
137145 Data : badData ,
138146 },
139- fs : fs ,
147+ fs : nil ,
140148 wantErr : true ,
141149 },
142150 }
0 commit comments