Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Deploy x to '...' using some.yaml
2. View logs on '....'
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Your environment**
* Version of the NGINX Ingress Operator - release version or a specific commit
* Version of the Ingress Controller - release version or a specific commit
* Version of Kubernetes
* Kubernetes platform (e.g. Mini-kube or GCP)
* Using NGINX or NGINX Plus

**Additional context**
Add any other context about the problem here. Any log files you want to share.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Proposed changes
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue here in this description (not in the title of the PR).

### Checklist
Before creating a PR, run through this checklist and mark each as complete.

- [ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/nginx-ingress-operator/blob/master/CONTRIBUTING.md) doc
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have checked that all unit tests pass after adding my changes
- [ ] I have updated necessary documentation
- [ ] I have rebased my branch onto master
- [ ] I will ensure my PR is targeting the master branch and pulling from my branch from my own fork
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
reviewers:
- "nginxinc/kic"
- "ciarams87"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: weekly
reviewers:
- "nginxinc/kic"
173 changes: 173 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Continuous Integration

on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- 'examples/**'
- '**.md'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
paths-ignore:
- 'docs/**'
- 'examples/**'
- '**.md'

concurrency:
group: ${{ github.ref_name }}-ci
cancel-in-progress: true

jobs:

vars:
name: Get variables
runs-on: ubuntu-20.04
outputs:
sha_short: ${{ steps.vars.outputs.sha }}
repo_name: ${{ steps.vars.outputs.repo }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Output Variables
id: vars
run: |
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
echo "::set-output name=repo::$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 2)"

build:
name: Build Image
runs-on: ubuntu-20.04
needs: vars
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: RedHat Registry Login
uses: docker/login-action@v1
with:
registry: registry.redhat.io
username: ${{ secrets.RH_DOCKER_USERNAME }}
password: ${{ secrets.RH_DOCKER_PASSWORD }}
- name: Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
nginx/nginx-ingress-operator
tags: |
type=edge
type=ref,event=pr
type=semver,pattern={{version}}
labels: |
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-ingress-controller
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
- name: Output Variables
id: var
run: |

version=${{ steps.meta.outputs.version }}
operator_version=v$version
# TODO: Uncomment below once tags have been created
# if ${{ startsWith(github.ref, 'refs/tags/') }}; then
# operator_version=v$version
# else
# tag=$(git describe --tags --abbrev=0)
# operator_version=$tag-$version-${{ needs.vars.outputs.sha_short }}
# fi
echo "::set-output name=version::$operator_version"
- name: Build Image
uses: docker/build-push-action@v2
with:
context: '.'
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: true
# TODO: Uncomment the following line when we are ready to push (multi-arch doesn't work woth "load")
# platforms: "linux/amd64,linux/arm64,linux/ppc64le, linux/s390x"
pull: true
build-args: |
VERSION=${{ steps.var.outputs.version }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
continue-on-error: true
with:
image-ref: nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }}
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
ignore-unfixed: 'true'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
continue-on-error: true
with:
sarif_file: 'trivy-results.sarif'
- name: Upload Scan Results
uses: actions/upload-artifact@v2
continue-on-error: true
with:
name: 'trivy-results.sarif'
path: 'trivy-results.sarif'
if: always()


notify:
name: Notify
runs-on: ubuntu-20.04
needs: [vars, build]
if: always() && github.ref == 'refs/heads/main'
steps:
- name: Workflow Status
id: check
uses: martialonline/workflow-status@v2
- name: Send Notification
uses: 8398a7/action-slack@v3
if: steps.check.outputs.status == 'failure'
with:
status: custom
custom_payload: |
{
username: 'Github',
icon_emoji: ':octocat:',
mention: 'channel',
attachments: [{
title: '${{ needs.vars.outputs.repo_name }} ${{ github.workflow }} pipeline has failed',
color: '${{ steps.check.outputs.status }}' == 'failure' ? 'danger' : 'warning',
fields: [{
title: 'Commit Hash',
value: '${{ needs.vars.outputs.sha_short }}',
short: true
},
{
title: 'Author',
value: '${{ github.actor }}',
short: true
},
{
title: 'Commit Message',
value: `${{ github.event.head_commit.message }}`,
short: false
},
{
title: 'Pipeline URL',
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
short: false
}]
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
30 changes: 30 additions & 0 deletions .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update Docker Hub Description
on:
push:
branches:
- main
paths:
- README.md
- .github/workflows/dockerhub-description.yml

concurrency:
group: ${{ github.ref_name }}-dockerhub-description
cancel-in-progress: true

jobs:
dockerHubDescription:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Modify readme for DockerHub
run: |
sed -i '1,2d' README.md

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: nginx/nginx-ingress-helm-operator
short-description: ${{ github.event.repository.description }}
74 changes: 74 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Fossa

on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'LICENSE'

concurrency:
group: ${{ github.ref_name }}-fossa
cancel-in-progress: true

jobs:

scan:
name: Fossa
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Scan
uses: fossas/fossa-action@v1
with:
api-key: ${{ secrets.FOSSA_TOKEN }}

notify:
name: Notify
runs-on: ubuntu-20.04
needs: scan
if: always()
steps:
- name: Workflow Status
id: check
uses: martialonline/workflow-status@v2
- name: Output Variables
id: commit
run: |
echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
echo "::set-output name=repo::${GITHUB_REPOSITORY#*/}"
- name: Send Notification
uses: 8398a7/action-slack@v3
if: steps.check.outputs.status == 'failure'
with:
status: custom
custom_payload: |
{
username: 'Fossa Scan',
icon_emoji: ':fossa:',
mention: 'channel',
attachments: [{
title: '[${{ steps.commit.outputs.repo }}] ${{ github.workflow }} license scan has failed',
color: 'danger',
fields: [{
title: 'Commit Hash',
value: '${{ steps.commit.outputs.sha }}',
short: true
},
{
title: 'Author',
value: '${{ github.actor }}',
short: true
},
{
title: 'Job URL',
value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
short: false
}]
}]
}
env:
GITHUB_TOKEN: ${{ github.token }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
runs-on: ubuntu-20.04
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-20.04
steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 10 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-all-assignees: true
exempt-issue-labels: 'proposal'
operations-per-run: 100
days-before-stale: 90
days-before-close: 10
Loading