Dennis-Mircea opened a new pull request, #1156:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1156

   ## What is the purpose of the change
   
   The Logback support added in FLINK-39501 (PR #1096) stores the 
logging-framework JARs under `$FLINK_HOME/log` via a dedicated `OPERATOR_LOG` 
env var, and the container entrypoint redundantly redefines `OPERATOR_LOG` 
(which is already inherited from the Dockerfile `ENV`).
   
   `$FLINK_HOME/log` is the conventional Flink log-output directory, so placing 
classpath JARs there is a category error. It is also latently fragile: mounting 
a volume at `/opt/flink/log` for log persistence would shadow the 
`log4j`/`logback` subdirectories, drop the selected logging JARs from the 
classpath, and break operator startup.
   
   This change moves the logging-framework JARs under the operator library 
directory (`$OPERATOR_LIB`) and removes the redundant env var, keeping 
`$FLINK_HOME/log` reserved for log output.
   
   ## Brief change log
   
   - `Dockerfile`: remove the `OPERATOR_LOG` env var, create 
`$OPERATOR_LIB/log4j` and `$OPERATOR_LIB/logback`, and copy the framework JARs 
there instead of `$FLINK_HOME/log/...`.
   - `docker-entrypoint.sh`: drop the redundant `OPERATOR_LOG` redefine and 
build `LOG_CLASSPATH` from `$OPERATOR_LIB/<framework>/*`.
   
   `OPERATOR_LIB` remains at `$FLINK_HOME/operator-lib`, kept separate from 
Flink's own `$FLINK_HOME/lib`.
   
   ## Verifying this change
   
   This change is image-layout only and does not alter runtime behavior with 
the default configuration.
   
   - Java's `-cp "$OPERATOR_LIB/*"` wildcard is non-recursive, so the 
`log4j`/`logback` subdirectories are not swept onto the classpath. Only the 
framework selected by `LOGGING_FRAMEWORK` is added explicitly, so there is no 
SLF4J multiple-binding conflict.
   - Manual verification: `docker build -t flink-kubernetes-operator .`, then 
confirm `/opt/flink/operator-lib/log4j` and `/opt/flink/operator-lib/logback` 
contain the expected JARs, the operator and webhook start (`docker run --rm 
flink-kubernetes-operator help`), and switching `LOGGING_FRAMEWORK=logback` 
puts the Logback JARs on the classpath.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changes to the `CustomResourceDescriptors`: 
no
     - Core observer or reconciler logic that is regularly executed: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to