Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Morales committed Dec 19, 2024
0 parents commit f571e6d
Show file tree
Hide file tree
Showing 20 changed files with 1,937 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
abcde
acdlite
ADev
ALint
Amain
apiGroups
apiVersion
AProd
boyter
brightgreen
cdi
cli
cloner
ClusterRole
COCOMO
codebase
Codecov
datavolumes
dev
devs
dw
electrocucaracha
env
fieldPath
fieldRef
filesystems
formatter
gh
gha
ghcr
githubConfigSecret
githubConfigUrl
GraphQL
href
HTTPS
img
IShouldRefactorThis
isThereSeriouslyAnotherOne
js
json
JSX
kubectl
Kubernetes
KubeVirt
labelColor
laobi
lifecycle
linter
macOS
namespace
namespaces
npm
npmjs
oci
omgSoManyParameters
opensource
pre
precommit
PrettierCode
quickstart
RBAC
reallyLongArg
repo
runStrategy
scc
SCSS
ServiceAccount
serviceAccountName
sloc
src
svg
unpkg
valueFrom
virtiofs
VirtualMachine
VirtualMachineInstance
VirtualMachineInstances
VirtualMachines
vm
VMI
VMs
Vue
xyz
yaml
yml
48 changes: 48 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
name: Lint Code Base
# yamllint disable-line rule:truthy
on:
push:
pull_request:
jobs:
get-sloc:
name: Count Lines of Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
- name: Setup Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # 5.1.0
with:
go-version: ">=1.20.0"
- name: Install dependencies
run: go install github.com/boyter/scc/v3@latest
- name: Run scc tool
run: scc --format wide
check-broken-links:
name: Check documentation external links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
- name: Check broken links
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # 1.0.15
check-super-linter:
name: Check syntax (super-linter)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
- name: Run super-linter validation
uses: github/super-linter@b807e99ddd37e444d189cfd2c2ca1274d8ae8ef1 # 7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: /
VALIDATE_CHECKOV: false
VALIDATE_GOOGLE_JAVA_FORMAT: false
VALIDATE_JAVA: false
VALIDATE_KUBERNETES_KUBECONFORM: false
35 changes: 35 additions & 0 deletions .github/workflows/spell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
name: Run misspell
# yamllint disable-line rule:truthy
on:
push:
paths:
- "**.md"
- "!.github/*"
pull_request_review:
types:
- submitted
permissions: read-all
jobs:
check-reviewdog:
name: Check spelling (reviewdog)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- uses: reviewdog/action-misspell@1de44e0dd5efaaddf131937e4892afd8a0dc4b13 # 1.23.0
with:
github_token: ${{ secrets.github_token }}
check-spellcheck:
name: Check spelling (pyspelling)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # 4.2.0
- uses: igsekor/pyspelling-any@155eb06641bb9259cab59b5126a40be943ecb4f7 # 1.0.4
name: Spellcheck
30 changes: 30 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
name: Scheduled Versions verification
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 0 * * 5"
workflow_dispatch:
jobs:
check-versions:
permissions:
contents: write # for technote-space/create-pr-action to push code
pull-requests: write # for technote-space/create-pr-action to create a PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
- uses: technote-space/create-pr-action@91114507cf92349bec0a9a501c2edf1635427bc5 # 2.1.4
with:
EXECUTE_COMMANDS: |
./ci/update_versions.sh
COMMIT_MESSAGE: "Upgrade versions files"
COMMIT_NAME: "electrocucaracha bot"
PR_BRANCH_NAME: "versions-update-${PR_ID}"
PR_TITLE: "chore: update versions"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package*.json
node_modules/
dictionary.dic
33 changes: 33 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

linters:
enable-all: true
disable:
- exportloopref # Deprecated (since v1.60.2) due to: Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar.
- gomnd # Deprecated (since v1.58.0) due to: The linter has been renamed. Replaced by mnd.
- execinquery # Deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner.
- exhaustruct
linters-settings:
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax # allow unless explicitely denied
files:
- $all
- "!$test"
allow:
- $gostd
deny:
- pkg: io/ioutil
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
gomoddirectives:
replace-allow-list:
- k8s.io/kube-openapi
19 changes: 19 additions & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
matrix:
- name: markdown
dictionary:
wordlists:
- .github/.wordlist.txt
pipeline:
- pyspelling.filters.markdown:
sources:
- "**/*.md"
aspell:
ignore-case: true
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.23.4-alpine3.20 AS build

WORKDIR /go

COPY . .

RUN go build -o /kar cmd/kar/main.go

FROM scratch

COPY --from=build /kar /opt/kar

USER 10001:10001

ENTRYPOINT [ "/opt/kar"]
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2024
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

DOCKER_CMD ?= $(shell which docker 2> /dev/null || which podman 2> /dev/null || echo docker)

test:
@go test -v ./...

.PHONY: lint
lint:
sudo -E $(DOCKER_CMD) run --rm -v $$(pwd):/tmp/lint \
-e RUN_LOCAL=true \
-e LINTER_RULES_PATH=/ \
-e VALIDATE_KUBERNETES_KUBEVAL=false \
-e KUBERNETES_KUBECONFORM_OPTIONS='-ignore-missing-schemas' \
github/super-linter

.PHONY: fmt
fmt:
@go fmt ./...
command -v shfmt > /dev/null || curl -s "https://i.jpillora.com/mvdan/sh!!?as=shfmt" | bash
shfmt -l -w -s .
command -v yamlfmt > /dev/null || curl -s "https://i.jpillora.com/google/yamlfmt!!" | bash
yamlfmt -dstar **/*.{yaml,yml}
command -v prettier > /dev/null || npm install prettier
npx prettier . --write
Loading

0 comments on commit f571e6d

Please sign in to comment.