You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by gy...@apache.org on 2022/03/03 15:47:20 UTC
[flink-kubernetes-operator] branch main updated: [FLINK-26447] Clean up webhook jar and dependency management
This is an automated email from the ASF dual-hosted git repository.
gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new a9a4781 [FLINK-26447] Clean up webhook jar and dependency management
a9a4781 is described below
commit a9a47815e9ba0519ca37948cd2d1daa30a9053ff
Author: SteNicholas <pr...@163.com>
AuthorDate: Thu Mar 3 11:31:59 2022 +0800
[FLINK-26447] Clean up webhook jar and dependency management
---
Dockerfile | 2 +-
docker-entrypoint.sh | 3 +-
flink-kubernetes-webhook/pom.xml | 60 ----------------------------------------
3 files changed, 3 insertions(+), 62 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index a04f21d..f36d744 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -40,7 +40,7 @@ FROM openjdk:11-jre
ENV FLINK_HOME=/opt/flink
ENV OPERATOR_VERSION=1.0-SNAPSHOT
ENV OPERATOR_JAR=flink-kubernetes-operator-$OPERATOR_VERSION-shaded.jar
-ENV WEBHOOK_JAR=flink-kubernetes-webhook-$OPERATOR_VERSION-shaded.jar
+ENV WEBHOOK_JAR=flink-kubernetes-webhook-$OPERATOR_VERSION.jar
WORKDIR /
RUN groupadd --system --gid=9999 flink && \
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 813d174..f22bc24 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -31,7 +31,8 @@ elif [ "$1" = "operator" ]; then
elif [ "$1" = "webhook" ]; then
echo "Starting Webhook"
- exec java -jar $LOG_CONFIG /$WEBHOOK_JAR
+ # Adds the operator shaded jar on the classpath when the webhook starts
+ exec java -cp /$OPERATOR_JAR:/$WEBHOOK_JAR $LOG_CONFIG org.apache.flink.kubernetes.operator.admission.FlinkOperatorWebhook
fi
args=("${args[@]}")
diff --git a/flink-kubernetes-webhook/pom.xml b/flink-kubernetes-webhook/pom.xml
index 1bcd4ca..181ddcd 100644
--- a/flink-kubernetes-webhook/pom.xml
+++ b/flink-kubernetes-webhook/pom.xml
@@ -36,66 +36,6 @@ under the License.
<groupId>org.apache.flink</groupId>
<artifactId>flink-kubernetes-operator</artifactId>
<version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-shaded-netty</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-core</artifactId>
- <version>${flink.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-shaded-netty</artifactId>
- <version>4.1.70.Final-${flink.shaded.version}</version>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <id>shade-flink-operator</id>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration combine.children="append">
- <shadedArtifactAttached>true</shadedArtifactAttached>
- <artifactSet>
- <includes combine.children="append">
- <include>*:*</include>
- </includes>
- </artifactSet>
- <transformers combine.children="append">
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>org.apache.flink.kubernetes.operator.admission.FlinkOperatorWebhook</mainClass>
- </transformer>
- <!-- The service transformer is needed to merge META-INF/services files -->
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- <!-- The ApacheNoticeResourceTransformer collects and aggregates NOTICE files -->
- <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
- <projectName>Apache Flink</projectName>
- <encoding>UTF-8</encoding>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>