diff --git a/.github/workflows/build_dev.yml b/.github/workflows/build_dev.yml index 9eb599bd..544f18e0 100644 --- a/.github/workflows/build_dev.yml +++ b/.github/workflows/build_dev.yml @@ -9,8 +9,10 @@ env: MODULES_REGISTRY_PASSWORD: ${{ secrets.DEV_MODULES_REGISTRY_PASSWORD }} SOURCE_REPO: "${{ secrets.SOURCE_REPO }}" + + on: - pull_request: + #pull_request: push: branches: - main @@ -18,6 +20,7 @@ on: # https://stackoverflow.com/a/71489231 workflow_call: + jobs: dev_setup_build: runs-on: [self-hosted, regular, selectel] diff --git a/images/agent/src/go.mod b/images/agent/src/go.mod index 75fe8fc8..38086fb1 100644 --- a/images/agent/src/go.mod +++ b/images/agent/src/go.mod @@ -3,7 +3,7 @@ module agent go 1.22.2 require ( - github.com/deckhouse/sds-node-configurator/api v0.0.0-20241205120718-db6ffba1689b + github.com/deckhouse/sds-node-configurator/api v0.0.0-20250114161813-c1a8b09cd47d github.com/go-logr/logr v1.4.2 github.com/google/go-cmp v0.6.0 github.com/gosimple/slug v1.14.0 diff --git a/images/agent/werf.inc.yaml b/images/agent/werf.inc.yaml index fe6c8467..02a734c1 100644 --- a/images/agent/werf.inc.yaml +++ b/images/agent/werf.inc.yaml @@ -1,10 +1,10 @@ -{{ $binaries := "/opt/deckhouse/sds/lib/libblkid.so.1 /opt/deckhouse/sds/lib/libmount.so.1 /opt/deckhouse/sds/lib/libsmartcols.so.1 /opt/deckhouse/sds/bin/nsenter.static /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /opt/deckhouse/sds/bin/lsblk.dynamic" }} +{{ $binaries := "/opt/deckhouse/sds/lib/libblkid.so.1 /opt/deckhouse/sds/lib/libmount.so.1 /opt/deckhouse/sds/lib/libsmartcols.so.1 /opt/deckhouse/sds/bin/nsenter.static /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 /opt/deckhouse/sds/bin/lsblk.dynamic /usr/lib/x86_64-linux-gnu/sys-root/lib64/ld-linux-x86-64.so.2" }} {{ $UTIL_LINUX_VERSION := "2.39.3" }} # Do not remove. It's used in external tests. --- image: {{ $.ImageName }}-src-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false git: @@ -29,7 +29,7 @@ shell: --- image: {{ $.ImageName }}-binaries-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false import: @@ -63,7 +63,8 @@ shell: automake \ gettext \ flex \ - glibc-core + glibc-core \ + cross-glibc-x86_64 - cd /src/util-linux - ./autogen.sh - ./configure LDFLAGS="-static" --enable-static-programs -disable-all-programs --enable-nsenter @@ -75,7 +76,9 @@ shell: - cp /lib64/libudev.so.1 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libudev.so.1 - cp /lib64/libc.so.6 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libc.so.6 - cp /lib64/libcap.so.2 /opt/deckhouse/sds/lib/x86_64-linux-gnu/libcap.so.2 - - cp /lib64/ld-2.32.so /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 + # There is no more such file in P11 with glibc-core that it was a part of. Now it's /usr/lib/x86_64-linux-gnu/sys-root/lib64/ld-linux-x86-64.so.2 + #- cp /lib64/ld-2.32.so /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 + - cp /usr/lib/x86_64-linux-gnu/sys-root/lib64/ld-linux-x86-64.so.2 /opt/deckhouse/sds/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 - cp /opt/deckhouse/sds/bin/lsblk /opt/deckhouse/sds/bin/lsblk.dynamic - chmod +x /binary_replace.sh - /binary_replace.sh -i "{{ $binaries }}" -o /relocate @@ -103,7 +106,7 @@ shell: --- image: {{ $.ImageName }}-distroless-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false shell: diff --git a/images/sds-health-watcher-controller/src/go.mod b/images/sds-health-watcher-controller/src/go.mod index 1bf9e924..dfb92840 100644 --- a/images/sds-health-watcher-controller/src/go.mod +++ b/images/sds-health-watcher-controller/src/go.mod @@ -4,7 +4,7 @@ go 1.22.3 require ( github.com/cloudflare/cfssl v1.5.0 - github.com/deckhouse/sds-node-configurator/api v0.0.0-20241205120718-db6ffba1689b + github.com/deckhouse/sds-node-configurator/api v0.0.0-20250114161813-c1a8b09cd47d github.com/go-logr/logr v1.4.2 github.com/prometheus/client_golang v1.19.1 github.com/stretchr/testify v1.9.0 diff --git a/images/sds-health-watcher-controller/src/pkg/kubutils/kubernetes.go b/images/sds-health-watcher-controller/src/pkg/kubutils/kubernetes.go index 20e1c16e..923d2033 100644 --- a/images/sds-health-watcher-controller/src/pkg/kubutils/kubernetes.go +++ b/images/sds-health-watcher-controller/src/pkg/kubutils/kubernetes.go @@ -24,13 +24,20 @@ import ( ) func KubernetesDefaultConfigCreate() (*rest.Config, error) { + // err is either nil and we return config or its value doesn't matter for us here + config, err := rest.InClusterConfig() + if err == nil { + return config, nil + } + clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}, ) // Get a config to talk to API server - config, err := clientConfig.ClientConfig() + config, err = clientConfig.ClientConfig() + if err != nil { return nil, fmt.Errorf("config kubernetes error %w", err) } diff --git a/images/sds-health-watcher-controller/werf.inc.yaml b/images/sds-health-watcher-controller/werf.inc.yaml index ee51d8f8..c3f92199 100644 --- a/images/sds-health-watcher-controller/werf.inc.yaml +++ b/images/sds-health-watcher-controller/werf.inc.yaml @@ -3,7 +3,7 @@ # Do not remove. It's used in external tests. --- image: {{ $.ImageName }}-src-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false git: @@ -46,7 +46,7 @@ shell: --- image: {{ $.ImageName }}-distroless-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false shell: diff --git a/images/sds-utils-installer/werf.inc.yaml b/images/sds-utils-installer/werf.inc.yaml index 6a3b9729..caac4b12 100644 --- a/images/sds-utils-installer/werf.inc.yaml +++ b/images/sds-utils-installer/werf.inc.yaml @@ -4,7 +4,7 @@ # Do not remove. It's used in external tests. --- image: {{ $.ImageName }}-src-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false git: @@ -30,7 +30,7 @@ shell: --- image: {{ $.ImageName }}-binaries-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false import: @@ -94,7 +94,7 @@ shell: --- image: {{ $.ImageName }}-distroless-artifact -from: {{ $.Root.BASE_ALT }} +from: {{ $.Root.BASE_ALT_P11 }} final: false shell: