gyfora commented on code in PR #192:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/192#discussion_r866867020


##########
docs/content/docs/operations/validator.md:
##########
@@ -0,0 +1,85 @@
+---
+title: "Validator"
+weight: 5
+type: docs
+aliases:
+- /operations/validator.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Custom `FlinkResourceValidator` implementation
+
+`FlinkResourceValidator`, an interface for validating the resources of 
`FlinkDeployment` and `FlinkSessionJob`,  is a pluggable component based on the 
[Plugins](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/filesystems/plugins)
 mechanism. During development, we can custom the implementation of 
`FlinkResourceValidator` and make sure to retain the service definition in 
`META-INF/services`. 

Review Comment:
   typo: `we can custom the implementation` -> `we can customize the 
implementation`



##########
docs/content/docs/operations/validator.md:
##########
@@ -0,0 +1,85 @@
+---
+title: "Validator"
+weight: 5
+type: docs
+aliases:
+- /operations/validator.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Custom `FlinkResourceValidator` implementation
+
+`FlinkResourceValidator`, an interface for validating the resources of 
`FlinkDeployment` and `FlinkSessionJob`,  is a pluggable component based on the 
[Plugins](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/filesystems/plugins)
 mechanism. During development, we can custom the implementation of 
`FlinkResourceValidator` and make sure to retain the service definition in 
`META-INF/services`. 
+The following steps demonstrate how to develop and use a custom validator.
+
+1. Implement `FlinkResourceValidator` interface:
+    ```java
+    package org.apache.flink.kubernetes.operator.validation;
+   
+    import org.apache.flink.kubernetes.operator.crd.FlinkDeployment;
+    import org.apache.flink.kubernetes.operator.crd.FlinkSessionJob;
+   
+    import java.util.Optional;
+   
+    /** Custom validator implementation of {@link FlinkResourceValidator}. */
+    public class CustomValidator implements FlinkResourceValidator {
+   
+        @Override
+        public Optional<String> validateDeployment(FlinkDeployment deployment) 
{
+            return Optional.empty();

Review Comment:
   Can we demonstrate some actual custom validation here? A simple if check 
with an error would be enough



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to