Skip to content

Commit 82483d0

Browse files
committed
Merge remote-tracking branch 'cloud-event-proxy/release-4.12'
2 parents 7b3eaf1 + 2a75e15 commit 82483d0

File tree

3,970 files changed

+1389812
-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.

3,970 files changed

+1389812
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build_root_image:
2+
name: release
3+
namespace: openshift
4+
tag: rhel-8-release-golang-1.19-openshift-4.12
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
golangci:
6+
name: Linting
7+
runs-on: ubuntu-24.04
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-go@v2
11+
with:
12+
go-version: '1.19'
13+
- name: tidy
14+
run: go mod tidy
15+
- name: golangci-lint
16+
uses: golangci/golangci-lint-action@v3.2.0
17+
with:
18+
# Caching conflicts happen in GHA, so just disable for now
19+
skip-pkg-cache: true
20+
skip-build-cache: true
21+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
22+
version: v1.48.0
23+
args: --timeout 3m0s
24+
unit-tests:
25+
name: Unit Tests
26+
runs-on: ubuntu-24.04
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v3
30+
- uses: actions/setup-go@v2
31+
with:
32+
go-version: '1.19'
33+
- name: tidy
34+
run: go mod tidy
35+
- name: Run Test Scripts
36+
run: |
37+
make gha

pkg/cloud-event-proxy/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# junit
9+
#test/cne
10+
test/cne/junit.xml
11+
12+
# Test binary, built with `go test -c`
13+
*.test
14+
15+
# Output of the go coverage tool, specifically when used with LiteIDE
16+
*.out
17+
18+
# Dependency directories (remove the comment below to include it)
19+
# vendor/
20+
*.so
21+
pub.json
22+
sub.json
23+
24+
.idea
25+
26+
build/
27+
bin/
28+
pkg/storage/kubernetes/*.json
29+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
run:
2+
concurrency: 8
3+
deadline: 3m
4+
issues-exit-code: 1
5+
tests: true
6+
skip-dirs:
7+
- vendor
8+
skip-dirs-use-default: false
9+
10+
11+
output:
12+
format: colored-line-number
13+
print-issued-lines: true
14+
print-linter-name: true
15+
issues:
16+
exclude-use-default: false
17+
exclude:
18+
- 'ST1000: at least one file in a package should have a package comment'
19+
- 'package-comments: should have a package comment'
20+
linters-settings:
21+
govet:
22+
# Enable all analyzers.
23+
# Default: false
24+
enable-all: true
25+
# Disable analyzers by name.
26+
# Run `go tool vet help` to see all analyzers.
27+
# Default: []
28+
disable:
29+
- fieldalignment # too strict
30+
# Settings per analyzer.
31+
settings:
32+
shadow:
33+
# Whether to be strict about shadowing; can be noisy.
34+
# Default: false
35+
strict: true
36+
37+
38+
gocyclo:
39+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
40+
min-complexity: 45
41+
goconst:
42+
min-len: 3
43+
min-occurrences: 4
44+
decorder:
45+
# Required order of `type`, `const`, `var` and `func` declarations inside a file.
46+
# Default: types before constants before variables before functions.
47+
dec-order:
48+
- type
49+
- const
50+
- var
51+
- func
52+
53+
linters:
54+
disable-all: true
55+
enable: # NOTE: please keep this list alphabetically sorted
56+
- bodyclose
57+
- decorder
58+
- dogsled
59+
#- errcheck
60+
- goconst
61+
- gocyclo
62+
- goimports
63+
#- gosec
64+
- gosimple
65+
- govet
66+
- ineffassign
67+
- megacheck
68+
- misspell
69+
- revive
70+
- stylecheck
71+
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
72+
- typecheck
73+
- unconvert
74+
- unparam
75+
- unused
76+
- whitespace
77+
fast: false
78+
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Cloud Native Events 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+
by contacting a project maintainer, Aneesh Puttur <aputtur@redhat.com>.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series
85+
of actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or
92+
permanent ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within
112+
the community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.0, available at
118+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
120+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
121+
enforcement ladder](https://github.com/mozilla/diversity).
122+
123+
[homepage]: https://www.contributor-covenant.org
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
https://www.contributor-covenant.org/faq. Translations are available at
127+
https://www.contributor-covenant.org/translations.
128+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# How to Contribute
2+
3+
Cloud Event Proxy is [Apache 2.0 licensed](LICENSE) and accepts contributions via GitHub
4+
pull requests. This document outlines some of the conventions on development
5+
workflow, commit message formatting, contact points and other resources to make
6+
it easier to get your contribution accepted.
7+
8+
## Coding Style
9+
10+
Please follows the standard formatting recommendations and language idioms set out
11+
in [Effective Go](https://golang.org/doc/effective_go.html) and in the
12+
[Go Code Review Comments wiki](https://github.com/golang/go/wiki/CodeReviewComments).
13+
14+
## Certificate of Origin
15+
16+
In order to get a clear contribution chain of trust we use the [signed-off-by language](https://01.org/community/signed-process)
17+
used by the Linux kernel project.
18+
19+
## Format of the patch
20+
21+
Beside the signed-off-by footer, we expect each patch to comply with the following format:
22+
23+
```
24+
Change summary
25+
26+
More detailed explanation of your changes: Why and how.
27+
Wrap it to 72 characters.
28+
See [here] (http://chris.beams.io/posts/git-commit/)
29+
for some more good advices.
30+
31+
Fixes #NUMBER (or URL to the issue)
32+
33+
Signed-off-by: <contributor@foo.com>
34+
```
35+
36+
For example:
37+
38+
```
39+
Fix poorly named identifiers
40+
41+
One identifier, fnname, in func.go was poorly named. It has been renamed
42+
to fnName. Another identifier retval was not needed and has been removed
43+
entirely.
44+
45+
Fixes #1
46+
47+
Signed-off-by: Abc Xyz <abc.xyz@redhat.com>
48+
```
49+
50+
## Pull requests
51+
52+
We accept github pull requests.
53+
54+

pkg/cloud-event-proxy/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.19-openshift-4.12 AS builder
2+
ENV GO111MODULE=off
3+
ENV CGO_ENABLED=1
4+
ENV COMMON_GO_ARGS=-race
5+
ENV GOOS=linux
6+
ENV GOPATH=/go
7+
8+
WORKDIR /go/src/github.com/redhat-cne/cloud-event-proxy
9+
COPY . .
10+
11+
RUN hack/build-go.sh
12+
13+
FROM registry.ci.openshift.org/ocp/4.12:base AS bin
14+
COPY --from=builder /go/src/github.com/redhat-cne/cloud-event-proxy/build/cloud-event-proxy /
15+
COPY --from=builder /go/src/github.com/redhat-cne/cloud-event-proxy/plugins/*.so /plugins/
16+
17+
LABEL io.k8s.display-name="Cloud Event Proxy" \
18+
io.k8s.description="This is a component of OpenShift Container Platform and provides a side car to handle cloud events." \
19+
io.openshift.tags="openshift" \
20+
maintainer="Aneesh Puttur <aputtur@redhat.com>"
21+
22+
ENTRYPOINT ["./cloud-event-proxy"]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Used by quay.io to trigger developer builds
2+
FROM quay.io/redhat-cne/openshift-origin-release:golang-1.18 AS builder
3+
4+
ENV GO111MODULE=off
5+
ENV CGO_ENABLED=1
6+
ENV COMMON_GO_ARGS=-race
7+
ENV GOOS=linux
8+
ENV GOPATH=/go
9+
10+
WORKDIR /go/src/github.com/redhat-cne/cloud-event-proxy
11+
COPY . .
12+
13+
RUN hack/build-go.sh
14+
15+
FROM quay.io/redhat-cne/openshift-origin-release:base-4.12 AS bin
16+
COPY --from=builder /go/src/github.com/redhat-cne/cloud-event-proxy/build/cloud-event-proxy /
17+
COPY --from=builder /go/src/github.com/redhat-cne/cloud-event-proxy/plugins/*.so /plugins/
18+
19+
LABEL io.k8s.display-name="Cloud Event Proxy" \
20+
io.k8s.description="This is a component of OpenShift Container Platform and provides a side car to handle cloud events." \
21+
io.openshift.tags="openshift" \
22+
maintainer="Aneesh Puttur <aputtur@redhat.com>"
23+
24+
ENTRYPOINT ["./cloud-event-proxy"]

0 commit comments

Comments
 (0)