<h2>Problem</h2>
<p>Deploying OpenLibertyApplication rewrites the /config/server.xml specified in the container image</p>
<h3>What did you do?</h3>
<ol>
<li>Deployed OpenLibertyApplication with initial configuration in src/main/liberty/config/server.xml:</li>
</ol>
<pre><code>    &lt;httpEndpoint id=&quot;defaultHttpEndpointss&quot;
                  host=&quot;*&quot;
                  httpPort=&quot;8080&quot;
                  httpsPort=&quot;9443&quot; /&gt;
</code></pre>
<ol start="2">
<li>Changed port above to</li>
</ol>
<pre><code>    &lt;httpEndpoint id=&quot;defaultHttpEndpointssssssssss&quot;
                  host=&quot;*&quot;
                  httpPort=&quot;8080&quot;
                  httpsPort=&quot;8083&quot; /&gt;
</code></pre>
<ol start="3">
<li>Docker build copies this server.xml to /config/server.xml (Docker pull-ing the image to my local shows the correct updated /config/server.xml)</li>
<li>Deployed the new image using the OpenLibertyApplication supported by Open Liberty Operator from OperatorHub version 0.7.0 using oc apply -f openlibertyapplication.yaml:</li>
</ol>
<pre><code>apiVersion: openliberty.io/v1beta1
kind: OpenLibertyApplication
metadata:
  name: vehicle
  labels:
    app: vehicle
    name: vehicle
    service: vehicle
    version: v2
spec:
  applicationImage: quay.io/xxxx/xxxxx:latest
  createAppDefinition: false
  version: v2
  service:
    port: 8080
    portName: http
  expose: true
</code></pre>
<p>server.xml:</p>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;server description=&quot;new server&quot;&gt;

    &lt;featureManager&gt;
        &lt;feature&gt;servlet-4.0&lt;/feature&gt;
        &lt;feature&gt;springBoot-2.0&lt;/feature&gt;
    &lt;/featureManager&gt;

    &lt;httpEndpoint id=&quot;defaultHttpEndpointssssssssss&quot;
                  host=&quot;*&quot;
                  httpPort=&quot;8080&quot;
                  httpsPort=&quot;8083&quot; /&gt;

    &lt;springBootApplication id=&quot;vehicle&quot;
                           location=&quot;thin-vehicle-0.0.1-SNAPSHOT.jar&quot;
                           name=&quot;vehicle&quot; /&gt;

&lt;/server&gt;
</code></pre>
<h3>What did you expect to see?</h3>
<p>/config/server.xml in the Openshift pod showing the correct updated port for httpEndpoint http: 8080, https: 8083</p>
<h3>What did you see instead? Under which circumstances?</h3>
<p>Instead, I'm seeing the old port values on the Pod /config/server.xml, http: 8080, https: 9443. Id remains the old value too: id=&quot;defaultHttpEndpointss&quot;</p>
<h3>Environment</h3>
<ul>
<li>Kubernetes version information:</li>
</ul>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;19&quot;, GitVersion:&quot;v1.19.7&quot;, GitCommit:&quot;1dd5338295409edcfff11505e7bb246f0d325d15&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-01-13T13:23:52Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;windows/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.0+2817867&quot;, GitCommit:&quot;2817867655bb7b68215b4e77873a8facf82bee06&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-06-02T22:14:22Z&quot;, GoVersion:&quot;go1.15.7&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<ul>
<li>OpenShift version information (if applicable):</li>
</ul>
<pre><code>Client Version: 4.7.0-202104250659.p0-95881af
Server Version: 4.7.16
Kubernetes Version: v1.20.0+2817867
</code></pre>
<h3>Thanks in advance!</h3>

<p>The problem in this case was cached image with the <code>latest</code> tag. If the application is created without specifying policy, it is set to <code>pullPolicy: IfNotPresent</code> to optimize creating container. Since the OP first created image with incorrect settings, and then overwrite image with the same tag, OCP used cached version.</p>
<p>To ensure that you are using correct image either:</p>
<ul>
<li>change the tag name</li>
<li>set <code>pullPolicy: Always</code> in your application definition</li>
</ul>
