Skip to content

Commit

Permalink
Merge branch 'main' into ali/origin-detection-client
Browse files Browse the repository at this point in the history
  • Loading branch information
AliDatadog committed Feb 19, 2024
2 parents b6afc09 + f67c31f commit 0ce42cb
Show file tree
Hide file tree
Showing 45 changed files with 355 additions and 79 deletions.
10 changes: 7 additions & 3 deletions .github/kind_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: control-plane
labels:
disktype: ssd
- role: worker
labels:
disktype: ssd
38 changes: 38 additions & 0 deletions .github/kubeconform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -euo pipefail

KUBECONFORM_VERSION="v0.6.4"
# https://github.com/yannh/kubeconform/issues/51
CRD_SPEC_URL="https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/v3/apis__apiextensions.k8s.io__v1_openapi.json"
# Remove after v1.16 support / testing is dropped
LEGACY_SCHEMA_URL="https://github.com/instrumenta/kubernetes-json-schema"
OS=$(uname)

CHANGED_CHARTS=${CHANGED_CHARTS:-${1:-}}
if [ -n "$CHANGED_CHARTS" ];
then
CHART_DIRS=$CHANGED_CHARTS
else
CHART_DIRS=$(ls -d charts/*)
fi

# install kubeconform
curl --silent --show-error --fail --location --output /tmp/kubeconform.tar.gz "https://github.com/yannh/kubeconform/releases/download/${KUBECONFORM_VERSION}/kubeconform-${OS}-amd64.tar.gz"
tar -xf /tmp/kubeconform.tar.gz kubeconform

# validate charts
for CHART_DIR in ${CHART_DIRS}; do
echo "Running kubeconform for folder: '$CHART_DIR'"

# Note: -ignore-missing-schemas could be added if needed, but not currently
# needed since we have the schema necessary to validate the CRDs themselves.
#
# Also, if at some point we needed to validate things _using_ these CRDs,
# they're available via
# https://github.com/datreeio/CRDs-catalog/tree/main/datadoghq.com
helm dep up "${CHART_DIR}" && helm template --kube-version "${KUBERNETES_VERSION#v}" \
--values "${CHART_DIR}/ci/kubeconform-values.yaml" "${CHART_DIR}" \
| ./kubeconform -strict -schema-location default -schema-location "$CRD_SPEC_URL" \
-schema-location $LEGACY_SCHEMA_URL -output pretty \
-verbose -kubernetes-version "${KUBERNETES_VERSION#v}" -
done
24 changes: 0 additions & 24 deletions .github/kubeval.sh

This file was deleted.

28 changes: 16 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ jobs:
if [[ -n "$changed" ]]; then
echo -n "Charts changed:"
echo "$changed"
echo "::set-output name=changed::$changed"
echo "changed<<EOF" >> $GITHUB_OUTPUT
echo "$changed" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
else
echo "PR without any chart changes - failing"
exit 1
Expand Down Expand Up @@ -68,7 +70,7 @@ jobs:
- name: Run helm-docs
run: .github/helm-docs.sh

kubeval-chart:
kubeconform-chart:
runs-on: ubuntu-latest
needs:
- changed
Expand All @@ -80,12 +82,12 @@ jobs:
# https://github.com/instrumenta/kubernetes-json-schema is no
# longer updated
k8s:
# - v1.14.10 (deprecated with kind 1.16)
- v1.16.15
- v1.16.4
- v1.18.20
- v1.22.9
- v1.24.2
# v1.25.2 (when agent 7.40 is out)
- v1.22.17
- v1.24.17
- v1.25.16
- v1.26.13
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -95,26 +97,27 @@ jobs:
run: helm repo add datadog https://helm.datadoghq.com && helm repo update
- name: Add KSM helm repo
run: helm repo add kube-state-metrics https://prometheus-community.github.io/helm-charts
- name: Run kubeval
- name: Run kubeconform
env:
KUBERNETES_VERSION: ${{ matrix.k8s }}
CHANGED_CHARTS: ${{needs.changed.outputs.charts}}
run: .github/kubeval.sh
run: .github/kubeconform.sh

install-chart:
name: install-chart
runs-on: ubuntu-20.04
timeout-minutes: 60
needs:
- lint-chart
- kubeval-chart
- kubeconform-chart
strategy:
matrix:
k8s:
- v1.16.15
- v1.18.20
- v1.22.9
- v1.24.2
- v1.25.2
- v1.25.16
- v1.26.13
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -124,6 +127,7 @@ jobs:
uses: helm/kind-action@v1.5.0
with:
node_image: kindest/node:${{ matrix.k8s }}
config: .github/kind_config.yaml
- uses: actions/setup-python@v4
with:
python-version: 3.7
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
charts/*/charts
helm-docs
kubeval
kubeconform
.idea
vendor/
.vscode
Expand Down
6 changes: 6 additions & 0 deletions charts/datadog-crds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.4.0
* Update CRDs from Datadog Operator v1.4.0 tag.

## 1.3.1
* Migrate from `kubeval` to `kubeconform` for ci chart validation.

## 1.3.0
* Update CRDs from Datadog Operator v1.3.0 tag.

Expand Down
2 changes: 1 addition & 1 deletion charts/datadog-crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: datadog-crds
description: Datadog Kubernetes CRDs chart
version: 1.3.0
version: 1.4.0
appVersion: "1"
keywords:
- monitoring
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog-crds/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog CRDs

![Version: 1.3.0](https://img.shields.io/badge/Version-1.3.0-informational?style=flat-square) ![AppVersion: 1](https://img.shields.io/badge/AppVersion-1-informational?style=flat-square)
![Version: 1.4.0](https://img.shields.io/badge/Version-1.4.0-informational?style=flat-square) ![AppVersion: 1](https://img.shields.io/badge/AppVersion-1-informational?style=flat-square)

This chart was designed to allow other "datadog" charts to share `CustomResourceDefinitions` such as the `DatadogMetric`.

Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions charts/datadog-crds/templates/datadoghq.com_datadogagents_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6351,6 +6351,8 @@ spec:
type: object
clusterName:
type: string
containerStrategy:
type: string
credentials:
properties:
apiKey:
Expand Down Expand Up @@ -6378,6 +6380,8 @@ spec:
type: object
criSocketPath:
type: string
disableNonResourceRules:
type: boolean
dockerSocketPath:
type: string
endpoint:
Expand Down Expand Up @@ -8277,6 +8281,44 @@ spec:
- ready
- upToDate
type: object
agentList:
items:
properties:
available:
format: int32
type: integer
current:
format: int32
type: integer
currentHash:
type: string
daemonsetName:
type: string
desired:
format: int32
type: integer
lastUpdate:
format: date-time
type: string
ready:
format: int32
type: integer
state:
type: string
status:
type: string
upToDate:
format: int32
type: integer
required:
- available
- current
- desired
- ready
- upToDate
type: object
type: array
x-kubernetes-list-type: atomic
clusterAgent:
properties:
availableReplicas:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6340,6 +6340,8 @@ spec:
type: object
clusterName:
type: string
containerStrategy:
type: string
credentials:
properties:
apiKey:
Expand Down Expand Up @@ -6367,6 +6369,8 @@ spec:
type: object
criSocketPath:
type: string
disableNonResourceRules:
type: boolean
dockerSocketPath:
type: string
endpoint:
Expand Down Expand Up @@ -8266,6 +8270,44 @@ spec:
- ready
- upToDate
type: object
agentList:
items:
properties:
available:
format: int32
type: integer
current:
format: int32
type: integer
currentHash:
type: string
daemonsetName:
type: string
desired:
format: int32
type: integer
lastUpdate:
format: date-time
type: string
ready:
format: int32
type: integer
state:
type: string
status:
type: string
upToDate:
format: int32
type: integer
required:
- available
- current
- desired
- ready
- upToDate
type: object
type: array
x-kubernetes-list-type: atomic
clusterAgent:
properties:
availableReplicas:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ spec:
description: The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for metric alerts, and 24 hours is used for service checks.
format: int64
type: integer
notificationPresetName:
description: An enum that toggles the display of additional content sent in the monitor notification.
type: string
notifyAudit:
description: A Boolean indicating whether tagged users are notified on changes to this monitor.
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ spec:
description: The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for metric alerts, and 24 hours is used for service checks.
format: int64
type: integer
notificationPresetName:
description: An enum that toggles the display of additional content sent in the monitor notification.
type: string
notifyAudit:
description: A Boolean indicating whether tagged users are notified on changes to this monitor.
type: boolean
Expand Down
8 changes: 8 additions & 0 deletions charts/datadog-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.5.0

* Update Datadog Operator version to 1.4.0.

## 1.4.2

* Migrate from `kubeval` to `kubeconform` for ci chart validation.

## 1.4.1

* Add configuration for Operator flag `datadogSLOEnabled` : this parameter is used to enable the Datadog SLO Controller. It is disabled by default.
Expand Down
6 changes: 3 additions & 3 deletions charts/datadog-operator/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: datadog-crds
repository: https://helm.datadoghq.com
version: 1.3.0
digest: sha256:c0d897e7b5648db215c1c051fed5a3d431fadb1d92784ed0eb5b0f0f6574821e
generated: "2023-12-11T14:56:49.631017-05:00"
version: 1.4.0
digest: sha256:051b894b6d03a9a78919a1549b891592cb1aa82e59386c237b93241bdba7054c
generated: "2024-02-15T15:04:10.736131-05:00"
6 changes: 3 additions & 3 deletions charts/datadog-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: datadog-operator
version: 1.4.1
appVersion: 1.3.0
version: 1.5.0
appVersion: 1.4.0
description: Datadog Operator
keywords:
- monitoring
Expand All @@ -17,7 +17,7 @@ maintainers:
email: support@datadoghq.com
dependencies:
- name: datadog-crds
version: "=1.3.0"
version: "=1.4.0"
alias: datadogCRDs
repository: https://helm.datadoghq.com
condition: installCRDs
Expand Down
Loading

0 comments on commit 0ce42cb

Please sign in to comment.