</code></pre></div> - If you are working on the v1.x.x version of this controller, and you want to create a cluster with kubernetes version 1.22, then please visit the <ahref=https://kind.sigs.k8s.io/docs/user/configuration/#a-note-on-cli-parameters-and-configuration-files>documentation for kind</a>, and look for how to set a custom image for the kind node (image: kindest/node...), in the kind config file.</p><h3id=testing>Testing<aclass=headerlinkhref=#testingtitle="Permanent link"> ¶</a></h3><p><strong>Run go unit tests</strong></p><divclass=highlight><pre><span></span><code><spanclass=go>make test</span>
</code></pre></div><p><strong>Run unit-tests for lua code</strong></p><divclass=highlight><pre><span></span><code><spanclass=go>make lua-test</span>
</code></pre></div><p>Lua tests are located in the directory <code>rootfs/etc/nginx/lua/test</code></p><divclass="admonition important"><pclass=admonition-title>Important</p><p>Test files must follow the naming convention <code><mytest>_test.lua</code> or it will be ignored</p></div><p><strong>Run e2e test suite</strong></p><divclass=highlight><pre><span></span><code><spanclass=go>make kind-e2e-test</span>
</code></pre></div><p>To limit the scope of the tests to execute, we can use the environment variable <code>FOCUS</code></p><divclass=highlight><pre><span></span><code><spanclass=go>FOCUS="no-auth-locations" make kind-e2e-test</span>
</code></pre></div><divclass="admonition note"><pclass=admonition-title>Note</p><p>The variable <code>FOCUS</code> defines Ginkgo <ahref=https://onsi.github.io/ginkgo/#focused-specs>Focused Specs</a></p></div><p>Valid values are defined in the describe definition of the e2e tests like <ahref=https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/defaultbackend/default_backend.go#L29>Default Backend</a></p><p>The complete list of tests can be found <ahref=../../e2e-tests/>here</a></p><h3id=custom-docker-image>Custom docker image<aclass=headerlinkhref=#custom-docker-imagetitle="Permanent link"> ¶</a></h3><p>In some cases, it can be useful to build a docker image and publish such an image to a private or custom registry location.</p><p>This can be done setting two environment variables, <code>REGISTRY</code> and <code>TAG</code></p><divclass=highlight><pre><span></span><code><spanclass=go>export TAG="dev"</span>
</code></pre></div><p>and then publish such version with</p><divclass=highlight><pre><span></span><code><spanclass=go>docker push $REGISTRY/controller:$TAG</span>
</code></pre></div></article></div></div></main><footerclass=md-footer><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><divclass=md-dialogdata-md-component=dialog><divclass="md-dialog__inner md-typeset"></div></div><scriptid=__configtype=application/json>{"base":"../..","features":["navigation.tabs","navigation.tabs.sticky","navigation.instant","navigation.sections"],"search":"../../assets/javascripts/workers/search.f886a092.min.js","translations":{"clipboard.copied":"Copied to clipboard","clipboard.copy":"Copy to clipboard","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.placeholder":"Type to start searching","search.result.term.missing":"Missing","select.version":"Select version"}}</script><scriptsrc=../../assets/javascripts/bundle.aecac24b.min.js></script></body></html>