Skip to content

Commit a57d847

Browse files
committed
add OWNERS.md, CODEOWNERS, CODE_OF_CONDUCT.md
Signed-off-by: humoflife <[email protected]>
1 parent cf1e325 commit a57d847

File tree

5 files changed

+133
-0
lines changed

5 files changed

+133
-0
lines changed

CODEOWNERS

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
3+
#
4+
# SPDX-License-Identifier: CC0-1.0
5+
6+
# This file controls automatic PR reviewer assignment. See the following docs:
7+
#
8+
# * https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
9+
# * https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team
10+
#
11+
# The goal of this file is for most PRs to automatically and fairly have one
12+
# maintainer set as PR reviewers. All maintainers have permission to approve
13+
# and merge PRs. All PRs must be approved by at least one maintainer before being merged.
14+
#
15+
# Where possible, prefer explicitly specifying a maintainer who is a subject
16+
# matter expert for a particular part of the codebase rather than using fallback
17+
# owners. Fallback owners are listed at the bottom of this file.
18+
#
19+
# See also OWNERS.md for governance details
20+
21+
# Fallback owners
22+
* @stevenborrelli @humoflife @jastang

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2023 The Crossplane Authors <https://crossplane.io>
3+
4+
SPDX-License-Identifier: CC-BY-4.0
5+
-->
6+
7+
## Community Code of Conduct
8+
9+
This project follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

OWNERS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2023 The Crossplane Authors <https://crossplane.io>
3+
4+
SPDX-License-Identifier: CC-BY-4.0
5+
-->
6+
7+
# OWNERS
8+
9+
This page lists all maintainers for **this** repository. Each repository in the
10+
[Crossplane organization](https://github.com/crossplane/) will list their
11+
repository maintainers in their own `OWNERS.md` file.
12+
13+
## Maintainers
14+
15+
* Steven Borrelli <[email protected]> ([stevenborrelli](https://github.com/stevenborrelli))
16+
* Markus Schweig <[email protected]> ([humoflife](https://github.com/humoflife))
17+
* Jason Tang <[email protected]> ([jastang](https://github.com/jastang))
18+
19+
See [CODEOWNERS](./CODEOWNERS) for automatic PR assignment.
20+

d

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# We use the latest Go 1.x version unless asked to use something else.
4+
# The GitHub Actions CI job sets this argument for a consistent Go version.
5+
ARG GO_VERSION=1
6+
7+
# Setup the base environment. The BUILDPLATFORM is set automatically by Docker.
8+
# The --platform=${BUILDPLATFORM} flag tells Docker to build the function using
9+
# the OS and architecture of the host running the build, not the OS and
10+
# architecture that we're building the function for.
11+
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS build
12+
13+
# Download platform-specific AWS CLI binaries
14+
ARG TARGETPLATFORM
15+
16+
WORKDIR /fn
17+
18+
# Most functions don't want or need CGo support, so we disable it.
19+
ENV CGO_ENABLED=0
20+
21+
# We run go mod download in a separate step so that we can cache its results.
22+
# This lets us avoid re-downloading modules if we don't need to. The type=target
23+
# mount tells Docker to mount the current directory read-only in the WORKDIR.
24+
# The type=cache mount tells Docker to cache the Go modules cache across builds.
25+
RUN --mount=target=. --mount=type=cache,target=/go/pkg/mod go mod download
26+
27+
# The TARGETOS and TARGETARCH args are set by docker. We set GOOS and GOARCH to
28+
# these values to ask Go to compile a binary for these architectures. If
29+
# TARGETOS and TARGETOS are different from BUILDPLATFORM, Go will cross compile
30+
# for us (e.g. compile a linux/amd64 binary on a linux/arm64 build machine).
31+
ARG TARGETOS
32+
ARG TARGETARCH
33+
34+
# Build the function binary. The type=target mount tells Docker to mount the
35+
# current directory read-only in the WORKDIR. The type=cache mount tells Docker
36+
# to cache the Go modules cache across builds.
37+
RUN --mount=target=. \
38+
--mount=type=cache,target=/go/pkg/mod \
39+
--mount=type=cache,target=/root/.cache/go-build \
40+
GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /function .
41+
42+
# Produce the Function image.
43+
FROM --platform=${BUILDPLATFORM} python:3.13-bookworm AS image
44+
RUN apt-get update && apt-get install -y coreutils curl jq unzip zsh less
45+
RUN groupadd -g 65532 nonroot
46+
RUN useradd -u 65532 -g 65532 -d /home/nonroot --system --shell /usr/sbin/nologin nonroot
47+
RUN mkdir /scripts /.aws && chown 65532:65532 /scripts /.aws
48+
49+
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
50+
echo "Installing aws-cli for linux/arm64" && \
51+
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "/tmp/awscliv2.zip"; \
52+
else \
53+
echo "Installing aws-cli for linux/x86_64" && \
54+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip"; \
55+
fi && \
56+
unzip "/tmp/awscliv2.zip" && \
57+
./aws/install
58+
59+
WORKDIR /
60+
61+
COPY --from=build /function /function
62+
EXPOSE 9443
63+
USER nonroot:nonroot
64+
ENTRYPOINT ["/function"]

example/aws/functions-remote.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: pkg.crossplane.io/v1beta1
2+
kind: Function
3+
metadata:
4+
name: function-shell
5+
# annotations:
6+
# # This tells crossplane beta render to connect to the function locally.
7+
# render.crossplane.io/runtime: Development
8+
spec:
9+
# This is ignored when using the Development runtime.
10+
#package: xpkg.upbound.io/crossplane-contrib/function-shell:v0.3.0
11+
package: index.docker.io/steve/function-shell:v0.3.0-bookworm-2
12+
---
13+
apiVersion: pkg.crossplane.io/v1beta1
14+
kind: Function
15+
metadata:
16+
name: function-extra-resources
17+
spec:
18+
package: xpkg.upbound.io/crossplane-contrib/function-extra-resources:v0.0.3

0 commit comments

Comments
 (0)