Remove yq build dependency (#51019)

This commit is contained in:
Peter Matseykanets
2025-07-15 14:53:03 -04:00
committed by GitHub
parent d6cc235345
commit f6fba524db
9 changed files with 19 additions and 62 deletions

View File

@@ -9,11 +9,6 @@ runs:
if [[ "$ARCH" == "x64" ]]; then
echo "ARCH=amd64" >> $GITHUB_ENV
fi
- name: install yq
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
use-sudo: true
- id: env
name: Setup Dependencies Env Variables
uses: ./.github/actions/setup-build-env

View File

@@ -9,11 +9,6 @@ runs:
if [[ "$ARCH" == "x64" ]]; then
echo "ARCH=amd64" >> $GITHUB_ENV
fi
- name: install yq
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
use-sudo: true
- name: Setup Environment Variables
uses: ./.github/actions/setup-tag-env
- id: env

View File

@@ -1,21 +0,0 @@
name: "Install yq"
description: "Install yq from source"
inputs:
version:
description: "yq version"
default: v4.45.1
arch:
description: "host arch"
required: true
use-sudo:
description: "use sudo to move the yq binary"
default: false
runs:
using: "composite"
steps:
- name: install yq
shell: bash
run: |
curl -fsL https://github.com/mikefarah/yq/releases/download/${{ inputs.version }}/yq_linux_${{ inputs.arch }}.tar.gz | tar xz
${{ inputs.use-sudo == 'true' && 'sudo' || '' }} mv yq_linux_${{ inputs.arch }} /usr/bin/yq

View File

@@ -9,10 +9,6 @@ runs:
run: zypper install -y jq awk aws-cli
- name: Setup Tag Env Variables
uses: ./.github/actions/setup-tag-env
- name: install yq
uses: ./.github/actions/install-yq
with:
arch: ${{ env.ARCH }}
- id: env
name: Setup Dependencies Env Variables
uses: ./.github/actions/setup-build-env

View File

@@ -7,17 +7,17 @@ set -x
# variables
COMMIT=$(git rev-parse --short HEAD)
TAG="${TAG:-$(yq '.env.TAG | sub("-.*", "")' < .github/workflows/pull-request.yml)-${COMMIT}}-head"
TAG="${TAG:-$(grep -m1 ' TAG:' .github/workflows/pull-request.yml | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/\${{ github.sha }}/$COMMIT/g" | cut -d' ' -f)-${COMMIT}}-head"
OS="${OS:-linux}"
ARCH="${ARCH:-amd64}"
REPO="${REPO:-rancher}"
CATTLE_K3S_VERSION=$(grep -m1 'ENV CATTLE_K3S_VERSION=' package/Dockerfile | cut -d '=' -f2)
CATTLE_KDM_BRANCH=$(grep -m1 'ARG CATTLE_KDM_BRANCH=' package/Dockerfile | cut -d '=' -f2)
CATTLE_RANCHER_WEBHOOK_VERSION=$(yq '.webhookVersion' < build.yaml)
CATTLE_REMOTEDIALER_PROXY_VERSION=$(yq '.remoteDialerProxyVersion' < build.yaml)
CATTLE_CSP_ADAPTER_MIN_VERSION=$(yq '.cspAdapterMinVersion' < build.yaml)
CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(yq '.provisioningCAPIVersion' < build.yaml)
CATTLE_FLEET_VERSION=$(yq '.fleetVersion' < build.yaml)
CATTLE_RANCHER_WEBHOOK_VERSION=$(grep -m1 'webhookVersion' build.yaml | cut -d ' ' -f2)
CATTLE_REMOTEDIALER_PROXY_VERSION=$(grep -m1 'remoteDialerProxyVersion' build.yaml | cut -d ' ' -f2)
CATTLE_CSP_ADAPTER_MIN_VERSION=$(grep -m1 'cspAdapterMinVersion' build.yaml | cut -d ' ' -f2)
CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(grep -m1 'provisioningCAPIVersion' build.yaml | cut -d ' ' -f2)
CATTLE_FLEET_VERSION=$(grep -m1 'fleetVersion' build.yaml | cut -d ' ' -f2)
# download airgap images and export it to a tarball
curl -Lf https://github.com/rancher/k3s/releases/download/"${CATTLE_K3S_VERSION}"/k3s-images.txt -o ./k3s-images.txt

View File

@@ -29,8 +29,7 @@ webhookVersion: 2.0.6+up0.3.6-rc1
Then update the [export-config](../scripts/export-config) script.
```
CATTLE_RANCHER_WEBHOOK_VERSION=$(yq -e '.webhookVersion' "$file")
export CATTLE_RANCHER_WEBHOOK_VERSION
export CATTLE_RANCHER_WEBHOOK_VERSION=$(grep -m1 'webhookVersion' < "$file" | cut -d ' ' -f2)
```
Run `go generate` from the root of the repo.

View File

@@ -8,16 +8,9 @@ fi
file="$(git rev-parse --show-toplevel)/build.yaml"
CATTLE_RANCHER_WEBHOOK_VERSION=$(yq -e '.webhookVersion' "$file")
CATTLE_REMOTEDIALER_PROXY_VERSION=$(yq -e '.remoteDialerProxyVersion' "$file")
CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(yq -e '.provisioningCAPIVersion' "$file")
CATTLE_CSP_ADAPTER_MIN_VERSION=$(yq -e '.cspAdapterMinVersion' "$file")
CATTLE_DEFAULT_SHELL_VERSION=$(yq -e '.defaultShellVersion' "$file")
CATTLE_FLEET_VERSION=$(yq -e '.fleetVersion' "$file")
export CATTLE_RANCHER_WEBHOOK_VERSION
export CATTLE_REMOTEDIALER_PROXY_VERSION
export CATTLE_RANCHER_PROVISIONING_CAPI_VERSION
export CATTLE_CSP_ADAPTER_MIN_VERSION
export CATTLE_DEFAULT_SHELL_VERSION
export CATTLE_FLEET_VERSION
export CATTLE_RANCHER_WEBHOOK_VERSION=$(grep -m1 'webhookVersion' "$file" | cut -d ' ' -f2)
export CATTLE_REMOTEDIALER_PROXY_VERSION=$(grep -m1 'remoteDialerProxyVersion' "$file" | cut -d ' ' -f2)
export CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(grep -m1 'provisioningCAPIVersion' "$file" | cut -d ' ' -f2)
export CATTLE_CSP_ADAPTER_MIN_VERSION=$(grep -m1 'cspAdapterMinVersion' "$file" | cut -d ' ' -f2)
export CATTLE_DEFAULT_SHELL_VERSION=$(grep -m1 'defaultShellVersion' "$file" | cut -d ' ' -f2)
export CATTLE_FLEET_VERSION=$(grep -m1 'fleetVersion' "$file" | cut -d ' ' -f2)

View File

@@ -82,11 +82,11 @@ eval "$(grep '^ENV CATTLE_SYSTEM_AGENT_DOWNLOAD_PREFIX' package/Dockerfile | awk
eval "$(grep '^ENV CATTLE_SYSTEM_AGENT_VERSION' package/Dockerfile | awk '{print "export " $2}')"
eval "$(grep '^ENV CATTLE_SYSTEM_AGENT_UPGRADE_IMAGE' package/Dockerfile | awk '{print "export " $2}')"
export CATTLE_RANCHER_WEBHOOK_VERSION=$(yq '.webhookVersion' < build.yaml)
export CATTLE_REMOTEDIALER_PROXY_VERSION=$(yq '.remoteDialerProxyVersion' < build.yaml)
export CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(yq '.provisioningCAPIVersion' < build.yaml)
export CATTLE_CSP_ADAPTER_MIN_VERSION=$(yq '.cspAdapterMinVersion' < build.yaml)
export CATTLE_FLEET_VERSION=$(yq '.fleetVersion' < build.yaml)
export CATTLE_RANCHER_WEBHOOK_VERSION=$(grep -m1 'webhookVersion' build.yaml | cut -d ' ' -f2)
export CATTLE_REMOTEDIALER_PROXY_VERSION=$(grep -m1 'remoteDialerProxyVersion' build.yaml | cut -d ' ' -f2)
export CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(grep -m1 'provisioningCAPIVersion' build.yaml | cut -d ' ' -f2)
export CATTLE_CSP_ADAPTER_MIN_VERSION=$(grep -m1 'cspAdapterMinVersion' build.yaml | cut -d ' ' -f2)
export CATTLE_FLEET_VERSION=$(grep -m1 'fleetVersion' build.yaml | cut -d ' ' -f2)
if [ -z "${SOME_K8S_VERSION}" ]; then
# Only set SOME_K8S_VERSION if it is empty -- for KDM provisioning tests, this value should already be populated

View File

@@ -55,7 +55,7 @@ eval "$(grep '^ENV CATTLE_WINS_AGENT' package/Dockerfile | awk '{print "export "
eval "$(grep '^ENV CATTLE_CSI_PROXY_AGENT' package/Dockerfile | awk '{print "export " $2}')"
eval "$(grep '^ENV CATTLE_KDM_BRANCH' package/Dockerfile | awk '{print "export " $2}')"
export CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(yq '.provisioningCAPIVersion' < build.yaml)
export CATTLE_RANCHER_PROVISIONING_CAPI_VERSION=$(grep -m1 'provisioningCAPIVersion' build.yaml | cut -d ' ' -f2)
if [ -z "${SOME_K8S_VERSION}" ]; then
# Get the last release for $DIST, which is usually the latest version or an experimental version.