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

v4 slack webhook #865

Open
cfsnate opened this issue Mar 10, 2024 · 5 comments
Open

v4 slack webhook #865

cfsnate opened this issue Mar 10, 2024 · 5 comments

Comments

@cfsnate
Copy link

cfsnate commented Mar 10, 2024

hoping to send webhook to slack on sync, 400 error using built in webhook function per #508

no apt in v4 so can't install curl in a custom image to do a custom script

am I missing something?

@thockin
Copy link
Member

thockin commented Mar 10, 2024

I'm not AGAINST trying to find a way to make this work, if someone wants to contribute tests and an implementation.

@cfsnate
Copy link
Author

cfsnate commented Mar 10, 2024

I got curl working in quite an annoying and fragile way. but it works. files taken from stock debian bullseye

FROM registry.k8s.io/git-sync/git-sync:v4.2.1
USER root

ADD curl/binary/curl /usr/bin/curl

RUN chmod +x /usr/bin/curl

ADD curl/lib/libcurl.so.4.7.0 /usr/lib/aarch64-linux-gnu/libcurl.so.4

ADD curl/lib/libssl.so.1.1 /usr/lib/aarch64-linux-gnu/libssl.so.1.1

ADD curl/lib/libcrypto.so.1.1 /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1

ADD curl/lib/libldap_r-2.4.so.2.11.5 /usr/lib/aarch64-linux-gnu/libldap_r-2.4.so.2

ADD curl/lib/liblber-2.4.so.2.11.5 /usr/lib/aarch64-linux-gnu/liblber-2.4.so.2

ADD slack.sh /opt/slack.sh

RUN chmod +x /opt/slack.sh

USER git-sync

will play with this a bit more tomorrow

@thockin
Copy link
Member

thockin commented Mar 10, 2024

Alternatively:

  • we could offer a non-minimized Dockerfile and you could just build your own from that (meaning a much larger image)
  • we could offer a build with curl in it (57.8MB without, 58.9 with - minor)

If we want to include curl, I'd like an e2e test showing it works for some simple things (and doesn't drag in other deps, like git does :) Here's a starting point:

diff --git a/Dockerfile.in b/Dockerfile.in
index dadb69e..18fb5a3 100644
--- a/Dockerfile.in
+++ b/Dockerfile.in
@@ -60,6 +60,7 @@ RUN /stage_binaries.sh -o {ARG_STAGING} \
        -p git \
        -p openssh-client \
        -p ca-certificates \
+       -p curl \
        -p socat \
        -b /bin/grep \
        -b /bin/sed \

@matkovic
Copy link

Have exactly the same problems with sending notifications with webhook to slack. The way I managed to install curl into the image is with this

FROM curlimages/curl:8.6.0 AS curl_build

FROM registry.k8s.io/git-sync/git-sync:v4.1.0
USER root
COPY --from=curl_build /usr/bin/curl /usr/bin/curl
COPY --from=curl_build /usr/lib /usr/lib
COPY --from=curl_build /lib /lib

USER git-sync

curl command works, but have not tested it much yet. If I encounter problems, I can let you know

@thockin
Copy link
Member

thockin commented Mar 12, 2024

If someone can help craft an e2e that mimicks a slack integration, I could merge curl. I just want to make sure I don't add curl only to find it is missing some other helper package(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants