Skip to content

Commit

Permalink
fix: Do not label ingress in managed OCP
Browse files Browse the repository at this point in the history
Signed-off-by: Denilson Nastacio <[email protected]>
  • Loading branch information
nastacio committed Mar 17, 2023
1 parent 871e55a commit 563167f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/cloudpaks/cp4i/install-prereqs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.0
version: 0.3.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ spec:
set -eo pipefail
set -x
is_managed_ocp=0
managed_ocp=$(oc get Infrastructure cluster \
-o jsonpath='{.status.platformStatus.*.resourceTags[?(@.key=="red-hat-managed")].value}' || is_managed_ocp=0)
if [ "${managed_ocp}" == "true" ]; then
echo "INFO: Do not attempt to adjust network policy for managed OCP environments."
exit 0
fi
default_policy=$(oc get namespace default -o jsonpath={.metadata.labels.'network\.openshift\.io/policy-group'}) \
|| {
echo "ERROR: Unable to get default ingress policy ."
Expand Down
4 changes: 2 additions & 2 deletions config/cloudpaks/cp4waiops/install-aimgr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ description: Cloud Pak for Watson AIOps - AI Manager
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

version: 0.13.0
version: 0.13.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 3.6.0
appVersion: 3.6.2
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ spec:
--from-file=.dockerconfigjson=/tmp/.dockerconfigjson
fi \
&& rm -rf /tmp/.dockerconfigjson \
&& if [ $(oc get ingresscontroller default -n openshift-ingress-operator -o jsonpath='{.status.endpointPublishingStrategy.type}') = "HostNetwork" ]; then
oc patch namespace default --type=json -p '[{"op":"add","path":"/metadata/labels","value":{"network.openshift.io/policy-group":"ingress"}}]'
fi \
|| result=1
is_managed_ocp=0
managed_ocp=$(oc get Infrastructure cluster \
-o jsonpath='{.status.platformStatus.*.resourceTags[?(@.key=="red-hat-managed")].value}' || is_managed_ocp=0)
if [ "${managed_ocp}" != "true" ]; then
if [ $(oc get ingresscontroller default -n openshift-ingress-operator -o jsonpath='{.status.endpointPublishingStrategy.type}') = "HostNetwork" ]; then
oc patch namespace default --type=json -p '[{"op":"add","path":"/metadata/labels","value":{"network.openshift.io/policy-group":"ingress"}}]'
fi \
|| result=1
fi
oc get ServiceAccount aiops-topology-service-account --namespace "${TARGET_NAMESPACE}" -o yaml 2> /dev/null \
&& echo "INFO: Topology service account exists." \
|| {
Expand Down
4 changes: 2 additions & 2 deletions config/cloudpaks/cp4waiops/install-emgr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.13.0
version: 0.13.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 3.6.0
appVersion: 3.6.2
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,19 @@ spec:
--from-file=.dockerconfigjson=/tmp/.dockerconfigjson
fi \
&& rm -rf /tmp/.dockerconfigjson \
&& if [ $(oc get ingresscontroller default -n openshift-ingress-operator -o jsonpath='{.status.endpointPublishingStrategy.type}') = "HostNetwork" ]; then
oc patch namespace default --type=json -p '[{"op":"add","path":"/metadata/labels","value":{"network.openshift.io/policy-group":"ingress"}}]'
fi \
&& echo "INFO: Event Manager prereq configuration successful." \
|| result=1
is_managed_ocp=0
managed_ocp=$(oc get Infrastructure cluster \
-o jsonpath='{.status.platformStatus.*.resourceTags[?(@.key=="red-hat-managed")].value}' || is_managed_ocp=0)
if [ "${managed_ocp}" != "true" ]; then
if [ $(oc get ingresscontroller default -n openshift-ingress-operator -o jsonpath='{.status.endpointPublishingStrategy.type}') = "HostNetwork" ]; then
oc patch namespace default --type=json -p '[{"op":"add","path":"/metadata/labels","value":{"network.openshift.io/policy-group":"ingress"}}]'
fi \
|| result=1
fi
# https://www.ibm.com/docs/en/noi/1.6.5?topic=preparing-your-cluster
oc get ServiceAccount noi-service-account --namespace "${TARGET_NAMESPACE}" -o yaml 2> /dev/null \
&& echo "INFO: NOI service account exists." \
Expand Down

0 comments on commit 563167f

Please sign in to comment.