Skip to content

Commit

Permalink
DO NOT MERGE: Ironic hack
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Hernandez <[email protected]>
  • Loading branch information
jhernand committed Mar 20, 2024
1 parent 3fbe178 commit 236426d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .containerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
!/cmd
!/api
!/bundle
!/ironic-hack.patch
33 changes: 33 additions & 0 deletions Containerfile.ironic-hack
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This is a hack to enable compression in the Ironic container used by the baremetal operator of
# OpenShift. To use it build and push the image to your registry server:
#
# $ podman build -t quay.io/myuser/ironic-hack:1 -f Containerfile.ironic-hack
# $ podman push quay.io/myuser/ironic-hack:1
#
# Then change the `cluster-baremetal-operator-images` configmap in the `openshift-machine-api`
# namespace. It contains a JSON document with a `baremetalIrinic` field that needs to be changed to
# `quay.io/myuser/ironic-hack:1`. Then delete the `metal3` deployment to force the operator to
# recreate it with the new image:
#
# $ oc edit -n openshift-machine-api cluster-baremetal-operator-images
# $ oc delete deployment -n openshift-machine-api metal3

# Start from the Ironic image currently used by the baremetal operator, so that we don't need to
# fully rebuild it.
FROM \
quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:42a7f567c3fdb76b2020f1a3ea95543e02b7c0234b1697b7c7301cbbd5074012

# Install required packages:
RUN \
dnf -y install patch && \
dnf -y clean all

# Apply the patch that enables compression for the communication with the BMC. This is necessary
# because HPE iLO currently requires compression support for retrieving certain registries, in
# particular the BIOS attributes registry.
COPY \
ironic-hack.patch \
/tmp
RUN \
cd /usr/lib/python3.9/site-packages; \
patch -p1 < /tmp/ironic-hack.patch
13 changes: 13 additions & 0 deletions ironic-hack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sushy/connector.py b/sushy/connector.py
index 75b341c..efa2e6d 100644
--- a/sushy/connector.py
+++ b/sushy/connector.py
@@ -59,7 +59,7 @@ class Connector(object):
# interaction with the BMC. Setting to identity basically means
# "without modification or compression". By default, python-requests
# indicates responses can be compressed.
- self._session.headers['Accept-Encoding'] = 'identity'
+ #self._session.headers['Accept-Encoding'] = 'identity'

if username or password:
LOG.warning('Passing username and password to Connector is '

0 comments on commit 236426d

Please sign in to comment.