You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/03/03 10:09:39 UTC

[GitHub] [solr-operator] janhoy opened a new pull request #411: ArgoCD support. (Fixes #410)

janhoy opened a new pull request #411:
URL: https://github.com/apache/solr-operator/pull/411


   Add an annotation to our CRDs that will make ArgoCD replace instead of apply.


-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] HoustonPutman merged pull request #411: Add operator version & ArgoCD annotations to CRDs

Posted by GitBox <gi...@apache.org>.
HoustonPutman merged pull request #411:
URL: https://github.com/apache/solr-operator/pull/411


   


-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] HoustonPutman commented on pull request #411: ArgoCD support. (Fixes #410)

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on pull request #411:
URL: https://github.com/apache/solr-operator/pull/411#issuecomment-1058265634


   As I mentioned in the issue, the Solr CRDs are auto-generated by controller-gen, so we need to go through and add the annotations after the generation. (Until controller-gen supports adding CRD annotations)
   
   Will look into how this could work


-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] HoustonPutman commented on pull request #411: ArgoCD support. (Fixes #410)

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on pull request #411:
URL: https://github.com/apache/solr-operator/pull/411#issuecomment-1062143805


   @janhoy hacked together something that should work for our uses. I also included the version of the operator that the CRDs were made for, which will let users debug and make sure they have the correct CRD installed.
   
   Also I did it in a way that it's done for the helm chart CRD file as well, since users using that are likely to have un-upgraded CRDs installed, so they need the version annotation more than anyone else.
   
   Also included a small fix for the release wizard that I had locally


-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] HoustonPutman commented on pull request #411: Add operator version & ArgoCD annotations to CRDs

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on pull request #411:
URL: https://github.com/apache/solr-operator/pull/411#issuecomment-1062218896


   The Zookeeper Operator CRD annotations won't be overwritten anymore either, and will be included in the release-artifacts.


-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] janhoy commented on pull request #411: Add operator version & ArgoCD annotations to CRDs

Posted by GitBox <gi...@apache.org>.
janhoy commented on pull request #411:
URL: https://github.com/apache/solr-operator/pull/411#issuecomment-1062196505


   Looks good, feel free to take over the PR and merge when done


-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] HoustonPutman commented on a change in pull request #411: Add operator version & ArgoCD annotations to CRDs

Posted by GitBox <gi...@apache.org>.
HoustonPutman commented on a change in pull request #411:
URL: https://github.com/apache/solr-operator/pull/411#discussion_r822076770



##########
File path: hack/config/add_crds_annotations.sh
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+# exit immediately when a command fails
+set -e
+# only exit with zero if all commands of the pipeline exit successfully
+set -o pipefail
+# error on unset variables
+set -u
+
+echo "Add annotations to CRDs"
+
+rm -f "${CONFIG_DIRECTORY:-config}"/crd/bases/*.tmp
+
+files=("${CONFIG_DIRECTORY:-config}"/crd/bases/*)
+
+# Copy and package CRDs
+for file in "${files[@]}"; do
+  {
+    cat "${file}" | sed -e "/^    controller-gen.kubebuilder.io.version.*/a \\
+    operator.solr.apache.org\\/version: ${VERSION}\\
+    argocd.argoproj.io\\/sync-options: Replace=true"
+  } > "${file}.tmp" && mv "${file}.tmp" "${file}"

Review comment:
       Yeah, `sed` differences between OSX and linux drive me insane, especially the `-i`, so it's not used anywhere in the solr-operator scripts. This works for now so I'm happy enough with it, we can always improve it in the future 🙂 




-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr-operator] janhoy commented on a change in pull request #411: Add operator version & ArgoCD annotations to CRDs

Posted by GitBox <gi...@apache.org>.
janhoy commented on a change in pull request #411:
URL: https://github.com/apache/solr-operator/pull/411#discussion_r822058570



##########
File path: hack/config/add_crds_annotations.sh
##########
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# 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.
+
+# exit immediately when a command fails
+set -e
+# only exit with zero if all commands of the pipeline exit successfully
+set -o pipefail
+# error on unset variables
+set -u
+
+echo "Add annotations to CRDs"
+
+rm -f "${CONFIG_DIRECTORY:-config}"/crd/bases/*.tmp
+
+files=("${CONFIG_DIRECTORY:-config}"/crd/bases/*)
+
+# Copy and package CRDs
+for file in "${files[@]}"; do
+  {
+    cat "${file}" | sed -e "/^    controller-gen.kubebuilder.io.version.*/a \\
+    operator.solr.apache.org\\/version: ${VERSION}\\
+    argocd.argoproj.io\\/sync-options: Replace=true"
+  } > "${file}.tmp" && mv "${file}.tmp" "${file}"

Review comment:
       `sed -i` would do it in-place but may not work on some OSes




-- 
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-unsubscribe@solr.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org