Skip to content

Commit e02d345

Browse files
committed
Initial commit
1 parent 549d316 commit e02d345

File tree

4,341 files changed

+1405374
-39
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,341 files changed

+1405374
-39
lines changed

.github/workflows/build.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# OCI Native Ingress Controller
3+
#
4+
# Copyright (c) 2023 Oracle America, Inc. and its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
#
7+
name: Unit Tests
8+
9+
on:
10+
pull_request: {}
11+
push: {}
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- name: Set up Go 1.x
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.19
22+
id: go
23+
24+
- name: Check out code into the Go module directory
25+
uses: actions/checkout@v2
26+
27+
- name: build the binary
28+
run: |
29+
go build -mod vendor -a -o dist/onic ./main.go
30+
31+
- name: Run Unit Tests
32+
run: |
33+
go test -covermode=count -coverprofile=profile.cov ./pkg/...
34+
- name: Send coverage
35+
env:
36+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
GO111MODULE=off go get github.com/mattn/goveralls
39+
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# OCI Native Ingress Controller
3+
#
4+
# Copyright (c) 2023 Oracle America, Inc. and its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
#
7+
name: Release
8+
9+
on:
10+
push:
11+
# Build and publish artifacts for a release
12+
tags:
13+
- "v*.*.*"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v2
25+
with:
26+
platforms: amd64
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v2
30+
31+
- name: Log into GitHub Container Registry
32+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin
33+
34+
- name: Build Image
35+
run: REGISTRY="${{ env.IMAGE_REGISTRY }}" VERSION="${{ github.ref_name }}" make image
36+
37+
- name: Push Image
38+
run: REGISTRY="${{ env.IMAGE_REGISTRY }}" VERSION="${{ github.ref_name }}" make push

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/bin
2+
/.idea
3+
/.go
4+
/.push-*
5+
/.container-*
6+
/.dockerfile-*
7+
/.licenses
8+
/.buildx-initialized
9+
.DS_Store
10+
coverage.out
11+
12+
# Ignore builds
13+
dist/

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
*Detailed instructions on how to contribute to the project, if applicable. Must include section about Oracle Contributor Agreement with link and instructions*
2-
31
# Contributing to this repository
42

53
We welcome your contributions! There are multiple ways to contribute.
@@ -37,14 +35,14 @@ can be accepted.
3735

3836
1. Ensure there is an issue created to track and discuss the fix or enhancement
3937
you intend to submit.
40-
1. Fork this repository.
38+
1. Fork this repository
4139
1. Create a branch in your fork to implement the changes. We recommend using
42-
the issue number as part of your branch name, e.g. `1234-fixes`.
40+
the issue number as part of your branch name, e.g. `1234-fixes`
4341
1. Ensure that any documentation is updated with the changes that are required
4442
by your change.
4543
1. Ensure that any samples are updated if the base image has been changed.
4644
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
47-
what your changes are meant to do and provide simple steps on how to validate.
45+
what your changes are meant to do and provide simple steps on how to validate
4846
your changes. Ensure that you reference the issue you created as well.
4947
1. We will assign the pull request to 2-3 people for review before it is merged.
5048

@@ -54,4 +52,4 @@ Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd
5452
like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC].
5553

5654
[OCA]: https://oca.opensource.oracle.com
57-
[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/
55+
[COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# OCI Native Ingress Controller
3+
#
4+
# Copyright (c) 2023 Oracle America, Inc. and its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
#
7+
8+
# For open source
9+
FROM golang:1.19-alpine as builder
10+
11+
WORKDIR /workspace
12+
13+
COPY . ./
14+
15+
# Build
16+
# the GOARCH has not a default value to allow the binary be built according to the host where the command
17+
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
18+
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
19+
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
20+
#RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
21+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod vendor -a -o dist/onic ./main.go
22+
23+
# For Open source
24+
FROM oraclelinux:7-slim
25+
26+
LABEL author="OKE Foundations Team"
27+
28+
WORKDIR /usr/local/bin/oci-native-ingress-controller
29+
30+
# copy license files
31+
COPY LICENSE.txt .
32+
COPY THIRD_PARTY_LICENSES.txt .
33+
34+
# Copy the manager binary
35+
COPY --from=builder /workspace/dist/onic .
36+
37+
ENTRYPOINT ["/usr/local/bin/oci-native-ingress-controller/onic"]

0 commit comments

Comments
 (0)