diff --git a/.codecov.yml b/.codecov.yml
index a0719ecc..9767e0d8 100644
--- a/.codecov.yml
+++ b/.codecov.yml
@@ -1,3 +1,4 @@
+---
github_checks:
annotations: false
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 897db9c4..91f00eac 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1,2 @@
+---
github: acrlabs
diff --git a/.github/workflows/k8s_plan.yml b/.github/workflows/k8s_plan.yml
index f0c7b864..bfdab4bb 100644
--- a/.github/workflows/k8s_plan.yml
+++ b/.github/workflows/k8s_plan.yml
@@ -1,6 +1,7 @@
+---
name: Compute k8s plan
-on:
+on: # yamllint disable-line rule:truthy
pull_request:
paths:
- 'k8s/**'
diff --git a/.github/workflows/pr_comment_finished.yml b/.github/workflows/pr_comment_finished.yml
index 10d3641d..64e508cb 100644
--- a/.github/workflows/pr_comment_finished.yml
+++ b/.github/workflows/pr_comment_finished.yml
@@ -1,6 +1,7 @@
+---
name: Comment on the PR
-on:
+on: # yamllint disable-line rule:truthy
workflow_run:
workflows: ["Compute k8s plan"]
types:
@@ -12,7 +13,8 @@ jobs:
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
-
+ env:
+ ASSETS_URL: "https://raw.githubusercontent.com/acrlabs/fireconfig/master/assets"
steps:
- name: Download artifact
uses: actions/download-artifact@v4
@@ -41,10 +43,11 @@ jobs:
echo "" > fireconfig-comment.md
echo "## Kubernetes Object DAG" >> fireconfig-comment.md
cat k8s-plan-artifacts/dag.mermaid >> fireconfig-comment.md
- echo '
New object' >> fireconfig-comment.md
- echo '
Deleted object' >> fireconfig-comment.md
- echo '
Updated object' >> fireconfig-comment.md
- echo '
Updated object (causes pod recreation)' >> fireconfig-comment.md
+ echo '
New object' >> fireconfig-comment.md
+ echo '
Deleted object' >> fireconfig-comment.md
+ echo '
Updated object' >> fireconfig-comment.md
+ echo '
Updated object (causes pod recreation)' \
+ >> fireconfig-comment.md
echo "## Detailed Diff" >> fireconfig-comment.md
cat k8s-plan-artifacts/k8s.df >> fireconfig-comment.md
diff --git a/.github/workflows/pr_comment_starting.yml b/.github/workflows/pr_comment_starting.yml
index ed2bf41b..f58e5679 100644
--- a/.github/workflows/pr_comment_starting.yml
+++ b/.github/workflows/pr_comment_starting.yml
@@ -1,6 +1,7 @@
+---
name: Update the PR Comment
-on:
+on: # yamllint disable-line rule:truthy
#######################################################################################
# WARNING: DO NOT CHANGE THIS ACTION TO CHECK OUT OR EXECUTE ANY CODE!!!!! #
# #
diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml
index 7061dbf3..b2312a27 100644
--- a/.github/workflows/publish_docs.yml
+++ b/.github/workflows/publish_docs.yml
@@ -1,5 +1,6 @@
+---
name: Publish Docs
-on:
+on: # yamllint disable-line rule:truthy
push:
paths:
- 'docs/**'
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 56cf2036..ce9baf2e 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -1,5 +1,6 @@
+---
name: code verification
-on: [push]
+on: [push] # yamllint disable-line rule:truthy
env:
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
@@ -55,7 +56,9 @@ jobs:
run: |
rustup toolchain install nightly-x86_64-unknown-linux-gnu
rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
- - name: Lint Rust code
+ - name: Run pre-commit
+ uses: pre-commit/action@v3.0.1
+ - name: Format Rust code
run: make lint
test:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7e2b50f3..98fd4a1f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,11 +1,15 @@
+---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- - id: check-yaml
- args: ["--allow-multiple-documents"]
- id: trailing-whitespace
+ - repo: https://github.com/adrienverge/yamllint
+ rev: v1.35.1
+ hooks:
+ - id: yamllint
+ args: ['--strict']
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 00000000..7e085f62
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,10 @@
+---
+extends: default
+
+ignore:
+ - examples/metrics
+ - k8s/raw/simkube.io_simulations.yml
+
+rules:
+ line-length:
+ max: 120
diff --git a/Makefile b/Makefile
index 52ff9bbf..dbe42b5d 100644
--- a/Makefile
+++ b/Makefile
@@ -39,10 +39,6 @@ pre-image:
$(CARGO_HOME_ENV) cargo build --target-dir=$(BUILD_DIR) --bin=$* --color=always
cp $(BUILD_DIR)/debug/$* $(BUILD_DIR)/.
-lint:
- cargo +nightly fmt
- cargo clippy
-
test: unit itest
.PHONY: unit
diff --git a/api/v1/simkube.yml b/api/v1/simkube.yml
index 7969d0d1..bd885883 100644
--- a/api/v1/simkube.yml
+++ b/api/v1/simkube.yml
@@ -1,3 +1,4 @@
+---
openapi: 3.1.0
info:
title: SimKube API
@@ -40,7 +41,7 @@ paths:
excluded_labels:
type: array
items:
- $ref: 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/v3/api__v1_openapi.json#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector'
+ $ref: 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/v3/api__v1_openapi.json#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector' # yamllint disable-line rule:line-length
exclude_daemonsets:
type: boolean
responses:
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 75e40de7..9971017e 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -3,17 +3,17 @@ nav:
- Home: README.md
- FAQ: docs/faq.md
- Getting Started:
- - Concepts: docs/intro/concepts.md
- - Installation: docs/intro/installation.md
- - Running a Simulation: docs/intro/running.md
+ - Concepts: docs/intro/concepts.md
+ - Installation: docs/intro/installation.md
+ - Running a Simulation: docs/intro/running.md
- Advanced:
- - Autoscaling: docs/adv/autoscaling.md
- - Collecting Metrics: docs/adv/metrics.md
+ - Autoscaling: docs/adv/autoscaling.md
+ - Collecting Metrics: docs/adv/metrics.md
- Components:
- - sk-ctrl: docs/components/sk-ctrl.md
- - sk-driver: docs/components/sk-driver.md
- - sk-tracer: docs/components/sk-tracer.md
- - skctl: docs/components/skctl.md
+ - sk-ctrl: docs/components/sk-ctrl.md
+ - sk-driver: docs/components/sk-driver.md
+ - sk-tracer: docs/components/sk-tracer.md
+ - skctl: docs/components/skctl.md
- Contributing:
- - Developer's Guide: docs/dev/contributing.md
- - API changes: docs/dev/api_changes.md
+ - Developer's Guide: docs/dev/contributing.md
+ - API changes: docs/dev/api_changes.md
diff --git a/examples/metrics/cadvisor-svcmonitor-hd.yml b/examples/metrics/cadvisor-svcmonitor-hd.yml
index 175793e6..4ffd969b 100644
--- a/examples/metrics/cadvisor-svcmonitor-hd.yml
+++ b/examples/metrics/cadvisor-svcmonitor-hd.yml
@@ -1,3 +1,4 @@
+---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
diff --git a/examples/metrics/kube-apiserver-svcmonitor-hd.yml b/examples/metrics/kube-apiserver-svcmonitor-hd.yml
index 8102bdb9..ebb614a7 100644
--- a/examples/metrics/kube-apiserver-svcmonitor-hd.yml
+++ b/examples/metrics/kube-apiserver-svcmonitor-hd.yml
@@ -1,3 +1,4 @@
+---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
diff --git a/examples/metrics/kube-controller-manager-podmonitor-hd.yml b/examples/metrics/kube-controller-manager-podmonitor-hd.yml
index 5ce0ef7e..0b65b037 100644
--- a/examples/metrics/kube-controller-manager-podmonitor-hd.yml
+++ b/examples/metrics/kube-controller-manager-podmonitor-hd.yml
@@ -1,3 +1,4 @@
+---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
diff --git a/examples/metrics/kube-scheduler-podmonitor-hd.yml b/examples/metrics/kube-scheduler-podmonitor-hd.yml
index 04948e9e..dd50ec23 100644
--- a/examples/metrics/kube-scheduler-podmonitor-hd.yml
+++ b/examples/metrics/kube-scheduler-podmonitor-hd.yml
@@ -1,3 +1,4 @@
+---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
diff --git a/examples/metrics/kube-state-metrics-svcmonitor-hd.yml b/examples/metrics/kube-state-metrics-svcmonitor-hd.yml
index 79536382..7b8fff7a 100644
--- a/examples/metrics/kube-state-metrics-svcmonitor-hd.yml
+++ b/examples/metrics/kube-state-metrics-svcmonitor-hd.yml
@@ -1,3 +1,4 @@
+---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata: