You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2022/06/29 16:40:51 UTC

[GitHub] [brooklyn-server] iuliana opened a new pull request, #1329: Added support for pull policy and docs

iuliana opened a new pull request, #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329

   As the title says.


-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] iuliana commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
iuliana commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r910804520


##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   @ahgittin `enum` it is then.



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] geomacy commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
geomacy commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r910449211


##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   surely it would be better to fail?



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] ahgittin commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
ahgittin commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r910735955


##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   agree - i'd say either:
   
   * always set the user-supplied value, let kubectl fail if it is invalid (good if they might add new valid args)
   * or if we are going to try to duplicate enforcement, use an enum and specify that as the type of the config key (allows type introspection to determine valid values)
   
   silently ignoring is going to confuse a user (esp if kubectl is case insensitive and we just drop things that don't match our arbitrary case!)
   



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] iuliana commented on pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
iuliana commented on PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#issuecomment-1170974277

   > 
   
   @ahgittin this should like a good idea, but the Job template has multiple levels. There are properties that you can add for `containers`, `spec`, `template` , etc.  `extra_kubectl_args` then would have to be a multi-level map, to cover these cases and this might complicate the `JobBuilder` implementation.  I guess it could be done, if really necessary. Maybe keep this for later after we have the core functionality working.


-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] ahgittin commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
ahgittin commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r910736542


##########
software/base/README.adoc:
##########
@@ -0,0 +1,108 @@
+////
+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.
+////
+
+= Apache Brooklyn Software Components

Review Comment:
   this belongs in `brooklyn-docs` project not here, no?



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] algairim commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
algairim commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r910638739


##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   @geomacy, the default policy that `kubectl` sets is 'Always'. And now, we simply allow to configure it.



##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   @iuliana, to remove that code comment `do not fail`?



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] iuliana commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
iuliana commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r910803557


##########
software/base/README.adoc:
##########
@@ -0,0 +1,108 @@
+////
+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.
+////
+
+= Apache Brooklyn Software Components

Review Comment:
   @ahgittin I wanted to put it as close to the changes being introduced. Currently these are targeted instruction for somebody working on this code, not working with the components being introduced, so not sure if all of it belongs in the official documentation.



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] iuliana merged pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
iuliana merged PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329


-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] geomacy commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
geomacy commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r912391592


##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   > [ahgittin](https://github.com/ahgittin) [2 days ago](https://github.com/apache/brooklyn-server/pull/1329#discussion_r910735955)  silently ignoring is going to confuse a user (esp if kubectl is case insensitive and we just drop things that don't match our arbitrary case!)
   
   That was my thought.
   
   > [iuliana](https://github.com/iuliana) [2 days ago](https://github.com/apache/brooklyn-server/pull/1329#discussion_r911071862)
   @geomacy Added enum for imagePullPolicy that validates the value, before the task is even created.
   
   looks great thanks @iuliana 



-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] ahgittin commented on pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
ahgittin commented on PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#issuecomment-1170908666

   good additions but a few comments.
   
   i also wonder if there is mileage in an "extra_kubectl_args" list config key for other things we don't support or which get added in future versions?  (that would have allowed pull policy to be specified without code changes here.)
   


-- 
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: dev-unsubscribe@brooklyn.apache.org

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


[GitHub] [brooklyn-server] iuliana commented on a diff in pull request #1329: Added support for pull policy and docs

Posted by GitBox <gi...@apache.org>.
iuliana commented on code in PR #1329:
URL: https://github.com/apache/brooklyn-server/pull/1329#discussion_r911071862


##########
software/base/src/main/java/org/apache/brooklyn/tasks/kubectl/JobBuilder.java:
##########
@@ -121,6 +130,11 @@ public String build(){
             containerSpec.setWorkingDir(workingDir);
         }
         containerSpec.setImage(imageName);
+        if(Strings.isNonBlank(imagePullPolicy)) {
+            if (PULL_POLICY_ALLOWED_VALUES.contains(imagePullPolicy)) {
+                containerSpec.setImagePullPolicy(imagePullPolicy);
+            } // else stick with default, do not fail

Review Comment:
   @geomacy Added enum for `imagePullPolicy` that validates the value, before the task is even created. 



-- 
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: dev-unsubscribe@brooklyn.apache.org

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