File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change
1
+ orbs :
2
+
3
+
1
4
executors :
2
5
custom :
3
6
docker :
70
73
root : /home/circleci/kube-linter
71
74
paths :
72
75
- .gobin/kube-linter
76
+ - bin/windows/kube-linter.exe
73
77
74
78
e2e-test :
75
79
executor : custom
82
86
name : Run E2E tests
83
87
command : |
84
88
make e2e-test
85
-
89
+
90
+ sanity-test-windows :
91
+ executor :
92
+ name : win/default # references orb defined above.
93
+ size : " medium"
94
+
95
+ steps :
96
+ - checkout
97
+ - attach_workspace :
98
+ at : /home/circleci/kube-linter
99
+
100
+ - run :
101
+ name : Run E2E tests
102
+ shell : bash.exe
103
+ command : |
104
+ # In Windows, the workspace is attached relative to the current directory.
105
+ tag="$(./get-tag)"
106
+ cd home/circleci/kube-linter/bin/windows
107
+ version_from_bin="$(./kube-linter.exe version)"
108
+ echo "Expected tag ${tag}, got ${version_from_bin}"
109
+ [[ "${tag}" == "${version_from_bin}" ]]
110
+
111
+ # Make sure the lint command can run without errors.
112
+ # TODO: run the full suite of E2E tests on Windows.
113
+ ./kube-linter.exe lint .
114
+
86
115
image :
87
116
executor : custom
88
117
steps :
@@ -177,6 +206,10 @@ workflows:
177
206
<< : *runOnAllTags
178
207
requires :
179
208
- build
209
+ - sanity-test-windows :
210
+ << : *runOnAllTags
211
+ requires :
212
+ - build
180
213
- image :
181
214
<< : *runOnAllTags
182
215
context : docker-io-push
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package builtinchecks
2
2
3
3
import (
4
4
"embed"
5
+ "fmt"
5
6
"path/filepath"
6
7
"sync"
7
8
@@ -47,7 +48,9 @@ func List() ([]config.Check, error) {
47
48
loadErr = errors .Errorf ("found unexpected entry %s in yamls directory" , entry .Name ())
48
49
return
49
50
}
50
- contents , err := yamlFiles .ReadFile (filepath .Join ("yamls" , entry .Name ()))
51
+ // Do NOT use filepath.Join here, because embed always uses `/` as the separator,
52
+ // irrespective of the OS we're running.
53
+ contents , err := yamlFiles .ReadFile (fmt .Sprintf ("yamls/%s" , entry .Name ()))
51
54
if err != nil {
52
55
loadErr = errors .Wrapf (err , "loading file %s" , entry .Name ())
53
56
return
You can’t perform that action at this time.
0 commit comments