Skip to content

Commit

Permalink
RunImageConfiguration: @Deprecate entrypoint parameter field
Browse files Browse the repository at this point in the history
Right now parameter field for ENTRYPOINT seems to be inconsistent across
BuildImageConfiguration and RunImageConfiguration. Use `entryPoint` as
parameter in all places and deprecate others:

- `@Deprecate` `entrypoint` parameter field
- Use `entryPoint` parameter field

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
  • Loading branch information
rohanKanojia committed Nov 5, 2021
1 parent 146a09e commit d3d3618
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
3 changes: 3 additions & 0 deletions doc/changelog.md
Expand Up @@ -4,6 +4,9 @@
- Allow replacement in tags. Added a new replacement `%T` which always adds a timestamp. ([#1491](https://github.com/fabric8io/docker-maven-plugin/pull/1491))
- Only push the `latest` tag if no other tags where specified in docker mode. This can break your build, if you rely on the automatic `latest` tag. ([#1496](https://github.com/fabric8io/docker-maven-plugin/pull/1496))
- Only push the `latest` tag if no other tags where specified in jib mode. This can break your build, if you rely on the automatic `latest` tag. ([#1498](https://github.com/fabric8io/docker-maven-plugin/pull/1498))
- Deprecate `entrypoint` parameter in `<run>` configuration ([1488](https://github.com/fabric8io/docker-maven-plugin/pull/1488))

**Note:** `entrypoint` parameter in `<run>` configuration is marked as deprecated. Users are advised to use `entryPoint` parameter instead.

* **0.37.0** (2021-08-15)
- Fix stop mojo by taking container name pattern into account (#1168)
Expand Down
14 changes: 7 additions & 7 deletions src/main/asciidoc/inc/misc/_startup.adoc
Expand Up @@ -29,25 +29,25 @@ Either shell or params should be specified.
.Example
[source,xml]
----
<entrypoint>
<entryPoint>
<!-- shell form -->
<shell>java -jar $HOME/server.jar</shell>
</entrypoint>
</entryPoint>
----

or

.Example
[source,xml]
----
<entrypoint>
<entryPoint>
<!-- exec form -->
<exec>
<arg>java</arg>
<arg>-jar</arg>
<arg>/opt/demo/server.jar</arg>
</exec>
</entrypoint>
</entryPoint>
----

This can be formulated also more dense with:
Expand All @@ -56,19 +56,19 @@ This can be formulated also more dense with:
[source,xml]
----
<!-- shell form -->
<entrypoint>java -jar $HOME/server.jar</entrypoint>
<entryPoint>java -jar $HOME/server.jar</entryPoint>
----

or

.Example
[source,xml]
----
<entrypoint>
<entryPoint>
<!-- exec form -->
<arg>java</arg>
<arg>-jar</arg>
<arg>/opt/demo/server.jar</arg>
</entrypoint>
</entryPoint>
----

Expand Up @@ -47,10 +47,17 @@ public boolean isDefault() {
@Parameter
private List<String> dependsOn;

// container entry point
/**
* container entry point
* @deprecated This field would be removed in upcoming releases. Use <code>entryPoint</code> instead.
*/
@Parameter
@Deprecated
private Arguments entrypoint;

@Parameter
private Arguments entryPoint;

// container hostname
@Parameter
private String hostname;
Expand Down Expand Up @@ -201,6 +208,9 @@ public String initAndValidate() {
if (entrypoint != null) {
entrypoint.validate();
}
if (entryPoint != null) {
entryPoint.validate();
}
if (cmd != null) {
cmd.validate();
}
Expand All @@ -227,7 +237,10 @@ public String getEnvPropertyFile() {
}

public Arguments getEntrypoint() {
return entrypoint;
if (entrypoint != null) {
return entrypoint;
}
return entryPoint;
}

public String getHostname() {
Expand Down Expand Up @@ -478,6 +491,7 @@ public Builder domainname(String domainname) {

public Builder entrypoint(Arguments args) {
config.entrypoint = args;
config.entryPoint = args;
return this;
}

Expand Down

0 comments on commit d3d3618

Please sign in to comment.