mh013370 commented on code in PR #8240:
URL: https://github.com/apache/nifi/pull/8240#discussion_r1453076148
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-kubernetes-bundle/nifi-framework-kubernetes-state-provider/src/main/java/org/apache/nifi/kubernetes/state/provider/KubernetesConfigMapStateProvider.java:
##########
@@ -99,6 +118,12 @@ public void initialize(final
StateProviderInitializationContext context) {
this.logger = context.getLogger();
this.kubernetesClient = getKubernetesClient();
this.namespace = new ServiceAccountNamespaceProvider().getNamespace();
+
+ String configMapNamePrefix =
context.getProperty(CONFIG_MAP_NAME_PREFIX).isSet() ?
context.getProperty(CONFIG_MAP_NAME_PREFIX).getValue() : null;
+ CONFIG_MAP_NAME_FORMAT = configMapNamePrefix != null
+ ? String.format("%s-%s-%%s", configMapNamePrefix,
CONFIG_MAP_CORE_NAME) : String.format("%s-%%s", CONFIG_MAP_CORE_NAME);
+ CONFIG_MAP_NAME_PATTERN = Pattern.compile(configMapNamePrefix != null
+ ? String.format("^%s-%s-(.+)$", configMapNamePrefix,
CONFIG_MAP_CORE_NAME) : String.format("^%s-(.+)$", CONFIG_MAP_CORE_NAME));
Review Comment:
We ought to validate that the name length doesn't exceed 253 characters and
that it fits the Kubernetes name constraints:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#:~:text=Most%20resource%20types%20require%20a,alphanumeric%20characters%2C%20'%2D'%20or%20'.
--
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]