Skip to content

Commit e3c6951

Browse files
authored
chore: format using Make (#511)
1 parent 07c3b6a commit e3c6951

24 files changed

+452
-249
lines changed

.github/actions/deps-setup/action.yaml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'Dependencies setup'
2-
description: 'Sets up dependencies, uses cache to speedup execution'
1+
name: "Dependencies setup"
2+
description: "Sets up dependencies, uses cache to speedup execution"
33
runs:
44
using: "composite"
55
steps:
@@ -18,7 +18,9 @@ runs:
1818
~/.local/share/helm
1919
~/.cache/helm
2020
${{ github.workspace }}/.bin
21-
key: ${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-${{ hashFiles('**/go.sum') }}
21+
key:
22+
${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-${{
23+
hashFiles('**/go.sum') }}
2224
restore-keys: |
2325
${{ runner.os }}-${{ steps.extract_branch.outputs.branch }}-
2426
@@ -31,7 +33,7 @@ runs:
3133
K3D_INSTALL_DIR: ${{ github.workspace }}/.bin
3234
KUBECTL_VERSION: "1.24.3"
3335
K3D_VERSION: "5.4.4"
34-
run: |
36+
run: |
3537
# Export .bin into PATH so k3d doesn't fail when installing
3638
export PATH=".bin:$PATH"
3739
echo "PATH=.bin:$PATH" >> $GITHUB_ENV
@@ -41,12 +43,12 @@ runs:
4143
echo "Installing kubeval helm plugin"
4244
mkdir .bin/plugins
4345
helm plugin install https://github.com/instrumenta/helm-kubeval
44-
46+
4547
echo "Installing k3d"
4648
curl -s https://raw.githubusercontent.com/k3d-io/k3d/v${K3D_VERSION}/install.sh | USE_SUDO="false" bash
47-
49+
4850
echo "Installing kubectl"
4951
pushd .bin
5052
curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
5153
chmod +x ./kubectl
52-
popd
54+
popd

.github/workflows/ci.yml

+43-36
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v2
1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: '1.17'
20+
go-version: "1.17"
2121
- name: Setup dependencies
2222
uses: ./.github/actions/deps-setup
2323

@@ -68,27 +68,31 @@ jobs:
6868
id: changed_charts
6969
env:
7070
FILTER_OUTPUT: ${{ toJson(steps.filter.outputs) }}
71-
FORCE_FULL_RUN: ${{ github.ref_type == 'tag' || steps.filter.outputs['ci-definitions'] == 'true' }}
71+
FORCE_FULL_RUN:
72+
${{ github.ref_type == 'tag' ||
73+
steps.filter.outputs['ci-definitions'] == 'true' }}
7274
run: |
73-
updated_charts=$(echo "$FILTER_OUTPUT" | jq -r 'to_entries | map(select((.key | endswith("-helm")) and .value == "true")) | map(.key)')
74-
updated_charts=$(echo "$updated_charts" | sed "s/-helm//g")
75-
76-
echo "ForceFullRun: ${FORCE_FULL_RUN}"
77-
if [[ "$FORCE_FULL_RUN" == "true" ]]; then
78-
echo "Forcing tests to be running on every charts as CI running in release context"
79-
updated_charts=$(ls ${{ github.workspace }}/helm/charts/ | tr -d " " | jq --raw-input --slurp 'split("\n") | map(select(. != ""))')
80-
fi
75+
updated_charts=$(echo "$FILTER_OUTPUT" | jq -r 'to_entries | map(select((.key | endswith("-helm")) and .value == "true")) | map(.key)')
76+
updated_charts=$(echo "$updated_charts" | sed "s/-helm//g")
77+
78+
echo "ForceFullRun: ${FORCE_FULL_RUN}"
79+
if [[ "$FORCE_FULL_RUN" == "true" ]]; then
80+
echo "Forcing tests to be running on every charts as CI running in release context"
81+
updated_charts=$(ls ${{ github.workspace }}/helm/charts/ | tr -d " " | jq --raw-input --slurp 'split("\n") | map(select(. != ""))')
82+
fi
83+
84+
if [[ "$updated_charts" == "[]" ]]; then
85+
echo ::set-output name=no_changes::"true"
86+
fi
87+
echo ::set-output name=matrix::{\"chart\":$(echo $updated_charts)}\"
88+
89+
echo "Charts array to run CI on: $updated_charts"
8190
82-
if [[ "$updated_charts" == "[]" ]]; then
83-
echo ::set-output name=no_changes::"true"
84-
fi
85-
echo ::set-output name=matrix::{\"chart\":$(echo $updated_charts)}\"
86-
87-
echo "Charts array to run CI on: $updated_charts"
88-
8991
check:
9092
name: Check Helm Chart '${{ matrix.chart }}'
91-
if: ${{ needs.detect-repo-changes.outputs.no-changes != 'true' && github.ref != 'ref/heads/master' }}
93+
if:
94+
${{ needs.detect-repo-changes.outputs.no-changes != 'true' && github.ref
95+
!= 'ref/heads/master' }}
9296
needs: [dependencies, detect-repo-changes]
9397
runs-on: ubuntu-22.04
9498
env:
@@ -99,17 +103,18 @@ jobs:
99103
uses: actions/checkout@v2
100104
- name: Checkout dependencies
101105
uses: ./.github/actions/deps-setup
102-
- name: Lint helm chart
106+
- name: Lint helm chart
103107
run: make helm-lint
104-
- name: Validate helm chart
108+
- name: Validate helm chart
105109
run: make helm-validate
106110
strategy:
107111
matrix: ${{ fromJson(needs.detect-repo-changes.outputs.helms-changed) }}
108112

109-
110113
test-upgrade:
111114
name: Upgrade Helm Chart '${{ matrix.chart }}'
112-
if: ${{ needs.detect-repo-changes.outputs.no-changes != 'true' && github.ref != 'ref/heads/master' }}
115+
if:
116+
${{ needs.detect-repo-changes.outputs.no-changes != 'true' && github.ref
117+
!= 'ref/heads/master' }}
113118
needs: [check, detect-repo-changes, dependencies]
114119
runs-on: ubuntu-22.04
115120
env:
@@ -120,14 +125,16 @@ jobs:
120125
uses: actions/checkout@v2
121126
- name: Checkout dependencies
122127
uses: ./.github/actions/deps-setup
123-
- name: Test upgrade for helm chart
128+
- name: Test upgrade for helm chart
124129
run: make helm-upgrade
125130
strategy:
126131
matrix: ${{ fromJson(needs.detect-repo-changes.outputs.helms-changed) }}
127-
132+
128133
test-install:
129134
name: Install Helm Chart '${{ matrix.chart }}'
130-
if: ${{ needs.detect-repo-changes.outputs.no-changes != 'true' && github.ref != 'ref/heads/master' }}
135+
if:
136+
${{ needs.detect-repo-changes.outputs.no-changes != 'true' && github.ref
137+
!= 'ref/heads/master' }}
131138
needs: [check, detect-repo-changes, dependencies]
132139
runs-on: ubuntu-22.04
133140
env:
@@ -138,7 +145,7 @@ jobs:
138145
uses: actions/checkout@v2
139146
- name: Checkout dependencies
140147
uses: ./.github/actions/deps-setup
141-
- name: Test install for helm chart
148+
- name: Test install for helm chart
142149
run: make helm-test
143150
strategy:
144151
matrix: ${{ fromJson(needs.detect-repo-changes.outputs.helms-changed) }}
@@ -152,21 +159,21 @@ jobs:
152159
steps:
153160
- name: Checkout
154161
uses: actions/checkout@v2
155-
- name: Generate documentation
162+
- name: Generate documentation
156163
run: |
157-
pushd .bin
158-
curl -L https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_Linux_x86_64.tar.gz -o helm-docs.tar.gz
159-
tar -xvf helm-docs.tar.gz
160-
./helm-docs -c ../helm/charts
161-
popd
162-
- name: Push commit for release
164+
pushd .bin
165+
curl -L https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_Linux_x86_64.tar.gz -o helm-docs.tar.gz
166+
tar -xvf helm-docs.tar.gz
167+
./helm-docs -c ../helm/charts
168+
popd
169+
- name: Push commit for release
163170
run: |
164171
git config --global user.email "60093411+ory-bot@users.noreply.github.com"
165172
git config --global user.name "ory-bot"
166173
git checkout -b make-release HEAD
167174
git add -A
168175
git commit -m "Regenerate helm docs
169-
176+
170177
[skip ci]" || echo "No changes to commit"
171178
172179
git push origin HEAD:master
@@ -183,14 +190,14 @@ jobs:
183190
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
184191
- name: Release helm charts
185192
run: make release
186-
- name: Push commit for release
193+
- name: Push commit for release
187194
run: |
188195
git config --global user.email "60093411+ory-bot@users.noreply.github.com"
189196
git config --global user.name "ory-bot"
190197
git checkout -b make-release HEAD
191198
git add -A
192199
git commit -a -m "Release ${RELEASE_VERSION}
193-
200+
194201
[skip ci]" || echo "No changes to commit"
195202
196203
git push origin HEAD:master

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tmp/
22
.charts
33
.DS_Store
4-
.idea
4+
.idea
5+
node_modules/

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.github/pull_request_template.md
2+
.github/ISSUE_TEMPLATE/
3+
helm/charts/
4+
docs/helm/charts/index.yaml

CONTRIBUTING.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ https://github.com/ory/meta/blob/master/templates/repository/common/CONTRIBUTING
2929

3030
## Introduction
3131

32-
_Please note_: We take Ory Kubernetes Resources's security and our users' trust very
33-
seriously. If you believe you have found a security issue in Ory Kubernetes Resources,
34-
please disclose by contacting us at security@ory.sh.
32+
_Please note_: We take Ory Kubernetes Resources's security and our users' trust
33+
very seriously. If you believe you have found a security issue in Ory Kubernetes
34+
Resources, please disclose by contacting us at security@ory.sh.
3535

3636
There are many ways in which you can contribute. The goal of this document is to
3737
provide a high-level overview of how you can get involved in Ory.
@@ -47,9 +47,8 @@ contributions, and don't want a wall of rules to get in the way of that.
4747

4848
That said, if you want to ensure that a pull request is likely to be merged,
4949
talk to us! You can find out our thoughts and ensure that your contribution
50-
won't clash with Ory
51-
Kubernetes Resources's direction. A great way to
52-
do this is via
50+
won't clash with Ory Kubernetes Resources's direction. A great way to do this is
51+
via
5352
[Ory Kubernetes Resources Discussions](https://github.com/orgs/ory/discussions)
5453
or the [Ory Chat](https://www.ory.sh/chat).
5554

@@ -68,9 +67,8 @@ or the [Ory Chat](https://www.ory.sh/chat).
6867
- I want to talk to other Ory Kubernetes Resources users.
6968
[How can I become a part of the community?](#communication)
7069

71-
- I would like to know what I am agreeing to when I contribute to Ory
72-
Kubernetes Resources.
73-
Does Ory have
70+
- I would like to know what I am agreeing to when I contribute to Ory Kubernetes
71+
Resources. Does Ory have
7472
[a Contributors License Agreement?](https://cla-assistant.io/ory/k8s)
7573

7674
- I would like updates about new versions of Ory Kubernetes Resources.
@@ -85,8 +83,8 @@ There are many other ways you can contribute. Here are a few things you can do
8583
to help out:
8684

8785
- **Give us a star.** It may not seem like much, but it really makes a
88-
difference. This is something that everyone can do to help out Ory Kubernetes Resources.
89-
Github stars help the project gain visibility and stand out.
86+
difference. This is something that everyone can do to help out Ory Kubernetes
87+
Resources. Github stars help the project gain visibility and stand out.
9088

9189
- **Join the community.** Sometimes helping people can be as easy as listening
9290
to their problems and offering a different perspective. Join our Slack, have a
@@ -100,11 +98,11 @@ to help out:
10098
help, please share it! Bonus: You get GitHub achievements for answered
10199
discussions.
102100

103-
- **Help with open issues.** We have a lot of open issues for Ory Kubernetes Resources and
104-
some of them may lack necessary information, some are duplicates of older
105-
issues. You can help out by guiding people through the process of filling out
106-
the issue template, asking for clarifying information, or pointing them to
107-
existing issues that match their description of the problem.
101+
- **Help with open issues.** We have a lot of open issues for Ory Kubernetes
102+
Resources and some of them may lack necessary information, some are duplicates
103+
of older issues. You can help out by guiding people through the process of
104+
filling out the issue template, asking for clarifying information, or pointing
105+
them to existing issues that match their description of the problem.
108106

109107
- **Review documentation changes.** Most documentation just needs a review for
110108
proper spelling and grammar. If you think a document can be improved in any
@@ -119,16 +117,18 @@ to help out:
119117
We use [Slack](https://www.ory.sh/chat). You are welcome to drop in and ask
120118
questions, discuss bugs and feature requests, talk to other users of Ory, etc.
121119

122-
Check out [Ory Kubernetes Resources Discussions](https://github.com/orgs/ory/discussions). This is a great place for
123-
in-depth discussions and lots of code examples, logs and similar data.
120+
Check out
121+
[Ory Kubernetes Resources Discussions](https://github.com/orgs/ory/discussions).
122+
This is a great place for in-depth discussions and lots of code examples, logs
123+
and similar data.
124124

125125
You can also join our community calls, if you want to speak to the Ory team
126126
directly or ask some questions. You can find more info and participate in
127127
[Slack](https://www.ory.sh/chat) in the #community-call channel.
128128

129-
If you want to receive regular notifications about updates to Ory Kubernetes Resources,
130-
consider joining the mailing list. We will _only_ send you vital information on
131-
the projects that you are interested in.
129+
If you want to receive regular notifications about updates to Ory Kubernetes
130+
Resources, consider joining the mailing list. We will _only_ send you vital
131+
information on the projects that you are interested in.
132132

133133
Also [follow us on twitter](https://twitter.com/orycorp).
134134

@@ -163,8 +163,8 @@ checklist to contribute an example:
163163

164164
Unless you are fixing a known bug, we **strongly** recommend discussing it with
165165
the core team via a GitHub issue or [in our chat](https://www.ory.sh/chat)
166-
before getting started to ensure your work is consistent with Ory Kubernetes Resources's
167-
roadmap and architecture.
166+
before getting started to ensure your work is consistent with Ory Kubernetes
167+
Resources's roadmap and architecture.
168168

169169
All contributions are made via pull requests. To make a pull request, you will
170170
need a GitHub account; if you are unclear on this process, see GitHub's

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,13 @@ helm-validate:
8989
fi; \
9090
hacks/helm-validate.sh ${HELM_CHART}
9191

92+
format: .bin/goimports node_modules
93+
.bin/goimports -w .
94+
npm exec -- prettier --write .
95+
96+
.bin/goimports:
97+
GOBIN=$(shell pwd)/.bin go install golang.org/x/tools/cmd/goimports@latest
98+
99+
node_modules: package-lock.json
100+
npm ci
101+
touch node_modules

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
[![CI](https://github.com/ory/k8s/actions/workflows/ci.yml/badge.svg)](https://github.com/ory/k8s/actions/workflows/ci.yml)
44

5-
This repository contains helm charts for Kubernetes. All charts are in incubation phase and use is at your own risk.
5+
This repository contains helm charts for Kubernetes. All charts are in
6+
incubation phase and use is at your own risk.
67

7-
Please go to [k8s.ory.sh/helm](https://k8s.ory.sh/helm/) for a list of helm charts and their configuration options.
8+
Please go to [k8s.ory.sh/helm](https://k8s.ory.sh/helm/) for a list of helm
9+
charts and their configuration options.
810

911
**NOTE**
10-
> All charts present in this repository require Kuberentes 1.18+. Please refer to releases [0.18.0](https://github.com/ory/k8s/releases/tag/v0.18.0) and older for versions supporting older releases of Kubernetes.
12+
13+
> All charts present in this repository require Kuberentes 1.18+. Please refer
14+
> to releases [0.18.0](https://github.com/ory/k8s/releases/tag/v0.18.0) and
15+
> older for versions supporting older releases of Kubernetes.
1116
1217
## Development
1318

14-
You can test and develop charts locally using [Minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/).
19+
You can test and develop charts locally using
20+
[Minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/).
1521

1622
To test a chart locally without applying it to kubernetes, do:
1723

@@ -33,7 +39,8 @@ If you wish to test ingress, run:
3339
$ minikube addons enable ingress
3440
```
3541

36-
Next you need to set up `/etc/hosts` to route traffic from domains - in this example for ORY Oathkeeper:
42+
Next you need to set up `/etc/hosts` to route traffic from domains - in this
43+
example for ORY Oathkeeper:
3744

3845
- `api.oathkeeper.localhost`
3946
- `proxy.oathkeeper.localhost`

docs/_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
theme: jekyll-theme-cayman
1+
theme: jekyll-theme-cayman

0 commit comments

Comments
 (0)