From 7ecddc8d2b24d6fa0ccde2b9631f4886e68e8c9b Mon Sep 17 00:00:00 2001 From: Angelos Kolaitis Date: Tue, 27 Feb 2024 17:21:02 +0200 Subject: [PATCH] cleanup configs from unused snap --- config/csr-dqlite.conf.template | 28 ----------------- config/default-args | 1 - snap/hooks/install | 24 --------------- snap/snapcraft.yaml | 54 --------------------------------- 4 files changed, 107 deletions(-) delete mode 100644 config/csr-dqlite.conf.template delete mode 100644 config/default-args delete mode 100644 snap/hooks/install delete mode 100644 snap/snapcraft.yaml diff --git a/config/csr-dqlite.conf.template b/config/csr-dqlite.conf.template deleted file mode 100644 index fe969c88..00000000 --- a/config/csr-dqlite.conf.template +++ /dev/null @@ -1,28 +0,0 @@ -[ req ] -default_bits = 2048 -prompt = no -default_md = sha256 -req_extensions = req_ext -distinguished_name = dn - -[ dn ] -C = GB -ST = Canonical -L = Canonical -O = Canonical -OU = Canonical -CN = k8s - -[ req_ext ] -subjectAltName = @alt_names - -[ alt_names ] -DNS = HOSTNAME -IP = HOSTIP - -[ v3_ext ] -authorityKeyIdentifier=keyid,issuer:always -basicConstraints=CA:FALSE -keyUsage=keyEncipherment,dataEncipherment,digitalSignature -extendedKeyUsage=serverAuth,clientAuth -subjectAltName=@alt_names diff --git a/config/default-args b/config/default-args deleted file mode 100644 index 40839198..00000000 --- a/config/default-args +++ /dev/null @@ -1 +0,0 @@ ---storage-dir=${SNAP_DATA}/var/data/ diff --git a/snap/hooks/install b/snap/hooks/install deleted file mode 100644 index a053e808..00000000 --- a/snap/hooks/install +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -ARCH="$($SNAP/bin/uname -m)" -export LD_LIBRARY_PATH="$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu" -export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH:/usr/bin:/usr/local/bin" - -mkdir -p ${SNAP_DATA}/args/ -cp ${SNAP}/config/default-args ${SNAP_DATA}/args/k8s-dqlite - -mkdir -p ${SNAP_DATA}/var/data/ -IP="127.0.0.1" -# To configure dqlite do: -# echo "Address: 1.2.3.4:6364" > $STORAGE_DIR/update.yaml -# after the initialisation but before connecting other nodes -echo "Address: $IP:29001" > ${SNAP_DATA}/var/data/init.yaml -DNS=$($SNAP/bin/hostname) -mkdir -p $SNAP_DATA/var/tmp/ -cp $SNAP/config/csr-dqlite.conf.template $SNAP_DATA/var/tmp/csr-dqlite.conf -$SNAP/bin/sed -i 's/HOSTNAME/'"${DNS}"'/g' $SNAP_DATA/var/tmp/csr-dqlite.conf -$SNAP/bin/sed -i 's/HOSTIP/'"${IP}"'/g' $SNAP_DATA/var/tmp/csr-dqlite.conf -${SNAP}/usr/bin/openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout ${SNAP_DATA}/var/data/cluster.key -out ${SNAP_DATA}/var/data/cluster.crt -subj "/CN=k8s" -config $SNAP_DATA/var/tmp/csr-dqlite.conf -extensions v3_ext -chmod -R o-rwX ${SNAP_DATA}/var/data diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml deleted file mode 100644 index aa2ceece..00000000 --- a/snap/snapcraft.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: k8s-dqlite -version: latest -summary: Dqlite for Kubernetes -description: |- - Kubernetes data store based on dqlite. - -grade: stable -confinement: classic -base: core20 - -apps: - daemon-dqlite: - command: wrappers/run-dqlite-with-args - daemon: simple - -parts: - k8s-dqlite: - plugin: nil - source: . - override-build: | - snap install go --classic --channel 1.20/stable - - sudo apt update - sudo apt install -y make - - make static -j - - mkdir -p $SNAPCRAFT_PRIME/bin - cp bin/static/k8s-dqlite $SNAPCRAFT_PRIME/bin/k8s-dqlite - cp bin/static/dqlite $SNAPCRAFT_PRIME/bin/dqlite - - k8s-dqlite-daemon: - source: . - plugin: nil - override-build: | - set -x - mkdir -p $SNAPCRAFT_STAGE/wrappers - mkdir -p $SNAPCRAFT_STAGE/config - cp -r $SNAPCRAFT_PROJECT_DIR/wrappers/* $SNAPCRAFT_STAGE/wrappers - cp -r $SNAPCRAFT_PROJECT_DIR/config/* $SNAPCRAFT_STAGE/config - prime: - - wrappers/run-dqlite-with-args - - config/csr-dqlite.conf.template - - config/default-args - - bash-utils: - source: snap - plugin: dump - stage-packages: - - sed - - grep - - hostname - - coreutils - - openssl