from itertools import product
def generate_paintings():
colors = ['A', 'B', 'C', 'D']
hexagons = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7'] # 1 in the middle, 6 around
# Generate all possible combinations of colors for the hexagons
all_paintings = product(colors, repeat=7)
Python is not able to handle 2 different versions from the same package.
When Pip <20.3
finds an unresolvable dependency (resolves a dependecy to 2+ versions) then would not halt the installation process.
It’d successfully continue the process by installing the first matching dependency in the list of conflicts.
@SuppressWarnings("unchecked")
public static void setEnv(String key, String value) {
try {
Map<String, String> env = System.getenv();
Class<?> cl = env.getClass();
Field field = cl.getDeclaredField("m");
field.setAccessible(true);
Map<String, String> writableEnv = (Map<String, String>) field.get(env);
writableEnv.put(key, value);
$ kubectl get cert
NAME READY SECRET AGE
flink-operator-serving-cert True webhook-server-cert 91m
Flink version: 1.16-SNAPSHOT
Mockito version: 2.21.0
Powermock version: 2.0.9
- Both uses Bytebuddy.
- Powermock uses Mockito
- Install any container system like docker/Virtualbox/hyperkit
- Install minikube
mkdir -p ${HOME}/share
chmod 777 ${HOME}/share
minikube start --mount-string="${HOME}/share:/share" --mount
kubectl create clusterrolebinding flink-role-binding-default --clusterrole=edit --serviceaccount=default:default
kubectl create -f https://github.com/jetstack/cert-manager/releases/download/v1.8.2/cert-manager.yaml
Clone the necessary repos:
When the following job has started then the job fails because in submit time we don't know on which node
the job will run and the security.kerberos.spnego.principal=HTTP/[email protected]
is host specific.
flink run \
-yD security.kerberos.login.keytab=/cdep/keytabs/systest.keytab \
-yD [email protected] \
-yD security.spnego.auth.enabled=true \
-yt /var/run/cloudera-scm-agent/process/1546340184-flink-FLINK_HISTORY_SERVER/flink.keytab \
-yD security.kerberos.spnego.keytab=flink.keytab \
sun.net.www.protocol.http.NegotiateAuthentication
caches per host (and no port information in the key)
whether negotiation is supported or not (for instance SPNEGO). Worth to mention the cache is static (god knows why).
This is so far so good but can lead to issues in unit tests. For example:
- Developer writes a positive and negative test case for an SPNEGO protected server
- Normally the order of test cases are not defined
- Negative test case executes where SPNEGO turned off and expect 401
NegotiateAuthentication
stores false in a map- Negative test case pass
- Positive test case executes where SPNEGO turned on and expect 200
NegotiateAuthentication
gives baseisSupported
=false
from cache