Skip to content

Commit

Permalink
Merge branch 'main' into update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lou-lan authored Jul 26, 2024
2 parents 63be87c + 8390880 commit 3bcf4f9
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 72 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download Chart Artifact
uses: actions/[email protected].7
uses: actions/[email protected].8
with:
name: ${{ needs.release-chart.outputs.artifact }}
path: chart-package/

- name: Download Changelog Artifact
uses: actions/[email protected].7
uses: actions/[email protected].8
with:
name: ${{ needs.release-changelog.outputs.artifact }}
path: changelog-result/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-image-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Upload artifact digests
if: ${{ env.RUN_EXIST == 'false' }}
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: image-digest-${{ matrix.name }}
path: image-digest
Expand All @@ -168,7 +168,7 @@ jobs:
mkdir -p image-digest/
- name: Download digests of all images built
uses: actions/[email protected].7
uses: actions/[email protected].8
with:
path: image-digest/

Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/call-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,27 @@ jobs:

# download all artifact
# https://github.com/actions/download-artifact#download-all-artifacts
- name: Download images
uses: actions/[email protected].7
- name: Download egressgateway-agent
uses: actions/[email protected].8
with:
name: image-tar-egressgateway-agent
path: output/artifact-${{ inputs.ipfamily }}
- name: Download egressgateway-controller
uses: actions/[email protected]
with:
name: image-tar-egressgateway-controller
path: output/artifact-${{ inputs.ipfamily }}
- name: Download egressgateway-nettools
uses: actions/[email protected]
with:
name: image-tar-egressgateway-nettools
path: output/artifact-${{ inputs.ipfamily }}

- name: Load And Scan Images
- name: Load images
run: |
PROJECT_DIR=`pwd`
cd output/artifact-${{ inputs.ipfamily }}
ls
ALL_DIR=`ls`
IMAGE_DIR=""
for ITEM in $ALL_DIR ; do
grep -E "^image-tar" <<< "${ITEM}" &>/dev/null && IMAGE_DIR+=" ${ITEM} "
done
echo "IMAGE_DIR=${IMAGE_DIR}"
for ITEM in $IMAGE_DIR ; do
TAR_FILES=`ls ${ITEM}`
ls -l ${ITEM}
for TAR in $TAR_FILES ; do
echo "image tar ${ITEM}/${TAR}"
cat ${ITEM}/${TAR} | docker import - ${TAR%*.tar}:${{ inputs.ref }}
done
done
find . -name "*.tar" -print0 | xargs -0 -I {} sh -c 'echo "Loading {} ..."; docker load -i "{}"'
docker images
- name: Run test
Expand Down Expand Up @@ -160,15 +157,15 @@ jobs:
fi
- name: Upload e2e cluster log
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: ${{ inputs.os }}-${{ inputs.cni }}-${{ inputs.ipfamily }}-${{ env.RUN_VAR }}-debuglog.txt
path: ${{ env.E2E_LOG_PATH }}
retention-days: 30

- name: Upload e2e ginkgo report
if: ${{ env.RUN_UPLOAD_LOG == 'true' }}
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: ${{ inputs.os }}-${{ inputs.cni }}-${{ inputs.ipfamily }}-${{ env.RUN_VAR }}-e2e-report.json
path: ${{ env.E2E_GINKGO_REPORT_PATH }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/call-release-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
cat ${FILE_PATH}
- name: Upload Changelog
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: changelog_artifact
path: ${{ env.FILE_PATH }}
Expand All @@ -126,7 +126,7 @@ jobs:
ref: ${{ env.DEST_BRANCH }}

- name: Download Artifact
uses: actions/[email protected].7
uses: actions/[email protected].8
with:
name: changelog_artifact
path: ${{ env.DEST_DIRECTORY }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/call-release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
make chart_package
- name: Upload Artifact
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: chart_package_artifact
path: ${{ env.CHART_OUTPUT_PATH }}
Expand All @@ -93,7 +93,7 @@ jobs:
uses: azure/setup-helm@v4

- name: Download Chart Artifact
uses: actions/[email protected].7
uses: actions/[email protected].8
with:
name: chart_package_artifact
path: charts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/call-release-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
file: ${{ matrix.dockerfile }}
provenance: false
github-token: ${{ secrets.WELAN_PAT }}
outputs: type=tar,dest=/tmp/${{ env.RUN_IMAGE_SUFFIX }}.tar
outputs: type=docker,dest=/tmp/${{ env.RUN_IMAGE_SUFFIX }}.tar
platforms: linux/amd64
tags: |
${{ env.ONLINE_REGISTER }}/${{ github.repository }}-${{ matrix.name }}${{ env.RUN_SUFFIX }}:${{ env.RUN_IMAGE_TAG }}
Expand Down Expand Up @@ -223,14 +223,14 @@ jobs:
cd ..
- name: Upload artifact digests
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: image-digest-${{ matrix.name }}-${{ env.RUN_IMAGE_TAG }}
path: image-digest-output.txt
retention-days: 1

- name: Upload artifact digests
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: makefile-digest-${{ matrix.name }}-${{ env.RUN_IMAGE_TAG }}
path: Makefile.digests
Expand All @@ -239,7 +239,7 @@ jobs:
# Upload artifact race images tar
- name: Upload image artifact
if: ${{ env.RUN_UPLOAD == 'true' }}
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: image-tar-${{ env.RUN_IMAGE_SUFFIX }}
path: /tmp/${{ env.RUN_IMAGE_SUFFIX }}.tar
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/call-release-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
echo "Push a doc version: ${{ env.DOCS_TAG }} from branch: ${{ env.REF }}, update it to latest: ${{ env.SET_LATEST }} "
- name: Upload Artifact
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: site_artifact
path: site.tar.gz
Expand All @@ -153,7 +153,7 @@ jobs:

## doc
- name: Download Artifact
uses: actions/[email protected].7
uses: actions/[email protected].8
with:
name: site_artifact

Expand Down
74 changes: 40 additions & 34 deletions .github/workflows/call-trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,44 @@ jobs:
persist-credentials: false
ref: ${{ inputs.ref }}

# download all artifact
- name: Download images
uses: actions/[email protected]

- name: Download egressgateway-agent
uses: actions/[email protected]
with:
name: image-tar-egressgateway-agent
path: output/image
- name: Download egressgateway-controller
uses: actions/[email protected]
with:
name: image-tar-egressgateway-controller
path: output/image
- name: Download egressgateway-nettools
uses: actions/[email protected]
with:
name: image-tar-egressgateway-nettools
path: output/image


- name: List downloaded files
run: ls -al output/image


# merge to one step
# https://github.com/aquasecurity/trivy-action/issues/313
- name: Scan agent
uses: aquasecurity/[email protected]
with:
input: output/image/egressgateway-agent.tar
severity: 'CRITICAL,HIGH'

- name: Scan controller
uses: aquasecurity/[email protected]
with:
input: output/image/egressgateway-controller.tar
severity: 'CRITICAL,HIGH'

- name: Scan nettools
uses: aquasecurity/[email protected]
with:
path: output/artifact-trivy

- name: Load And Scan Images
run: |
PROJECT_DIR=`pwd`
cd output/artifact-trivy
ls
ALL_DIR=`ls`
IMAGE_DIR=""
for ITEM in $ALL_DIR ; do
grep -E "^image-tar" <<< "${ITEM}" &>/dev/null && IMAGE_DIR+=" ${ITEM} "
done
echo "IMAGE_DIR=${IMAGE_DIR}"
RESULT=true
for ITEM in $IMAGE_DIR ; do
TAR_FILES=`ls ${ITEM}`
for TAR in $TAR_FILES ; do
echo "image tar ${ITEM}/${TAR}"
cat ${ITEM}/${TAR} | docker import - ${TAR%*.tar}:${{ inputs.ref }}
echo "---------trivy checkout image ${TAR%*.tar}:${{ inputs.ref }} --------------------"
make -C ${PROJECT_DIR} lint_image_trivy -e IMAGE_NAME=${TAR%*.tar}:${{ inputs.ref }} \
|| { RESULT=false ; echo "error, image ${TAR%*.tar}:${{ inputs.ref }} is bad" ; }
done
done
docker images
if [ "$RESULT" != "true" ]; then
echo "error, image is not secure, see detail on Step 'Load And Scan Images' "
exit 1
else
exit 0
fi
input: output/image/egressgateway-nettools.tar
severity: 'CRITICAL,HIGH'
2 changes: 1 addition & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
echo "-----------------------------"
- name: Upload artifact digests
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: README.md
path: thisProject/charts/README.md
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ jobs:
- name: Upload Coverage Artifact
if: ${{ steps.unitest.outcome == 'failure' }}
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: coverage.out
path: ${{ env.COVERAGE_REPORT_PATH }}
retention-days: 1

- name: Upload Report Artifact
if: ${{ steps.unitest.outcome == 'failure' }}
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: unitestreport.json
path: ${{ env.UNITEST_REPORT_PATH }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-yaml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Upload artifact digests
if: ${{ steps.yaml-lint.outcome == 'failure' }}
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
name: log
path: ${{ steps.yaml-lint.outputs.logfile }}
Expand Down

0 comments on commit 3bcf4f9

Please sign in to comment.