From 43f588e633f523f8c3a17536f596de8b3b495185 Mon Sep 17 00:00:00 2001 From: Stacky McStackface Date: Mon, 11 Dec 2023 09:03:25 +0000 Subject: [PATCH] Generated commit to update templated files based on rev 9bfa771 in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: sbernauer with message [Bump Rust to 1.74.0 and user-info-fetcher templating] --- .github/pull_request_template.md | 3 ++- .github/workflows/build.yml | 14 +++++++------- Tiltfile | 7 +++++++ default.nix | 15 ++++++++------- .../commons-operator/templates/deployment.yaml | 11 +++++++++-- nix/sources.json | 6 +++--- rust-toolchain.toml | 2 +- 7 files changed, 37 insertions(+), 21 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6a5be7e..af7c0f6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -12,6 +12,7 @@ # Author - [ ] Changes are OpenShift compatible - [ ] CRD changes approved +- [ ] CRD documentation for all fields, following the [style guide](https://docs.stackable.tech/home/nightly/contributor/style-guide). - [ ] Helm chart can be installed and deployed operator works - [ ] Integration tests passed (for non trivial changes) - [ ] Changes need to be "offline" compatible @@ -21,7 +22,7 @@ # Reviewer - [ ] Code contains useful comments - [ ] (Integration-)Test cases added -- [ ] Documentation added or updated +- [ ] Documentation added or updated. Follows the [style guide](https://docs.stackable.tech/home/nightly/contributor/style-guide). - [ ] Changelog updated - [ ] Cargo.toml only contains references to git tags (not specific commits or branches) ``` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6107f3a..677c436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.71.0 + - uses: dtolnay/rust-toolchain@1.74.0 - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 with: key: udeps @@ -121,7 +121,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.71.0 + - uses: dtolnay/rust-toolchain@1.74.0 with: components: rustfmt - run: cargo fmt --all -- --check @@ -137,7 +137,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.71.0 + - uses: dtolnay/rust-toolchain@1.74.0 with: components: clippy - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 @@ -170,7 +170,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.71.0 + - uses: dtolnay/rust-toolchain@1.74.0 with: components: rustfmt - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 @@ -190,7 +190,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.71.0 + - uses: dtolnay/rust-toolchain@1.74.0 - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 with: key: test @@ -252,7 +252,7 @@ jobs: with: version: v3.6.2 - name: Set up cargo - uses: dtolnay/rust-toolchain@1.71.0 + uses: dtolnay/rust-toolchain@1.74.0 - name: Set up rust-cache uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 with: @@ -310,7 +310,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.71.0 + - uses: dtolnay/rust-toolchain@1.74.0 with: components: rustfmt # This step checks if the current run was triggered by a push to a pr (or a pr being created). diff --git a/Tiltfile b/Tiltfile index 4d9cc0e..60aa77c 100644 --- a/Tiltfile +++ b/Tiltfile @@ -22,6 +22,8 @@ watch_file('result') if os.path.exists('result'): k8s_yaml('result/crds.yaml') +k8s_kind('Deployment', image_json_path='{.spec.template.metadata.annotations.internal\\.stackable\\.tech/image}') + # Exclude stale CRDs from Helm chart, and apply the rest helm_crds, helm_non_crds = filter_yaml( helm( @@ -36,3 +38,8 @@ helm_crds, helm_non_crds = filter_yaml( kind = "^CustomResourceDefinition$", ) k8s_yaml(helm_non_crds) + +{[% if operator.product_string in ['opa'] %}] +# k8s_yaml('docs/modules/opa/examples/getting_started/opa.yaml') +# k8s_resource(new_name='simple-opa', objects=['simple-opa:OpaCluster'], extra_pod_selectors=[{'app.kubernetes.io/name': 'opa'}], port_forwards=['8081:8081', '9476:9476']) +{[% endif %}] diff --git a/default.nix b/default.nix index 975f618..b7a823a 100644 --- a/default.nix +++ b/default.nix @@ -20,17 +20,18 @@ nativeBuildInputs = [ pkgs.pkg-config ]; buildInputs = [ pkgs.krb5 ]; LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; - BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/${pkgs.lib.getVersion pkgs.clang.cc}/include"; + # Clang's resource directory is located at ${pkgs.clang.cc.lib}/lib/clang/. + # Starting with Clang 16, only the major version is used for the resource directory, + # whereas the full version was used in prior Clang versions (see + # https://github.com/llvm/llvm-project/commit/e1b88c8a09be25b86b13f98755a9bd744b4dbf14). + # The clang wrapper ${pkgs.clang} provides a symlink to the resource directory, which + # we use instead. + BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang}/resource-root/include"; }; libgssapi-sys = attrs: { buildInputs = [ pkgs.krb5 ]; LIBCLANG_PATH = "${pkgs.libclang.lib}/lib"; - BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/${pkgs.lib.getVersion pkgs.clang.cc}/include"; - }; - # FIXME: Remove when https://github.com/NixOS/nixpkgs/pull/266787 is merged. - # See https://github.com/stackabletech/operator-templating/pull/289 for details. - ring = attrs: { - CARGO_MANIFEST_LINKS = attrs.links; + BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang}/resource-root/include"; }; }; } diff --git a/deploy/helm/commons-operator/templates/deployment.yaml b/deploy/helm/commons-operator/templates/deployment.yaml index 44bfa1c..f60334c 100644 --- a/deploy/helm/commons-operator/templates/deployment.yaml +++ b/deploy/helm/commons-operator/templates/deployment.yaml @@ -14,11 +14,12 @@ spec: {{- include "operator.selectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.podAnnotations }} annotations: + internal.stackable.tech/image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- with .Values.podAnnotations }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} labels: {{- include "operator.selectorLabels" . | nindent 8 }} spec: @@ -40,6 +41,12 @@ spec: volumeMounts: - mountPath: /etc/stackable/{{ include "operator.appname" . }}/config-spec name: config-spec + env: + - name: OPERATOR_IMAGE + # Tilt can use annotations as image paths, but not env variables + valueFrom: + fieldRef: + fieldPath: metadata.annotations['internal.stackable.tech/image'] volumes: - name: config-spec configMap: diff --git a/nix/sources.json b/nix/sources.json index 465276e..92a5322 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,10 +17,10 @@ "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "676fe5e01b9a41fa14aaa48d87685677664104b1", - "sha256": "0afm0dvqrjzdxhilhg0x9rbw8apfd5yg79f4qpdmdfzd8h68h72i", + "rev": "3f21a22b5aafefa1845dec6f4a378a8f53d8681c", + "sha256": "15y8k3hazg91kscbmn7dy6m0q6zvmhlvvhg97gcl5kw87y0svzxk", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/676fe5e01b9a41fa14aaa48d87685677664104b1.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/3f21a22b5aafefa1845dec6f4a378a8f53d8681c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index aa46426..639f4f1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.71.0" +channel = "1.74.0"