Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds longhorn-manager command patch #16

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions v1.7.0/longhorn-manager/longhorn-csi-plugin-command.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/csi/deployment.go b/csi/deployment.go
index 68ed5c5f2..b0e523a4a 100644
--- a/csi/deployment.go
+++ b/csi/deployment.go
@@ -375,7 +375,7 @@ func NewPluginDeployment(namespace, serviceAccount, nodeDriverRegistrarImage, li
},
},
},
- Args: []string{
+ Command: []string{
"longhorn-manager",
"-d",
"csi",
16 changes: 16 additions & 0 deletions v1.7.0/longhorn-manager/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ parts:
- CGO_ENABLED: 0
- VERSION: $CRAFT_PROJECT_VERSION
override-build: |
# NOTE(claudiub): The original longhorn-manager image doesn't have an entrypoint, only a CMD.
# This means that when the image is launched, it will run the CMD directly. Basically, the
# CMD is the ENTRYPOINT (binary + arguments). That works fine with the current deployments.
#
# longhorn-manager will create the daemonset.apps/longhorn-csi-plugin, which will
# have a longhorn-manager container, which doesn't override the entrypoint, only the
# args (aka CMD).
# But in our rock scenario, Pebble is the entrypoint, which will get those arguments and pass them
# on onto the service defined above. This results in an invalid command being run, something like:
# longhorn-manager -d daemon longhorn-manager -d csi --nodeid=...
#
# This patch updates the mentioned container args to command, overriding the Pebble entrypoint,
# avoiding this problem.
cp $CRAFT_PROJECT_DIR/longhorn-csi-plugin-command.patch ./
git apply -v longhorn-csi-plugin-command.patch

# https://github.com/longhorn/longhorn-manager/blob/v1.7.0/package/Dockerfile#L15
mkdir -p $CRAFT_PART_INSTALL/usr/local/sbin/
cp package/launch-manager package/nsmounter $CRAFT_PART_INSTALL/usr/local/sbin/
Expand Down
Loading