Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
534684601e | ||
|
|
1feda85ec9 | ||
|
|
e3cdb1902c | ||
|
|
cb0cf95cb8 | ||
|
|
81f8bf88dd | ||
|
|
aa4cad4740 | ||
|
|
a3550cce4e | ||
|
|
384d472b40 | ||
|
|
aabdd28d9d | ||
|
|
297c0f04de | ||
|
|
e0bee66876 | ||
|
|
32d46e6da3 | ||
|
|
1beac67a01 | ||
|
|
148e4015e5 | ||
|
|
c631a76250 | ||
|
|
9d04f9147c | ||
|
|
93c127f8e7 | ||
|
|
1749169c98 | ||
|
|
6cb3954044 | ||
|
|
24c77adcbf | ||
|
|
5c5c15ea21 | ||
|
|
775838d3ad | ||
|
|
eaae83efa4 | ||
|
|
c1f7f20454 | ||
|
|
bba9e0952d | ||
|
|
0ea68fd43b | ||
|
|
492b50e4f0 | ||
|
|
f46f59bbba | ||
|
|
2eb52e314a | ||
|
|
06dd89e160 | ||
|
|
2ac481c889 | ||
|
|
f434fed50f | ||
|
|
01f43fc109 | ||
|
|
c369c06731 | ||
|
|
9b3958825a | ||
|
|
f581add81c | ||
|
|
107dbd09ab | ||
|
|
ec034c0c3c | ||
|
|
012782448e | ||
|
|
6be9ce2d4e | ||
|
|
0a380b1495 | ||
|
|
aae92ee097 | ||
|
|
459f6f2c24 | ||
|
|
986e405ada |
3
.github/labels.yaml
vendored
3
.github/labels.yaml
vendored
@@ -50,6 +50,3 @@
|
|||||||
- name: backport:release/v2.1.x
|
- name: backport:release/v2.1.x
|
||||||
description: To be backported to release/v2.1.x
|
description: To be backported to release/v2.1.x
|
||||||
color: '#ffd700'
|
color: '#ffd700'
|
||||||
- name: backport:release/v2.2.x
|
|
||||||
description: To be backported to release/v2.2.x
|
|
||||||
color: '#ffd700'
|
|
||||||
|
|||||||
20
.github/runners/README.md
vendored
20
.github/runners/README.md
vendored
@@ -5,17 +5,15 @@ The Flux ARM64 end-to-end tests run on Equinix Metal instances provisioned with
|
|||||||
## Current instances
|
## Current instances
|
||||||
|
|
||||||
| Repository | Runner | Instance | Location |
|
| Repository | Runner | Instance | Location |
|
||||||
|-----------------------------|------------------|----------------|---------------|
|
|-----------------------------|------------------|------------------------|---------------|
|
||||||
| flux2 | equinix-arm-dc-1 | flux-arm-dc-01 | Washington DC |
|
| flux2 | equinix-arm-dc-1 | flux-equinix-arm-dc-01 | Washington DC |
|
||||||
| flux2 | equinix-arm-dc-2 | flux-arm-dc-01 | Washington DC |
|
| flux2 | equinix-arm-dc-2 | flux-equinix-arm-dc-01 | Washington DC |
|
||||||
| flux2 | equinix-arm-da-1 | flux-arm-da-01 | Dallas |
|
| flux2 | equinix-arm-da-1 | flux-equinix-arm-da-01 | Dallas |
|
||||||
| flux2 | equinix-arm-da-2 | flux-arm-da-01 | Dallas |
|
| flux2 | equinix-arm-da-2 | flux-equinix-arm-da-01 | Dallas |
|
||||||
| flux-benchmark | equinix-arm-dc-1 | flux-arm-dc-01 | Washington DC |
|
| source-controller | equinix-arm-dc-1 | flux-equinix-arm-dc-01 | Washington DC |
|
||||||
| flux-benchmark | equinix-arm-da-1 | flux-arm-da-01 | Dallas |
|
| source-controller | equinix-arm-da-1 | flux-equinix-arm-da-01 | Dallas |
|
||||||
| source-controller | equinix-arm-dc-1 | flux-arm-dc-01 | Washington DC |
|
| image-automation-controller | equinix-arm-dc-1 | flux-equinix-arm-dc-01 | Washington DC |
|
||||||
| source-controller | equinix-arm-da-1 | flux-arm-da-01 | Dallas |
|
| image-automation-controller | equinix-arm-da-1 | flux-equinix-arm-da-01 | Dallas |
|
||||||
| image-automation-controller | equinix-arm-dc-1 | flux-arm-dc-01 | Washington DC |
|
|
||||||
| image-automation-controller | equinix-arm-da-1 | flux-arm-da-01 | Dallas |
|
|
||||||
|
|
||||||
Instance spec:
|
Instance spec:
|
||||||
- Ampere Altra Q80-30 80-core processor @ 2.8GHz
|
- Ampere Altra Q80-30 80-core processor @ 2.8GHz
|
||||||
|
|||||||
10
.github/runners/prereq.sh
vendored
10
.github/runners/prereq.sh
vendored
@@ -18,11 +18,11 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
KIND_VERSION=0.22.0
|
KIND_VERSION=0.17.0
|
||||||
KUBECTL_VERSION=1.29.0
|
KUBECTL_VERSION=1.24.0
|
||||||
KUSTOMIZE_VERSION=5.3.0
|
KUSTOMIZE_VERSION=4.5.7
|
||||||
HELM_VERSION=3.14.1
|
HELM_VERSION=3.10.1
|
||||||
GITHUB_RUNNER_VERSION=2.313.0
|
GITHUB_RUNNER_VERSION=2.298.2
|
||||||
PACKAGES="apt-transport-https ca-certificates software-properties-common build-essential libssl-dev gnupg lsb-release jq pkg-config"
|
PACKAGES="apt-transport-https ca-certificates software-properties-common build-essential libssl-dev gnupg lsb-release jq pkg-config"
|
||||||
|
|
||||||
# install prerequisites
|
# install prerequisites
|
||||||
|
|||||||
2
.github/runners/runner-setup.sh
vendored
2
.github/runners/runner-setup.sh
vendored
@@ -22,7 +22,7 @@ RUNNER_NAME=$1
|
|||||||
REPOSITORY_TOKEN=$2
|
REPOSITORY_TOKEN=$2
|
||||||
REPOSITORY_URL=${3:-https://github.com/fluxcd/flux2}
|
REPOSITORY_URL=${3:-https://github.com/fluxcd/flux2}
|
||||||
|
|
||||||
GITHUB_RUNNER_VERSION=2.313.0
|
GITHUB_RUNNER_VERSION=2.298.2
|
||||||
|
|
||||||
# download runner
|
# download runner
|
||||||
curl -o actions-runner-linux-arm64.tar.gz -L https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/actions-runner-linux-arm64-${GITHUB_RUNNER_VERSION}.tar.gz \
|
curl -o actions-runner-linux-arm64.tar.gz -L https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/actions-runner-linux-arm64-${GITHUB_RUNNER_VERSION}.tar.gz \
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ func init() {
|
|||||||
|
|
||||||
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.commitMessageAppendix, "commit-message-appendix", "", "string to add to the commit messages, e.g. '[ci skip]'")
|
bootstrapCmd.PersistentFlags().StringVar(&bootstrapArgs.commitMessageAppendix, "commit-message-appendix", "", "string to add to the commit messages, e.g. '[ci skip]'")
|
||||||
|
|
||||||
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.force, "force", false, "override existing Flux installation if it's managed by a different tool such as Helm")
|
bootstrapCmd.PersistentFlags().BoolVar(&bootstrapArgs.force, "force", false, "override existing Flux installation if it's managed by a diffrent tool such as Helm")
|
||||||
bootstrapCmd.PersistentFlags().MarkHidden("manifests")
|
bootstrapCmd.PersistentFlags().MarkHidden("manifests")
|
||||||
|
|
||||||
rootCmd.AddCommand(bootstrapCmd)
|
rootCmd.AddCommand(bootstrapCmd)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ func init() {
|
|||||||
installCmd.Flags().StringVar(&installArgs.clusterDomain, "cluster-domain", rootArgs.defaults.ClusterDomain, "internal cluster domain")
|
installCmd.Flags().StringVar(&installArgs.clusterDomain, "cluster-domain", rootArgs.defaults.ClusterDomain, "internal cluster domain")
|
||||||
installCmd.Flags().StringSliceVar(&installArgs.tolerationKeys, "toleration-keys", nil,
|
installCmd.Flags().StringSliceVar(&installArgs.tolerationKeys, "toleration-keys", nil,
|
||||||
"list of toleration keys used to schedule the components pods onto nodes with matching taints")
|
"list of toleration keys used to schedule the components pods onto nodes with matching taints")
|
||||||
installCmd.Flags().BoolVar(&installArgs.force, "force", false, "override existing Flux installation if it's managed by a different tool such as Helm")
|
installCmd.Flags().BoolVar(&installArgs.force, "force", false, "override existing Flux installation if it's managed by a diffrent tool such as Helm")
|
||||||
installCmd.Flags().MarkHidden("manifests")
|
installCmd.Flags().MarkHidden("manifests")
|
||||||
|
|
||||||
rootCmd.AddCommand(installCmd)
|
rootCmd.AddCommand(installCmd)
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ func WithTimeout(timeout time.Duration) BuilderOptionFunc {
|
|||||||
|
|
||||||
func WithProgressBar() BuilderOptionFunc {
|
func WithProgressBar() BuilderOptionFunc {
|
||||||
return func(b *Builder) error {
|
return func(b *Builder) error {
|
||||||
// Add a spinner
|
// Add a spiner
|
||||||
cfg := yacspin.Config{
|
cfg := yacspin.Config{
|
||||||
Frequency: 100 * time.Millisecond,
|
Frequency: 100 * time.Millisecond,
|
||||||
CharSet: yacspin.CharSets[59],
|
CharSet: yacspin.CharSets[59],
|
||||||
@@ -361,7 +361,7 @@ func (b *Builder) generate(kustomization kustomizev1.Kustomization, dirPath stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
// a scanner will be used down the line to parse the list
|
// a scanner will be used down the line to parse the list
|
||||||
// so we have to make sure to include newlines
|
// so we have to make sure to unclude newlines
|
||||||
ignoreList := strings.Join(b.ignore, "\n")
|
ignoreList := strings.Join(b.ignore, "\n")
|
||||||
gen := kustomize.NewGeneratorWithIgnore("", ignoreList, unstructured.Unstructured{Object: data})
|
gen := kustomize.NewGeneratorWithIgnore("", ignoreList, unstructured.Unstructured{Object: data})
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ func (b *Builder) generate(kustomization kustomizev1.Kustomization, dirPath stri
|
|||||||
func (b *Builder) do(ctx context.Context, kustomization kustomizev1.Kustomization, dirPath string) (resmap.ResMap, error) {
|
func (b *Builder) do(ctx context.Context, kustomization kustomizev1.Kustomization, dirPath string) (resmap.ResMap, error) {
|
||||||
fs := filesys.MakeFsOnDisk()
|
fs := filesys.MakeFsOnDisk()
|
||||||
|
|
||||||
// acquire the lock
|
// acuire the lock
|
||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
defer b.mu.Unlock()
|
defer b.mu.Unlock()
|
||||||
|
|
||||||
@@ -562,9 +562,9 @@ func maskSopsDataInStringDataSecret(stringDataMap map[string]string, mask string
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cancel cancels the build
|
// Cancel cancels the build
|
||||||
// It restores a clean repository
|
// It restores a clean reprository
|
||||||
func (b *Builder) Cancel() error {
|
func (b *Builder) Cancel() error {
|
||||||
// acquire the lock
|
// acuire the lock
|
||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
defer b.mu.Unlock()
|
defer b.mu.Unlock()
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
# :warning: Removal Notice
|
# :warning: Deprecation Notice
|
||||||
|
|
||||||
Starting Flux v2.1.0, released August 24, 2023, the Flux monitoring
|
Starting Flux v2.1.0, released August 24, 2023, the Flux monitoring
|
||||||
configurations in this repository were marked as deprecated. The new monitoring
|
configurations in this repository will be marked as deprecated. New monitoring
|
||||||
docs are available at [Flux monitoring](https://fluxcd.io/flux/monitoring/)
|
docs are available at [Flux monitoring](https://fluxcd.io/flux/monitoring/)
|
||||||
docs with new example configurations in
|
docs with new example configurations in
|
||||||
[fluxcd/flux2-monitoring-example](https://github.com/fluxcd/flux2-monitoring-example/).
|
[fluxcd/flux2-monitoring-example](https://github.com/fluxcd/flux2-monitoring-example/).
|
||||||
|
The deprecated configurations will be removed in a future release of Flux. All
|
||||||
The deprecated configurations were removed in Flux v2.2 on December 13, 2023. All
|
users of these configurations are recommended to use the new monitoring setup,
|
||||||
users of these configurations are advised to use the new monitoring setup,
|
following the docs and the new examples.
|
||||||
following the [docs](https://fluxcd.io/flux/monitoring/) and the
|
|
||||||
[examples](https://github.com/fluxcd/flux2-monitoring-example/).
|
|
||||||
|
|
||||||
After collecting a lot of user feedback about our monitoring recommendation, in
|
After collecting a lot of user feedback about our monitoring recommendation, in
|
||||||
order to serve most of the needs of the users, we decided to create a new
|
order to serve most of the needs of the users, we decided to create a new
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: monitoring
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- repository.yaml
|
||||||
|
- release.yaml
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: monitoring
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/component: monitoring
|
||||||
51
manifests/monitoring/kube-prometheus-stack/release.yaml
Normal file
51
manifests/monitoring/kube-prometheus-stack/release.yaml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: kube-prometheus-stack
|
||||||
|
spec:
|
||||||
|
interval: 5m
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
version: "45.x"
|
||||||
|
chart: kube-prometheus-stack
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: prometheus-community
|
||||||
|
interval: 60m
|
||||||
|
install:
|
||||||
|
crds: Create
|
||||||
|
upgrade:
|
||||||
|
crds: CreateReplace
|
||||||
|
# https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml
|
||||||
|
values:
|
||||||
|
alertmanager:
|
||||||
|
enabled: false
|
||||||
|
prometheus:
|
||||||
|
prometheusSpec:
|
||||||
|
retention: 24h
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 200Mi
|
||||||
|
podMonitorNamespaceSelector: {}
|
||||||
|
podMonitorSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/component: monitoring
|
||||||
|
postRenderers:
|
||||||
|
- kustomize:
|
||||||
|
patches:
|
||||||
|
- target:
|
||||||
|
# Ignore these objects from Flux diff as they are mutated from chart hooks
|
||||||
|
kind: (ValidatingWebhookConfiguration|MutatingWebhookConfiguration)
|
||||||
|
name: kube-prometheus-stack-admission
|
||||||
|
patch: |
|
||||||
|
- op: add
|
||||||
|
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection
|
||||||
|
value: disabled
|
||||||
|
- target:
|
||||||
|
# Ignore these objects from Flux diff as they are mutated at apply time but not at dry-run time
|
||||||
|
kind: PrometheusRule
|
||||||
|
patch: |
|
||||||
|
- op: add
|
||||||
|
path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection
|
||||||
|
value: disabled
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: prometheus-community
|
||||||
|
spec:
|
||||||
|
interval: 120m
|
||||||
|
# OCI builds for kube-prometheus-stack have been temporarily disabled (see https://github.com/prometheus-community/helm-charts/issues/2940).
|
||||||
|
type: default
|
||||||
|
url: https://prometheus-community.github.io/helm-charts
|
||||||
6
manifests/monitoring/loki-stack/kustomization.yaml
Normal file
6
manifests/monitoring/loki-stack/kustomization.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: monitoring
|
||||||
|
resources:
|
||||||
|
- repository.yaml
|
||||||
|
- release.yaml
|
||||||
40
manifests/monitoring/loki-stack/release.yaml
Normal file
40
manifests/monitoring/loki-stack/release.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2beta1
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: loki-stack
|
||||||
|
spec:
|
||||||
|
interval: 5m
|
||||||
|
dependsOn:
|
||||||
|
- name: kube-prometheus-stack
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
version: "2.x"
|
||||||
|
chart: loki-stack
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: grafana-charts
|
||||||
|
interval: 60m
|
||||||
|
# https://github.com/grafana/helm-charts/blob/main/charts/loki-stack/values.yaml
|
||||||
|
# https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml
|
||||||
|
values:
|
||||||
|
grafana:
|
||||||
|
enabled: false
|
||||||
|
sidecar:
|
||||||
|
datasources:
|
||||||
|
enabled: true
|
||||||
|
maxLines: 1000
|
||||||
|
promtail:
|
||||||
|
enabled: true
|
||||||
|
loki:
|
||||||
|
enabled: true
|
||||||
|
isDefault: false
|
||||||
|
serviceMonitor:
|
||||||
|
enabled: true
|
||||||
|
additionalLabels:
|
||||||
|
app.kubernetes.io/part-of: kube-prometheus-stack
|
||||||
|
config:
|
||||||
|
chunk_store_config:
|
||||||
|
max_look_back_period: 0s
|
||||||
|
table_manager:
|
||||||
|
retention_deletes_enabled: true
|
||||||
|
retention_period: 12h
|
||||||
7
manifests/monitoring/loki-stack/repository.yaml
Normal file
7
manifests/monitoring/loki-stack/repository.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: grafana-charts
|
||||||
|
spec:
|
||||||
|
interval: 120m0s
|
||||||
|
url: https://grafana.github.io/helm-charts
|
||||||
1006
manifests/monitoring/monitoring-config/dashboards/cluster.json
Normal file
1006
manifests/monitoring/monitoring-config/dashboards/cluster.json
Normal file
File diff suppressed because it is too large
Load Diff
1637
manifests/monitoring/monitoring-config/dashboards/control-plane.json
Normal file
1637
manifests/monitoring/monitoring-config/dashboards/control-plane.json
Normal file
File diff suppressed because it is too large
Load Diff
332
manifests/monitoring/monitoring-config/dashboards/logs.json
Normal file
332
manifests/monitoring/monitoring-config/dashboards/logs.json
Normal file
@@ -0,0 +1,332 @@
|
|||||||
|
{
|
||||||
|
"__inputs": [
|
||||||
|
{
|
||||||
|
"name": "DS_LOKI",
|
||||||
|
"label": "Loki",
|
||||||
|
"description": "",
|
||||||
|
"type": "datasource",
|
||||||
|
"pluginId": "loki",
|
||||||
|
"pluginName": "Loki"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"annotations": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"builtIn": 1,
|
||||||
|
"datasource": "-- Grafana --",
|
||||||
|
"enable": true,
|
||||||
|
"hide": true,
|
||||||
|
"iconColor": "rgba(0, 211, 255, 1)",
|
||||||
|
"name": "Annotations & Alerts",
|
||||||
|
"target": {
|
||||||
|
"limit": 100,
|
||||||
|
"matchAny": false,
|
||||||
|
"tags": [],
|
||||||
|
"type": "dashboard"
|
||||||
|
},
|
||||||
|
"type": "dashboard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": {
|
||||||
|
"type": "datasource",
|
||||||
|
"uid": "grafana"
|
||||||
|
},
|
||||||
|
"enable": true,
|
||||||
|
"iconColor": "red",
|
||||||
|
"name": "flux events",
|
||||||
|
"target": {
|
||||||
|
"limit": 100,
|
||||||
|
"matchAny": false,
|
||||||
|
"tags": [
|
||||||
|
"flux"
|
||||||
|
],
|
||||||
|
"type": "tags"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"description": "Flux logs collected from Kubernetes, stored in Loki",
|
||||||
|
"editable": true,
|
||||||
|
"gnetId": null,
|
||||||
|
"graphTooltip": 0,
|
||||||
|
"id": 29,
|
||||||
|
"iteration": 1653748775696,
|
||||||
|
"links": [],
|
||||||
|
"liveNow": false,
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"description": "",
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "auto",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"drawStyle": "bars",
|
||||||
|
"fillOpacity": 0,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"lineInterpolation": "linear",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"pointSize": 5,
|
||||||
|
"scaleDistribution": {
|
||||||
|
"type": "linear"
|
||||||
|
},
|
||||||
|
"showPoints": "auto",
|
||||||
|
"spanNulls": false,
|
||||||
|
"stacking": {
|
||||||
|
"group": "A",
|
||||||
|
"mode": "none"
|
||||||
|
},
|
||||||
|
"thresholdsStyle": {
|
||||||
|
"mode": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mappings": [],
|
||||||
|
"thresholds": {
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"color": "green",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"color": "red",
|
||||||
|
"value": 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"h": 4,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"id": 4,
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"calcs": [],
|
||||||
|
"displayMode": "hidden",
|
||||||
|
"placement": "bottom"
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"expr": "sum(count_over_time({namespace=~\"$namespace\", stream=~\"$stream\", app =~\"$controller\"} | json | __error__!=\"JSONParserErr\" | level=~\"$level\" |= \"$query\" [$__interval]))",
|
||||||
|
"instant": false,
|
||||||
|
"legendFormat": "Log count",
|
||||||
|
"range": true,
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "timeseries"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"description": "Logs from services running in Kubernetes",
|
||||||
|
"gridPos": {
|
||||||
|
"h": 25,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 4
|
||||||
|
},
|
||||||
|
"id": 2,
|
||||||
|
"options": {
|
||||||
|
"dedupStrategy": "numbers",
|
||||||
|
"enableLogDetails": false,
|
||||||
|
"prettifyLogMessage": true,
|
||||||
|
"showCommonLabels": false,
|
||||||
|
"showLabels": false,
|
||||||
|
"showTime": false,
|
||||||
|
"sortOrder": "Descending",
|
||||||
|
"wrapLogMessage": false
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"expr": "{namespace=~\"$namespace\", stream=~\"$stream\", app =~\"$controller\"} | json | __error__!=\"JSONParserErr\" | level=~\"$level\" |= \"$query\"",
|
||||||
|
"refId": "A"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type": "logs"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"refresh": "10s",
|
||||||
|
"schemaVersion": 36,
|
||||||
|
"style": "light",
|
||||||
|
"tags": [
|
||||||
|
"flux"
|
||||||
|
],
|
||||||
|
"templating": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"selected": false,
|
||||||
|
"text": "",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
"description": "String to search for",
|
||||||
|
"hide": 0,
|
||||||
|
"label": "Search Query",
|
||||||
|
"name": "query",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"selected": true,
|
||||||
|
"text": "",
|
||||||
|
"value": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"query": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"type": "textbox"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allValue": "info|error",
|
||||||
|
"current": {
|
||||||
|
"selected": false,
|
||||||
|
"text": "All",
|
||||||
|
"value": "$__all"
|
||||||
|
},
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": true,
|
||||||
|
"multi": false,
|
||||||
|
"name": "level",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"selected": true,
|
||||||
|
"text": "All",
|
||||||
|
"value": "$__all"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"selected": false,
|
||||||
|
"text": "info",
|
||||||
|
"value": "info"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"selected": false,
|
||||||
|
"text": "error",
|
||||||
|
"value": "error"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"query": "info,error",
|
||||||
|
"queryValue": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allValue": ".+",
|
||||||
|
"current": {
|
||||||
|
"selected": true,
|
||||||
|
"text": [
|
||||||
|
"All"
|
||||||
|
],
|
||||||
|
"value": [
|
||||||
|
"$__all"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"definition": "label_values(app)",
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": true,
|
||||||
|
"multi": true,
|
||||||
|
"name": "controller",
|
||||||
|
"options": [],
|
||||||
|
"query": "label_values(app)",
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"sort": 0,
|
||||||
|
"type": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allValue": ".+",
|
||||||
|
"current": {
|
||||||
|
"selected": true,
|
||||||
|
"text": [
|
||||||
|
"flux-system"
|
||||||
|
],
|
||||||
|
"value": [
|
||||||
|
"flux-system"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"definition": "label_values(namespace)",
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": true,
|
||||||
|
"multi": true,
|
||||||
|
"name": "namespace",
|
||||||
|
"options": [],
|
||||||
|
"query": "label_values(namespace)",
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"sort": 0,
|
||||||
|
"type": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allValue": ".+",
|
||||||
|
"current": {
|
||||||
|
"selected": false,
|
||||||
|
"text": "All",
|
||||||
|
"value": "$__all"
|
||||||
|
},
|
||||||
|
"datasource": "${DS_LOKI}",
|
||||||
|
"definition": "label_values(stream)",
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": true,
|
||||||
|
"multi": true,
|
||||||
|
"name": "stream",
|
||||||
|
"options": [],
|
||||||
|
"query": "label_values(stream)",
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"sort": 0,
|
||||||
|
"type": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"current": {
|
||||||
|
"selected": false,
|
||||||
|
"text": "Loki",
|
||||||
|
"value": "Loki"
|
||||||
|
},
|
||||||
|
"hide": 0,
|
||||||
|
"includeAll": false,
|
||||||
|
"label": "Datasource",
|
||||||
|
"multi": false,
|
||||||
|
"name": "DS_LOKI",
|
||||||
|
"options": [],
|
||||||
|
"query": "loki",
|
||||||
|
"refresh": 1,
|
||||||
|
"regex": "",
|
||||||
|
"skipUrlSync": false,
|
||||||
|
"type": "datasource"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"from": "now-6h",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"timepicker": {},
|
||||||
|
"timezone": "",
|
||||||
|
"title": "Flux Logs",
|
||||||
|
"uid": "flux-logs",
|
||||||
|
"version": 2
|
||||||
|
}
|
||||||
16
manifests/monitoring/monitoring-config/kustomization.yaml
Normal file
16
manifests/monitoring/monitoring-config/kustomization.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: monitoring
|
||||||
|
resources:
|
||||||
|
- podmonitor.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: flux-grafana-dashboards
|
||||||
|
files:
|
||||||
|
- dashboards/control-plane.json
|
||||||
|
- dashboards/cluster.json
|
||||||
|
- dashboards/logs.json
|
||||||
|
options:
|
||||||
|
labels:
|
||||||
|
grafana_dashboard: "1"
|
||||||
|
app.kubernetes.io/part-of: flux
|
||||||
|
app.kubernetes.io/component: monitoring
|
||||||
30
manifests/monitoring/monitoring-config/podmonitor.yaml
Normal file
30
manifests/monitoring/monitoring-config/podmonitor.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PodMonitor
|
||||||
|
metadata:
|
||||||
|
name: flux-system
|
||||||
|
namespace: flux-system
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: flux
|
||||||
|
app.kubernetes.io/component: monitoring
|
||||||
|
spec:
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- flux-system
|
||||||
|
selector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: app
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- helm-controller
|
||||||
|
- source-controller
|
||||||
|
- kustomize-controller
|
||||||
|
- notification-controller
|
||||||
|
- image-automation-controller
|
||||||
|
- image-reflector-controller
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: http-prom
|
||||||
|
relabelings:
|
||||||
|
# https://github.com/prometheus-operator/prometheus-operator/issues/4816
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_phase]
|
||||||
|
action: keep
|
||||||
|
regex: Running
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 177 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 731 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB |
@@ -1,134 +0,0 @@
|
|||||||
# Flux CDEvents Receiver
|
|
||||||
|
|
||||||
<!--
|
|
||||||
The title must be short and descriptive.
|
|
||||||
-->
|
|
||||||
|
|
||||||
**Status:** provisional
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Status represents the current state of the RFC.
|
|
||||||
Must be one of `provisional`, `implementable`, `implemented`, `deferred`, `rejected`, `withdrawn`, or `replaced`.
|
|
||||||
-->
|
|
||||||
|
|
||||||
**Creation date:** 2023-12-08
|
|
||||||
|
|
||||||
**Last update:** 2024-02-09
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The CDEvents Receiver for Flux receives a CDEvent sent to the receiver webhook URL, verifies it and checks the event type against `.spec.events`, then triggers reconciliation of the configured resources.
|
|
||||||
<!--
|
|
||||||
One paragraph explanation of the proposed feature or enhancement.
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Motivation
|
|
||||||
|
|
||||||
CDEvents enables interoperability between supported tools in a workflow, and flux is a very popular continuous delivery tool, as such we have received many questions about implementing CDEvents into the tool.
|
|
||||||
<!--
|
|
||||||
This section is for explicitly listing the motivation, goals, and non-goals of
|
|
||||||
this RFC. Describe why the change is important and the benefits to users.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Goals
|
|
||||||
|
|
||||||
Integrate CDEvents into Flux with a CDEvents Receiver.
|
|
||||||
<!--
|
|
||||||
List the specific goals of this RFC. What is it trying to achieve? How will we
|
|
||||||
know that this has succeeded?
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Non-Goals
|
|
||||||
|
|
||||||
A CDEvent provider will be handled as a separate RFC in the future.
|
|
||||||
|
|
||||||
<!--
|
|
||||||
What is out of scope for this RFC? Listing non-goals helps to focus discussion
|
|
||||||
and make progress.
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Proposal
|
|
||||||
|
|
||||||
Add CDEvents to the list of available receivers in Flux Notification controller. Similar to other receivers such as the github, the user will be able to use `spec.events` in order to specify which event types the receiver will allow. The receiver will also verify using the [CDEvents Go SDK](https://github.com/cdevents/sdk-go) that the payload sent to the webhook URL is a valid CDEvent.
|
|
||||||
|
|
||||||
<!--
|
|
||||||
This is where we get down to the specifics of what the proposal actually is.
|
|
||||||
This should have enough detail that reviewers can understand exactly what
|
|
||||||
you're proposing, but should not include things like API designs or
|
|
||||||
implementation.
|
|
||||||
|
|
||||||
If the RFC goal is to document best practices,
|
|
||||||
then this section can be replaced with the actual documentation.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### User Stories
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Optional if existing discussions and/or issues are linked in the motivation section.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
Using Tekton the user triggers something that will fire off a CDEvent to the CloudEvents Broker. A subscription that the user will have set up externally will then send a relevant CDEvent to the CDEvent Receiver within Flux based on the configuration.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Alternatives
|
|
||||||
|
|
||||||
Certain use cases for CDEvents could be done alternatively using available receivers such as the generic webhook.
|
|
||||||
|
|
||||||
<!--
|
|
||||||
List plausible alternatives to the proposal and explain why the proposal is superior.
|
|
||||||
|
|
||||||
This is a good place to incorporate suggestions made during discussion of the RFC.
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Design Details
|
|
||||||
|
|
||||||
Adding a receiver for CDEvents that works much like the other event-based receivers already implemented. The user will be able to write a yaml file for the receiver and deploy it to their cluster. The receiver takes the payload sent to the webhook URL by an external events broker, checks the headers for the event type, and filters out events based on the user-defined list of events in spec.Events. If left empty, it will act on all valid CDEvents. It then validates the payload body using the [CDEvents Go SDK](https://github.com/cdevents/sdk-go). Valid events will then trigger reconciliation of the resources. The events broker is not a part of this design and is left to the user to set up however they wish.
|
|
||||||
|
|
||||||
Example Receiver YAML:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
apiVersion: notification.toolkit.fluxcd.io/v1
|
|
||||||
kind: Receiver
|
|
||||||
metadata:
|
|
||||||
name: cdevents-receiver
|
|
||||||
namespace: flux-system
|
|
||||||
spec:
|
|
||||||
type: cdevents
|
|
||||||
events:
|
|
||||||
- "dev.cdevents.change.merged"
|
|
||||||
secretRef:
|
|
||||||
name: receiver-token
|
|
||||||
resources:
|
|
||||||
- kind: GitRespository
|
|
||||||
apiVersion: source.toolkit.fluxcd.io/v1
|
|
||||||
name: webapp
|
|
||||||
namespace: flux-system
|
|
||||||
```
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
<!--
|
|
||||||
This section should contain enough information that the specifics of your
|
|
||||||
change are understandable. This may include API specs and code snippets.
|
|
||||||
|
|
||||||
The design details should address at least the following questions:
|
|
||||||
- How can this feature be enabled / disabled?
|
|
||||||
- Does enabling the feature change any default behavior?
|
|
||||||
- Can the feature be disabled once it has been enabled?
|
|
||||||
- How can an operator determine if the feature is in use?
|
|
||||||
- Are there any drawbacks when enabling this feature?
|
|
||||||
-->
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## Implementation History
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Major milestones in the lifecycle of the RFC such as:
|
|
||||||
- The first Flux release where an initial version of the RFC was available.
|
|
||||||
- The version of Flux where the RFC graduated to general availability.
|
|
||||||
- The version of Flux where the RFC was retired or superseded.
|
|
||||||
-->
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 649 KiB |
@@ -17,14 +17,6 @@ test-azure:
|
|||||||
test-gcp:
|
test-gcp:
|
||||||
$(MAKE) test PROVIDER_ARG="-provider gcp"
|
$(MAKE) test PROVIDER_ARG="-provider gcp"
|
||||||
|
|
||||||
destroy:
|
|
||||||
go test -timeout $(TEST_TIMEOUT) -v ./ $(GO_TEST_ARGS) $(PROVIDER_ARG) -destroy-only
|
|
||||||
|
|
||||||
destroy-azure:
|
|
||||||
$(MAKE) destroy PROVIDER_ARG="-provider azure"
|
|
||||||
|
|
||||||
destroy-gcp:
|
|
||||||
$(MAKE) destroy PROVIDER_ARG="-provider gcp"
|
|
||||||
|
|
||||||
sops-check:
|
sops-check:
|
||||||
ifeq ($(shell which sops),)
|
ifeq ($(shell which sops),)
|
||||||
|
|||||||
@@ -74,10 +74,6 @@ variables using
|
|||||||
use the terraform configuration below. Please make sure all the requirements of
|
use the terraform configuration below. Please make sure all the requirements of
|
||||||
azure-gh-actions are followed before running it.
|
azure-gh-actions are followed before running it.
|
||||||
|
|
||||||
**NOTE:** When running the following for a repo under an organization, set the
|
|
||||||
environment variable `GITHUB_ORGANIZATION` if setting the `owner` in the
|
|
||||||
`github` provider doesn't work.
|
|
||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
provider "github" {
|
provider "github" {
|
||||||
owner = "fluxcd"
|
owner = "fluxcd"
|
||||||
@@ -222,7 +218,7 @@ variables using
|
|||||||
use the terraform configuration below. Please make sure all the requirements of
|
use the terraform configuration below. Please make sure all the requirements of
|
||||||
gcp-gh-actions are followed before running it.
|
gcp-gh-actions are followed before running it.
|
||||||
|
|
||||||
**NOTE:** When running the following for a repo under an organization, set the
|
**NOTE:** When running the following for a repo under and organization, set the
|
||||||
environment variable `GITHUB_ORGANIZATION` if setting the `owner` in the
|
environment variable `GITHUB_ORGANIZATION` if setting the `owner` in the
|
||||||
`github` provider doesn't work.
|
`github` provider doesn't work.
|
||||||
|
|
||||||
@@ -349,13 +345,8 @@ We also pull two version of `ghcr.io/stefanprodan/podinfo` image. These images a
|
|||||||
Container Registry and used to test `ImageRepository` and `ImageUpdateAutomation`. The terraform resources get created
|
Container Registry and used to test `ImageRepository` and `ImageUpdateAutomation`. The terraform resources get created
|
||||||
and the tests are run.
|
and the tests are run.
|
||||||
|
|
||||||
If not configured explicitly to retain the infrastructure, at the end of the
|
**IMPORTANT:** In case the terraform infrastructure results in a bad state, maybe due to a crash during the apply,
|
||||||
test, the test infrastructure is deleted. In case of any failure due to which
|
the whole infrastructure can be destroyed by running terraform destroy in terraform/<provider> directory.
|
||||||
the resources don't get deleted, the `make destroy-*` commands can be run for
|
|
||||||
the respective provider. This will run terraform destroy in the respective
|
|
||||||
provider's terraform configuration directory. This can be used to quickly
|
|
||||||
destroy the infrastructure without going through the provision-test-destroy
|
|
||||||
steps.
|
|
||||||
|
|
||||||
### Debugging the tests
|
### Debugging the tests
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ require (
|
|||||||
github.com/fluxcd/test-infra/tftestenv v0.0.0-20240108135005-b58e0c4e0cfa
|
github.com/fluxcd/test-infra/tftestenv v0.0.0-20240108135005-b58e0c4e0cfa
|
||||||
github.com/go-git/go-git/v5 v5.11.0
|
github.com/go-git/go-git/v5 v5.11.0
|
||||||
github.com/google/go-containerregistry v0.19.0
|
github.com/google/go-containerregistry v0.19.0
|
||||||
github.com/hashicorp/terraform-exec v0.18.1
|
|
||||||
github.com/hashicorp/terraform-json v0.16.0
|
github.com/hashicorp/terraform-json v0.16.0
|
||||||
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
|
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
|
||||||
github.com/onsi/gomega v1.31.1
|
github.com/onsi/gomega v1.31.1
|
||||||
@@ -90,6 +89,7 @@ require (
|
|||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
github.com/hashicorp/go-version v1.6.0 // indirect
|
github.com/hashicorp/go-version v1.6.0 // indirect
|
||||||
github.com/hashicorp/hc-install v0.5.0 // indirect
|
github.com/hashicorp/hc-install v0.5.0 // indirect
|
||||||
|
github.com/hashicorp/terraform-exec v0.18.1 // indirect
|
||||||
github.com/imdario/mergo v0.3.16 // indirect
|
github.com/imdario/mergo v0.3.16 // indirect
|
||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform-exec/tfexec"
|
|
||||||
tfjson "github.com/hashicorp/terraform-json"
|
tfjson "github.com/hashicorp/terraform-json"
|
||||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
"k8s.io/client-go/kubernetes/scheme"
|
"k8s.io/client-go/kubernetes/scheme"
|
||||||
@@ -198,20 +197,6 @@ func TestMain(m *testing.M) {
|
|||||||
log.Fatalf("Failed to get provider config for %q", infraOpts.Provider)
|
log.Fatalf("Failed to get provider config for %q", infraOpts.Provider)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run destroy-only mode if enabled.
|
|
||||||
if infraOpts.DestroyOnly {
|
|
||||||
log.Println("Running in destroy-only mode...")
|
|
||||||
envOpts := []tftestenv.EnvironmentOption{
|
|
||||||
tftestenv.WithVerbose(infraOpts.Verbose),
|
|
||||||
// Ignore any state lock in destroy-only mode.
|
|
||||||
tftestenv.WithTfDestroyOptions(tfexec.Lock(false)),
|
|
||||||
}
|
|
||||||
if err := tftestenv.Destroy(ctx, providerCfg.terraformPath, envOpts...); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize with non-zero exit code to indicate failure by default unless
|
// Initialize with non-zero exit code to indicate failure by default unless
|
||||||
// set by a successful test run.
|
// set by a successful test run.
|
||||||
exitCode := 1
|
exitCode := 1
|
||||||
|
|||||||
Reference in New Issue
Block a user