Skip to content

Commit

Permalink
Merge branch 'kyverno:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
anushkamittal2001 authored Nov 2, 2023
2 parents 033340b + f0be3bd commit bd916a7
Show file tree
Hide file tree
Showing 348 changed files with 31,587 additions and 15,520 deletions.
20 changes: 11 additions & 9 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
FROM ubuntu:latest@sha256:aabed3296a3d45cede1dc866a24476c4d7e093aa806263c27ddaadbdce3c1054
FROM ubuntu:22.04@sha256:2b7412e6465c3c7fc5bb21d3e6f1917c167358449fecac8176c6e496e5c1f05f

RUN apt-get update && apt-get install -y sudo git curl apt-transport-https ca-certificates gnupg-agent software-properties-common
ARG USERNAME=root
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Install Golang
RUN curl -LO https://dl.google.com/go/go1.20.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz \
&& rm go1.20.linux-amd64.tar.gz \
RUN ARCH="$(dpkg --print-architecture)"; \
curl -LO https://dl.google.com/go/go1.21.3.linux-$ARCH.tar.gz \
&& tar -C /usr/local -xzf go1.21.3.linux-$ARCH.tar.gz \
&& rm go1.21.3.linux-$ARCH.tar.gz \
&& echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile

# Install Docker
# Install Docker
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io

# Install kubectl and Minikube
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
RUN ARCH="$(dpkg --print-architecture)"; \
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/$ARCH/kubectl \
&& chmod +x kubectl && mv kubectl /usr/local/bin/ \
&& curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& install minikube-linux-amd64 /usr/local/bin/minikube \
&& curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-$ARCH \
&& install minikube-linux-$ARCH /usr/local/bin/minikube \
&& minikube config set driver docker

# Expose ports for Minikube and Docker
Expand Down
17 changes: 1 addition & 16 deletions .github/actions/setup-build-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ inputs:
unshallow:
description: git unshallow
default: 'true'
build-cache-key:
description: build cache prefix
free-disk-space:
description: free disk space
default: 'true'
Expand All @@ -30,20 +28,7 @@ runs:
git fetch --prune --unshallow
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ~1.21.1
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
with:
path: ~/.cache/kyverno/tools
key: ${{ runner.os }}-cache-kyverno-tools-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
if: ${{ inputs.build-cache-key }}
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-build-cache-${{ inputs.build-cache-key }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
go-version: ~1.21.3
- shell: bash
run: |
go mod download
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/setup-caches/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup caches

description: Setup caches for go modules, tools and build cache.

inputs:
build-cache-key:
description: build cache prefix

runs:
using: composite
steps:
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
with:
path: ~/.cache/kyverno/tools
key: ${{ runner.os }}-cache-kyverno-tools-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3.2.2
if: ${{ inputs.build-cache-key }}
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-build-cache-${{ inputs.build-cache-key }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('Makefile') }}
2 changes: 1 addition & 1 deletion .github/workflows/check-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@f32435541e24cd6a4700a7f52bb2ec59e80603b1 # v2.1.4
with:
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup caches
uses: ./.github/actions/setup-caches
timeout-minutes: 5
continue-on-error: true
with:
build-cache-key: cli-test
- name: Setup build env
uses: ./.github/actions/setup-build-env
timeout-minutes: 10
with:
build-cache-key: cli-test
- name: Setup TEST_GIT_BRANCH
run: |
if [[ ${{ github.event_name }} == "push" ]]
Expand All @@ -50,12 +54,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup caches
uses: ./.github/actions/setup-caches
timeout-minutes: 5
continue-on-error: true
with:
build-cache-key: cli-test
- name: Setup build env
uses: ./.github/actions/setup-build-env
timeout-minutes: 10
with:
build-cache-key: cli-test
- name: Setup TEST_GIT_BRANCH
run: |
if [[ ${{ github.event_name }} == "push" ]]
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup caches
uses: ./.github/actions/setup-caches
timeout-minutes: 5
continue-on-error: true
with:
build-cache-key: codecov
- name: Setup build env
uses: ./.github/actions/setup-build-env
timeout-minutes: 10
with:
build-cache-key: codecov
- name: Generate Code Coverage Report
run: make code-cov-report
- name: Upload Report to Codecov
Expand Down
Loading

0 comments on commit bd916a7

Please sign in to comment.