mh013370 commented on code in PR #8240:
URL: https://github.com/apache/nifi/pull/8240#discussion_r1453151525
##########
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:
Custom validation can be done through this method in the interface:
https://github.com/apache/nifi/blob/main/nifi-api/src/main/java/org/apache/nifi/components/AbstractConfigurableComponent.java#L44
The validation has to be done outside the `PropertyDescriptor` since the
value we care about is composed of `CONFIG_MAP_NAME_PREFIX` +
`CONFIG_MAP_CORE_NAME` + `componentId`
--
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]