Skip to content

Commit c0482de

Browse files
committed
initial commit
Signed-off-by: Navid Yaghoobi <[email protected]>
0 parents  commit c0482de

File tree

4,524 files changed

+1028272
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,524 files changed

+1028272
-0
lines changed

.cirrus.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
3+
env:
4+
DEST_BRANCH: "main"
5+
CIRRUS_SHELL: "/bin/bash"
6+
7+
timeout_in: 30m
8+
9+
# Run on PRs and main branch post submit only. Don't run tests when tagging.
10+
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
11+
12+
clone_script: &full_clone |
13+
if [ -z "$CIRRUS_PR" ]; then
14+
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
15+
git reset --hard $CIRRUS_CHANGE_IN_REPO
16+
else
17+
git clone --recursive https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
18+
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
19+
git reset --hard $CIRRUS_CHANGE_IN_REPO
20+
fi
21+
22+
precommit_test_task:
23+
name: "Precommit"
24+
alias: precommit
25+
clone_script: *full_clone
26+
container:
27+
image: python:3.10
28+
script: |
29+
python3 -m pip install pre-commit
30+
pre-commit run -a
31+
32+
vendor_task:
33+
name: "Vendoring"
34+
alias: vendor
35+
clone_script: *full_clone
36+
container:
37+
image: golang:1.18
38+
script: |
39+
go mod tidy
40+
go mod vendor
41+
go mod verify
42+
bash ./hack/tree_status.sh
43+
44+
gofmt_task:
45+
name: "Gofmt"
46+
alias: gofmt
47+
clone_script: *full_clone
48+
container:
49+
image: golang:1.18
50+
script: |
51+
SRC=$(find . -type f -name '*.go' -not -path "./vendor/*")
52+
gofmt -w ${SRC}
53+
54+
golangci_lint_task:
55+
name: "Golangci-lint"
56+
alias: lint
57+
clone_script: *full_clone
58+
container:
59+
image: golang:1.18
60+
script: |
61+
make .install.golangci-lint
62+
make lint
63+
64+
build_package_task:
65+
name: "Binaries and RPM Package"
66+
clone_script: |
67+
dnf -y install git-core
68+
if [ -z "$CIRRUS_PR" ]; then
69+
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
70+
git reset --hard $CIRRUS_CHANGE_IN_REPO
71+
else
72+
git clone --recursive https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $CIRRUS_WORKING_DIR
73+
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
74+
git reset --hard $CIRRUS_CHANGE_IN_REPO
75+
fi
76+
depends_on:
77+
- vendor
78+
- precommit
79+
- gofmt
80+
- lint
81+
container:
82+
image: fedora:36
83+
script: |
84+
sh hack/install_dep.sh
85+
rpkg local
86+
rpm -ivh /tmp/rpkg/prometheus-podman-exporter-*/x86_64/prometheus-podman-exporter-*.x86_64.rpm
87+
rpm -qil prometheus-podman-exporter
88+
mv /tmp/rpkg/prometheus-podman-exporter-*/x86_64/prometheus-podman-exporter-*.x86_64.rpm ./
89+
make binary
90+
mv bin/prometheus-podman-exporter ./
91+
always:
92+
binary_artifacts:
93+
path: "*prometheus-podman-exporter*"
94+
type: application/octet-stream

.github/ISSUE_TEMPLATE/bug_report.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Screenshots**
20+
If applicable, add screenshots to help explain your problem.
21+
22+
**Desktop (please complete the following information):**
23+
- OS [e.g. Fedora 36]
24+
- Podman Version [e.g. 4.0.1]
25+
26+
**Additional context**
27+
Add any other context about the problem here.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is.
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/workflows/pr.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: validate pull requests
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
commit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: get pr commits
10+
id: 'get-pr-commits'
11+
uses: tim-actions/[email protected]
12+
with:
13+
token: ${{ secrets.GITHUB_TOKEN }}
14+
15+
- name: DCO check
16+
uses: tim-actions/dco@master
17+
with:
18+
commits: ${{ steps.get-pr-commits.outputs.commits }}
19+
20+
- name: check subject line length
21+
uses: tim-actions/[email protected]
22+
with:
23+
commits: ${{ steps.get-pr-commits.outputs.commits }}
24+
pattern: '^.{0,72}(\n.*)*$'
25+
error: 'Subject too long (max 72)'
26+
27+
codespell:
28+
name: codespell check
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: codespell-project/actions-codespell@master
33+
with:
34+
check_filenames: true
35+
skip: ./.git,./vendor,*_test.go,go.sum,go.mod
36+
37+
goreportcard:
38+
name: update reportcard
39+
if: github.event.pull_request.merged == true
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: creekorful/[email protected]

.github/workflows/stale.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Mark stale issues and pull requests
2+
3+
# Please refer to https://github.com/actions/stale/blob/master/action.yml
4+
# to see all config knobs of the stale action.
5+
6+
on:
7+
schedule:
8+
- cron: "0 0 * * *"
9+
10+
jobs:
11+
stale:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/stale@v1
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
stale-issue-message: 'A friendly reminder that this issue had no activity for 30 days.'
20+
stale-pr-message: 'A friendly reminder that this PR had no activity for 30 days.'
21+
stale-issue-label: 'stale-issue'
22+
stale-pr-label: 'stale-pr'
23+
days-before-stale: 30
24+
days-before-close: 365
25+
remove-stale-when-updated: true

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.vagrant/
2+
.vscode/
3+
bin/*
4+
*.log
5+
*.out

.golangci.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
run:
2+
deadline: 5m
3+
linters:
4+
enable-all: true
5+
disable:
6+
- wrapcheck
7+
- gochecknoinits
8+
- varnamelen
9+
- exhaustruct
10+
- ireturn
11+
- gochecknoglobals
12+
- exhaustivestruct
13+
- funlen
14+
- golint
15+
- forbidigo
16+
- maligned
17+
- interfacer
18+
- scopelint
19+
linters-settings:
20+
errcheck:
21+
check-blank: false
22+
ignore: fmt:.*
23+
exclude-functions:
24+
# Used in HTTP handlers, any error is handled by the server itself.
25+
- (net/http.ResponseWriter).Write
26+
# Never check the logger error.
27+
- (github.com/go-kit/log.Logger).Log
28+
nolintlint:
29+
require-specific: true

.pre-commit-config.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
exclude: ^vendor/
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
5+
rev: v3.4.0
6+
hooks:
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- id: mixed-line-ending
10+
- id: check-byte-order-marker
11+
- id: check-executables-have-shebangs
12+
- id: check-merge-conflict

CODE_OF_CONDUCT.md

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

0 commit comments

Comments
 (0)