</code></pre></div> - If you are working on the v1.x.x version of this controler, 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.md>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-nav><navclass="md-footer-nav__inner md-grid"aria-label=Footer><ahref=../../examples/psp/class="md-footer-nav__link md-footer-nav__link--prev"rel=prev><divclass="md-footer-nav__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg></div><divclass=md-footer-nav__title><divclass=md-ellipsis><spanclass=md-footer-nav__direction> Previous </span> Pod Security Policy (PSP) </div></div></a><ahref=../code-overview/class="md-footer-nav__link md-footer-nav__link--next"rel=next><divclass=md-footer-nav__title><divclass=md-ellipsis><spanclass=md-footer-nav__direction> Next </span> Code Overview </div></div><divclass="md-footer-nav__button md-icon"><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg></div></a></nav></div><divclass="md-footer-meta md-typeset"><divclass="md-footer-meta__inner md-grid"><divclass=md-footer-copyright> Made with <ahref=https://squidfunk.github.io/mkdocs-material/target=_blankrel=noopener> Material for MkDocs </a></div></div></div></footer></div><scriptsrc=../../assets/javascripts/vendor.93c04032.min.js></script><scriptsrc=../../assets/javascripts/bundle.83e5331e.min.js></script><scriptid=__langtype=application/json>{"clipboard.copy":"Copy to clipboard","clipboard.copied":"Copied to clipboard","search.config.lang":"en","search.config.pipeline":"trimmer, stopWordFilter","search.config.separator":"[\\s\\-]+","search.placeholder":"Search","search.result.placeholder":"Type to start searching","search.result.none":"No matching documents","search.result.one":"1 matching document","search.result.other":"# matching documents","search.result.more.one":"1 more on this page","search.result.more.other":"# more on this page","search.result.term.missing":"Missing"}</script><script>