Skip to content

Commit b5c167c

Browse files
Merge branch 'master' into HARV-5764
2 parents ded023b + 8ccd8ec commit b5c167c

File tree

128 files changed

+1991
-11495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1991
-11495
lines changed

.github/workflows/pull_request.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,18 @@ jobs:
9999
# This format enables automatic generation of changelogs and versioning
100100
filter() {
101101
COMMIT="$1"
102-
ouput="$(echo "$COMMIT" | grep -e '^fix: ' -e '^feature: ' -e '^feat: ' -e 'refactor!: ' -e 'feature!: ' -e 'feat!: ' -e '^chore(main): ')"
102+
output="$(echo "$COMMIT" | grep -v -e '^fix: ' -e '^feature: ' -e '^feat: ' -e '^refactor!: ' -e '^feature!: ' -e '^feat!: ' -e '^chore(main): ' -e '^Merge branch ')"
103103
echo "$output"
104104
}
105105
prefix_check() {
106106
message="$1"
107107
if [ "" != "$(filter "$message")" ]; then
108-
echo "...Commit message does not start with the required prefix.
109-
Please use one of the following prefixes: "fix:", "feature:", "feat:", "refactor!:", "feature!:", or "feat!:".
110-
This enables release-please to automatically determine the type of release (major, minor, patch) based on the commit message.
111-
$message"
108+
cat <<EOF
109+
...Commit message does not start with the required prefix.
110+
Please use one of the following prefixes: "fix:", "feature:", "feat:", "refactor!:", "feature!:", or "feat!:".
111+
This enables release-please to automatically determine the type of release (major, minor, patch) based on the commit message.
112+
$message
113+
EOF
112114
exit 1
113115
else
114116
echo "...Commit message starts with the required prefix."
@@ -125,16 +127,17 @@ jobs:
125127
}
126128
length_check() {
127129
message="$1"
128-
if [ "$(wc -m <<<"$message")" -gt 50 ]; then
129-
echo "...Commit message subject line should be less than 50 characters, found $(wc -m "$message")."
130+
length="$(wc -m <<<"$message")"
131+
if [ $length -gt 50 ]; then
132+
echo "...Commit message subject line should be less than 50 characters, found $length."
130133
exit 1
131134
else
132135
echo "...Commit message subject line is less than 50 characters."
133136
fi
134137
}
135138
spell_check() {
136139
message="$1"
137-
WORDS="$(aspell list <<<"$message")"
140+
WORDS="$(aspell list --dont-validate-words <<<"$message")"
138141
if [ "" != "$WORDS" ]; then
139142
echo "...Commit message contains spelling errors on: ^$WORDS\$"
140143
echo "...Also try updating the PR title."

.github/workflows/release.yaml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,48 @@ jobs:
2828
uses: rancher-eio/read-vault-secrets@main
2929
with:
3030
secrets: |
31-
secret/data/github/repo/${{ github.repository }}/key/app-credentials passphrase | GPG_PASSPHRASE ;
32-
secret/data/github/repo/${{ github.repository }}/key/app-credentials privateKey | GPG_KEY
31+
secret/data/github/repo/${{ github.repository }}/signing/gpg passphrase | GPG_PASSPHRASE ;
32+
secret/data/github/repo/${{ github.repository }}/signing/gpg privateKeyId | GPG_KEY_ID ;
33+
secret/data/github/repo/${{ github.repository }}/signing/gpg privateKey | GPG_KEY
3334
3435
- name: sign shasum
3536
env:
36-
GPG_KEY: ${{ env.GPG_KEY }}
3737
GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
38+
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
39+
GPG_KEY: ${{ env.GPG_KEY }}
3840
run: |
41+
cleanup() {
42+
# clear history just in case
43+
history -c
44+
}
45+
trap cleanup EXIT TERM
46+
47+
# sanitize variables
48+
GPG_PASSPHRASE="$(echo "${GPG_PASSPHRASE}" | xargs)"
49+
GPG_KEY_ID="$(echo "${GPG_KEY_ID}" | xargs)"
50+
GPG_KEY="$(echo -n "${GPG_KEY}" | awk '/-----BEGIN PGP PRIVATE KEY BLOCK-----/,/-----END PGP PRIVATE KEY BLOCK-----/')"
51+
52+
if [ -z "${GPG_PASSPHRASE}" ]; then echo "gpg passphrase empty"; exit 1; fi
53+
if [ -z "${GPG_KEY_ID}" ]; then echo "key id empty"; exit 1; fi
54+
if [ -z "${GPG_KEY}" ]; then echo "key contents empty"; exit 1; fi
55+
3956
echo "Importing gpg key"
40-
echo -n '${{ env.GPG_KEY }}' | gpg --import --batch > /dev/null
41-
echo "signing SHASUM file"
42-
VERSION_NO_V="$(echo ${{ github.ref_name }} | tr -d 'v')"
57+
echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
58+
59+
echo "Signing SHASUM file"
60+
VERSION_NO_V="$(echo "${{ github.ref_name }}" | tr -d 'v')"
4361
SHASUM_FILE="dist/artifacts/${{ github.ref_name }}/terraform-provider-rancher2_${VERSION_NO_V}_SHA256SUMS"
44-
echo '${{ env.GPG_PASSPHRASE }}' | gpg --detach-sig --pinentry-mode loopback --passphrase-fd 0 --output "${SHASUM_FILE}.sig" --sign "${SHASUM_FILE}"
4562
46-
echo "Validating signature..."
63+
gpg --detach-sig \
64+
--pinentry-mode loopback \
65+
--passphrase "${GPG_PASSPHRASE}" \
66+
--local-user "${GPG_KEY_ID}" \
67+
--output "${SHASUM_FILE}.sig" \
68+
--sign "${SHASUM_FILE}" || { echo "Failed to sign checksum."; exit 1; }
4769
48-
if ! gpg --verify "${SHASUM_FILE}.sig" "${SHASUM_FILE}"; then
49-
echo "Signature is valid..."
50-
else
51-
echo "Signature verification failed!"
52-
exit 1
53-
fi
70+
echo "Validating signature..."
71+
gpg --verify "${SHASUM_FILE}.sig" "${SHASUM_FILE}" || { echo "Signature verification failed!"; exit 1; }
72+
echo "Signature is valid..."
5473
- name: GH release
5574
env:
5675
GH_TOKEN: ${{ github.token }}

aspell_custom.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rancher
2+
rke
3+
rke2
4+
oci
5+
oke
6+
aws
7+
azure
8+
aks
9+
eks
10+
kubernetes
11+
kubeconfig
12+
config
13+
git
14+
variablize
15+
terraform
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
page_title: "rancher2_pod_security_admission_configuration_template Data Source"
3+
---
4+
5+
# rancher2\_pod\_security\_admission\_configuration\_template Resource
6+
7+
Use this data source to retrieve information about a rancher v2 pod security admission configration template.
8+
9+
## Example Usage
10+
11+
```hcl
12+
data "rancher2_pod_security_admission_configuration_template" "foo" {
13+
name = "foo"
14+
}
15+
```
16+
17+
## Argument Reference
18+
19+
The following arguments are supported:
20+
21+
* `name` - (Required) The name of the pod security admission configuration template (string)
22+
23+
## Attributes Reference
24+
25+
The following attributes are exported:
26+
27+
* `description` - (Computed) The description of the pod security admission configuration template (string)
28+
* `defaults` - (Computed) The default level labels and version labels to be applied when labels for a mode is not set (list maxitems:1)
29+
* `exemptions`- (Computed) The authenticated usernames, runtime class names, and namespaces to exempt (list maxitems:1)
30+
* `annotations` - (Computed) Annotations of the resource (map)
31+
* `labels` - (Computed) Labels of the resource (map)
32+

docs/guides/apps_marketplace.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,59 @@ resource "rancher2_app_v2" "rancher-istio" {
189189
}
190190
```
191191

192+
* `prometheus-federator` - Deploy Prometheus Federator
193+
194+
```hcl
195+
resource "rancher2_app_v2" "prometheus-federator" {
196+
cluster_id = "<CLUSTER_ID>"
197+
name = "prometheus-federator"
198+
namespace = "cattle-monitoring-system"
199+
repo_name = "rancher-charts"
200+
chart_name = "prometheus-federator"
201+
chart_version = "104.0.2+up0.4.2"
202+
values = <<EOF
203+
global:
204+
cattle:
205+
clusterId: <CLUSTER_ID>
206+
projectLabel: field.cattle.io/projectId
207+
psp:
208+
enabled: false
209+
systemDefaultRegistry: registry.rancher.com
210+
systemProjectId: <PROJECT_ID>
211+
url: <RANCHER_SERVER_URL>
212+
clusterName: custom
213+
rkePathPrefix: ''
214+
rkeWindowsPathPrefix: ''
215+
imagePullSecrets: []
216+
rbac:
217+
pspAnnotations: {}
218+
pspEnabled: true
219+
systemDefaultRegistry: registry.rancher.com
220+
EOF
221+
}
222+
223+
# About the variables of the values.yaml file
224+
#
225+
# CLUSTER_ID
226+
# When viewing a specific cluster in the Rancher UI, the cluster ID (formatted as c-xxxxx) is visible in the browser's URL bar
227+
# You can also get the ID through Rancher API:
228+
#
229+
# curl -s "https://${RANCHER_SERVER}/v3/clusters?name=${CLUSTER_NAME}" \
230+
# -H 'content-type: application/json' \
231+
# -H "Authorization: Bearer $APITOKEN" \
232+
# --insecure | jq -r .data[0].id
233+
#
234+
#
235+
# PROJECT_ID
236+
# Go to Cluster Management>Explore>Cluster>Projects/Namespaces
237+
# then go to the ellipsis button (three dots) to the right of the project name and select "View YAML."
238+
# In the displayed YAML, the metadata.name field contains the Rancher Project ID (formatted as p-xxxxx)
239+
#
240+
#
241+
# RANCHER_SERVER_URL
242+
# It's the protocol and hostname of your Rancher server, e.g. https://rancher.my.org, configured during the installation with Helm
243+
```
244+
192245
* `rancher-cis-benchmark` - Deploy Rancher cis benchmark
193246

194247
```hcl

0 commit comments

Comments
 (0)