Skip to content

Commit

Permalink
Merge branch 'main' into golang
Browse files Browse the repository at this point in the history
  • Loading branch information
k15r authored Dec 13, 2024
2 parents b81b055 + 6d56272 commit a1613ef
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 52 deletions.
3 changes: 2 additions & 1 deletion .github/template/prepare-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ runs:
run: "./hack/await_image.sh"
env:
GITHUB_TOKEN: "${{ inputs.github-token }}"
TRIGGER: "${{ github.event.pull_request.head.sha }}"
# sets trigger depending on event being either pull_request or merge_group
TRIGGER: "${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}"
QUERY_INTERVAL: 30
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/dev/telemetry-manager"

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/branch-integration.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Branch Integration

on:
merge_group:
branches:
- "release-*"
push:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
Expand Down Expand Up @@ -34,7 +36,9 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/prod/telemetry-manager"
TRIGGER: "${{ github.ref_name }}"
# sets trigger to SHA if used in merge_group, but to ref_name if used in push
# even if ref_name is available in merge_group event, it will be neglected
TRIGGER: "${{ github.event.merge_group.head_sha || github.ref_name }}"
QUERY_INTERVAL: 30

# save gardener kubeconfig to a temp file in order to pass it to the command
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Image

on:
merge_group:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
branches:
Expand Down Expand Up @@ -38,6 +39,8 @@ jobs:
run: |
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
echo 'TAGS=${{ github.ref_name }}' >> "$GITHUB_OUTPUT"
elif [[ $GITHUB_EVENT_NAME == 'merge_group' ]]; then
echo 'TAGS=${{ github.event.merge_group.head_sha }}' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-all-checks-passed.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: All Checks passed
on:
merge_group:
pull_request:
types:
[
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-code-checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: PR Code Checks

on:
merge_group:
pull_request:
branches:
- "main"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr-integration.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: PR Integration

env:
IMG: europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:PR-${{ github.event.number }}
# add the tag PR-<number> to the image if it is a PR, if the trigger is merge_group, then add the sha as the tag
IMG: europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:${{ github.event_name == 'pull_request' && 'PR-' || '' }}${{ github.event.number || github.event.merge_group.head_sha }}

on:
merge_group:
pull_request:
branches:
- "main"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pr-lifecycle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: PR Lifecycle

on:
merge_group:
pull_request:
branches:
- "main"
Expand Down Expand Up @@ -61,14 +62,17 @@ jobs:
run: "./hack/await_image.sh"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
TRIGGER: "${{ github.event.pull_request.head.sha }}"
# sets trigger depending on event being either pull_request or merge_group
TRIGGER: "${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}"
QUERY_INTERVAL: 30
IMAGE_REPO: "europe-docker.pkg.dev/kyma-project/dev/telemetry-manager"

- name: Deploy with current version
shell: bash
run: |
IMG=europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:PR-${{ github.event.number }} make deploy-dev
# add the tag PR-<number> to the image if it is a PR, if the trigger is merge_group, then add the sha as the tag
TAG="${{ github.event_name == 'pull_request' && 'PR-' || '' }}${{ github.event.number || github.event.merge_group.head_sha }}"
IMG=europe-docker.pkg.dev/kyma-project/dev/telemetry-manager:${TAG} make deploy-dev
- name: Wait for manager readiness
shell: bash
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ manifests: $(CONTROLLER_GEN) $(YQ) $(YAMLFMT) ## Generate WebhookConfiguration,
$(YQ) eval 'del(.. | select(has("x-kubernetes-validations"))."x-kubernetes-validations"[] | select(.rule|contains("otlp")) )' -i ./config/crd/bases/telemetry.kyma-project.io_logpipelines.yaml
## Remove empty x-kubernetes-validations arrays from logpipeline crd that can be caused by previous yq manipulations
$(YQ) eval 'del(.. | select(select(has("x-kubernetes-validations"))."x-kubernetes-validations" | length == 0)."x-kubernetes-validations")' -i ./config/crd/bases/telemetry.kyma-project.io_logpipelines.yaml
$(YQ) eval 'del(.. | select(has("log")).log)' -i ./config/crd/bases/operator.kyma-project.io_telemetries.yaml
$(YAMLFMT)

.PHONY: manifests-dev
Expand Down
27 changes: 0 additions & 27 deletions config/crd/bases/operator.kyma-project.io_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,6 @@ spec:
spec:
description: TelemetrySpec defines the desired state of Telemetry
properties:
log:
description: LogSpec defines the behavior of the log gateway
properties:
gateway:
properties:
scaling:
description: Scaling defines which strategy is used for scaling the gateway, with detailed configuration options for each strategy type.
properties:
static:
description: |-
Static is a scaling strategy enabling you to define a custom amount of replicas to be used for the gateway. Present only if Type =
StaticScalingStrategyType.
properties:
replicas:
description: Replicas defines a static number of Pods to run the gateway. Minimum is 1.
format: int32
minimum: 1
type: integer
type: object
type:
description: Type of scaling strategy. Default is none, using a fixed amount of replicas.
enum:
- Static
type: string
type: object
type: object
type: object
metric:
description: MetricSpec defines the behavior of the metric gateway
properties:
Expand Down
6 changes: 0 additions & 6 deletions docs/user/resources/01-telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ For details, see the [Telemetry specification file](https://github.com/kyma-proj
| Parameter | Type | Description |
| ---- | ----------- | ---- |
| **log** | object | LogSpec defines the behavior of the log gateway |
| **log.&#x200b;gateway** | object | |
| **log.&#x200b;gateway.&#x200b;scaling** | object | Scaling defines which strategy is used for scaling the gateway, with detailed configuration options for each strategy type. |
| **log.&#x200b;gateway.&#x200b;scaling.&#x200b;static** | object | Static is a scaling strategy enabling you to define a custom amount of replicas to be used for the gateway. Present only if Type = StaticScalingStrategyType. |
| **log.&#x200b;gateway.&#x200b;scaling.&#x200b;static.&#x200b;replicas** | integer | Replicas defines a static number of Pods to run the gateway. Minimum is 1. |
| **log.&#x200b;gateway.&#x200b;scaling.&#x200b;type** | string | Type of scaling strategy. Default is none, using a fixed amount of replicas. |
| **metric** | object | MetricSpec defines the behavior of the metric gateway |
| **metric.&#x200b;gateway** | object | |
| **metric.&#x200b;gateway.&#x200b;scaling** | object | Scaling defines which strategy is used for scaling the gateway, with detailed configuration options for each strategy type. |
Expand Down
12 changes: 0 additions & 12 deletions docs/user/resources/02-logpipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,7 @@ The status of the LogPipeline is determined by the condition types `AgentHealthy
| AgentHealthy | False | AgentNotReady | Failed to get DaemonSet |
| AgentHealthy | False | AgentNotReady | Pod is in the pending state because container: `container name` is not running due to: `reason`. Please check the container: `container name` logs. |
| AgentHealthy | False | AgentNotReady | Pod is in the failed state due to: `reason` |
| GatewayHealthy | True | GatewayReady | Log gateway Deployment is ready |
| GatewayHealthy | True | RolloutInProgress | Pods are being started/updated |
| GatewayHealthy | False | GatewayNotReady | No Pods deployed |
| GatewayHealthy | False | GatewayNotReady | Failed to list ReplicaSets: `reason` |
| GatewayHealthy | False | GatewayNotReady | Failed to fetch ReplicaSets: `reason` |
| GatewayHealthy | False | GatewayNotReady | Pod is not scheduled: `reason` |
| GatewayHealthy | False | GatewayNotReady | Pod is in the pending state because container: `container name` is not running due to: `reason`. Please check the container: `container name` logs. |
| GatewayHealthy | False | GatewayNotReady | Pod is in the failed state due to: `reason` |
| GatewayHealthy | False | GatewayNotReady | Deployment is not yet created |
| GatewayHealthy | False | GatewayNotReady | Failed to get Deployment |
| GatewayHealthy | False | GatewayNotReady | Failed to get latest ReplicaSets |
| ConfigurationGenerated | True | AgentConfigured | LogPipeline specification is successfully applied to the configuration of Fluent Bit agent |
| ConfigurationGenerated | True | GatewayConfigured | LogPipeline specification is successfully applied to the configuration of Log gateway |
| ConfigurationGenerated | True | TLSCertificateAboutToExpire | TLS (CA) certificate is about to expire, configured certificate is valid until YYYY-MM-DD |
| ConfigurationGenerated | False | EndpointInvalid | HTTP output host invalid: `reason` |
| ConfigurationGenerated | False | ReferencedSecretMissing | One or more referenced Secrets are missing: Secret 'my-secret' of Namespace 'my-namespace' |
Expand Down
2 changes: 1 addition & 1 deletion hack/await_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ START_TIME=$SECONDS

until $(skopeo list-tags ${PROTOCOL}${IMAGE_REPO} | jq '.Tags|any(. == env.TRIGGER)'); do
if (( SECONDS - START_TIME > TIMEOUT )); then
echo "Timeout reached: ${IMAGE_REPO}:${COMMIT_SHA} not found within $(( TIMEOUT/60 )) minutes"
echo "Timeout reached: ${IMAGE_REPO}:${TRIGGER} not found within $(( TIMEOUT/60 )) minutes"
exit 1
fi
echo "Waiting for binary image: ${IMAGE_REPO}:${TRIGGER}"
Expand Down

0 comments on commit a1613ef

Please sign in to comment.