Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
extract Servlet code from original project
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Dec 10, 2024
0 parents commit c13cc68
Show file tree
Hide file tree
Showing 140 changed files with 15,311 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gimps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This is the configuration for https://github.com/xrstf/gimps.

importOrder: [std, external, project, kcp, kubernetes]
sets:
- name: kubernetes
patterns:
- 'k8s.io/**'
- '*.k8s.io/**'
- 'github.com/kcp-dev/client-go/**'
- 'github.com/kcp-dev/kubernetes/**'
- name: kcp
patterns:
- 'github.com/kcp-dev/kcp/**'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/_build/
/vendor/
.cover
*.kubeconfig
*.pem
*.key
92 changes: 92 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright 2024 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

run:
modules-download-mode: readonly
deadline: 20m
skip-files:
- zz_generated.*.go

linters:
enable:
- asciicheck
- bidichk
- bodyclose
- depguard
- durationcheck
- errcheck
- errname
- errorlint
- exportloopref
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gosimple
- govet
- importas
- ineffassign
- misspell
- noctx
- nolintlint
- nosprintfhostport
- predeclared
- promlinter
- staticcheck
- tenv
- unconvert
- unused
- wastedassign
- whitespace
disable-all: true
issues:
# defaults to 3, which often needlessly hides issues and forces
# to re-run the linter across the entire repo many times
max-same-issues: 50

# NOTE: Do not use commas in the exclude patterns, or else the regex will be
# split and you will be sad: https://github.com/golangci/golangci-lint/issues/665
exclude:
# gocritic
- singleCaseSwitch # in most cases this is the beginning of a lookup table and should be kept an obvious table

linters-settings:
depguard:
rules:
main:
deny:
- { pkg: io/ioutil, desc: https://go.dev/doc/go1.16#ioutil }
- { pkg: github.com/ghodss/yaml, desc: use sigs.k8s.io/yaml instead }

importas:
no-unaliased: true
alias:
# Servlet APIs
- pkg: k8c.io/servlet/sdk/apis/(\w+)/(v[\w\d]+)
alias: $1$2
# Kubernetes
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
alias: apiextensionsv1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: k8s.io/apimachinery/pkg/util/errors
alias: utilerrors
# Controller Runtime
- pkg: sigs.k8s.io/controller-runtime/pkg/client
alias: ctrlruntimeclient
40 changes: 40 additions & 0 deletions .wwhrd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2024 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# To add a license, we follow https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md.

denylist:
- GPL-2.0
- LGPL-3.0

allowlist:
- Apache-2.0
- MIT
- BSD-2-Clause
- BSD-2-Clause-FreeBSD
- BSD-3-Clause
- ISC

exceptions:
- github.com/muhlemmer/gu # public domain, required for zitadel/oidc
- github.com/hashicorp/hcl # MPL 2.0
- github.com/hashicorp/hcl/hcl/ast # MPL 2.0
- github.com/hashicorp/hcl/hcl/parser # MPL 2.0
- github.com/hashicorp/hcl/hcl/printer # MPL 2.0
- github.com/hashicorp/hcl/hcl/scanner # MPL 2.0
- github.com/hashicorp/hcl/hcl/strconv # MPL 2.0
- github.com/hashicorp/hcl/hcl/token # MPL 2.0
- github.com/hashicorp/hcl/json/parser # MPL 2.0
- github.com/hashicorp/hcl/json/scanner # MPL 2.0
- github.com/hashicorp/hcl/json/token # MPL 2.0
37 changes: 37 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Kubermatic Community Code of Conduct

## Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering
an open and welcoming community, we pledge to respect all people who contribute
through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing others' private information, such as physical or electronic addresses,
without explicit permission
* Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are not
aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers
commit themselves to fairly and consistently applying these principles to every aspect
of managing this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Kubermatic Conduct Committee via [email protected].

This Code of Conduct is adapted from the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md) and [Contributor Covenant](http://contributor-covenant.org/version/1/2/0/), version 1.2.0.
102 changes: 102 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# How to Contribute

Kubermatic projects are [Apache 2.0 licensed](LICENSE) and accept contributions via
GitHub pull requests. This document outlines some of the conventions on
development workflow, commit message formatting, contact points and other
resources to make it easier to get your contribution accepted.

## Certificate of Origin

By contributing to this project you agree to the Developer Certificate of
Origin (DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
contribution. See the [DCO](DCO) file for details.

Any copyright notices in this repo should specify the authors as "the Kubermatic Developer Platform project contributors".

To sign your work, just add a line like this at the end of your commit message:

```
Signed-off-by: Joe Example <[email protected]>
```

This can easily be done with the `--signoff` option to `git commit`.

Note that we're requiring all commits in a PR to be signed-off. If you already created a PR, you can sign-off all existing commits by rebasing with the `--signoff` flag.

```
git rebase --signoff origin/main
```

By doing this you state that you can certify the following (from https://developercertificate.org/):
```
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

## Email and Chat

The XXX project currently uses the general Kubermatic email list and Slack channel:
- Email: [kubermatic-dev](https://groups.google.com/forum/#!forum/kubermatic-dev)
- Slack: #[Slack](http://slack.kubermatic.io/) on Slack

Please avoid emailing maintainers found in the MAINTAINERS file directly. They
are very busy and read the mailing lists.

## Reporting a security vulnerability

Due to their public nature, GitHub and mailing lists are not appropriate places for reporting vulnerabilities. If you suspect you have found a security vulnerability, please do not file a GitHub issue, but instead email [email protected] with the full details, including steps to reproduce the issue.

## Getting Started

- Fork the repository on GitHub
- Read the [README](README.md) for build and test instructions
- Play with the project, submit bugs, submit patches!

### Contribution Flow

This is a rough outline of what a contributor's workflow looks like:

- Create a topic branch from where you want to base your work (usually main).
- Make commits of logical units.
- Make sure your commit messages are in the proper format (see below).
- Push your changes to a topic branch in your fork of the repository.
- Make sure the tests pass, and add any new tests as appropriate.
- Submit a pull request to the original repository.

Thanks for your contributions!
36 changes: 36 additions & 0 deletions DCO
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2024 The Kubermatic Kubernetes Platform contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM docker.io/golang:1.23.4 as builder

# import the GOPROXY variable via an arg and then use
# that arg to define the environment variable later on
ARG GOPROXY=
ENV GOPROXY=$GOPROXY

WORKDIR /go/src/k8c.io/servlet
COPY . .
RUN make clean servlet

FROM gcr.io/distroless/static-debian12:debug
LABEL maintainer="[email protected]"

COPY --from=builder /go/src/k8c.io/servlet/_build/servlet /usr/local/bin/servlet

USER nobody
ENTRYPOINT [ "servlet" ]
Loading

0 comments on commit c13cc68

Please sign in to comment.