Skip to content

Commit

Permalink
Release logzio-agent-manifest v1.1.36 (#186)
Browse files Browse the repository at this point in the history
* Fix duplicate LogzioRegion Helm set & fix release workflow permissions

- Fix for duplicated `logzio-k8s-telemetry.secrets.LogzioRegion` Helm set flag
- Fix release workflow permissions

* Revert helm template changes

- Duplicate fixes will be done on app end as JSONPath lib doesn't support logical operators
  • Loading branch information
ralongit authored Jul 23, 2024
1 parent c7b52a1 commit 5bb0465
Show file tree
Hide file tree
Showing 16 changed files with 99 additions and 29 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ jobs:
update_version:
name: Update Version
runs-on: macos-latest
permissions:
contents: write # Allows pushing changes to the repository
issues: write # Allows creating issues
packages: write # Allows accessing and publishing packages
pull-requests: write # Allows creating and managing pull requests
actions: write # Allows updating GitHub Action workflows
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Increase Version
run: |
version=$(cat ./version | grep -o -e '[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}')
Expand Down Expand Up @@ -61,9 +67,16 @@ jobs:
name: Create Release
runs-on: ubuntu-latest
needs: update_version
permissions:
contents: write # Allows pushing changes to the repository
issues: write # Allows creating issues
packages: write # Allows accessing and publishing packages
pull-requests: write # Allows creating and managing pull requests
actions: write # Allows updating GitHub Action workflows
attestations: write # Allows adding and updating artifact attestations
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Update version file
run: |
echo "${{ needs.update_version.outputs.VERSION }}" >./version
Expand Down
25 changes: 12 additions & 13 deletions config-templates/helm.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[
{ "template": "helm install -n monitoring --create-namespace \\" },
{
"template": "helm install -n monitoring --create-namespace \\"
},
{
"template": " --set logs.enabled=true \\",
"targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='LOG_ANALYTICS')]",
Expand Down Expand Up @@ -56,20 +58,17 @@
{
"template": " --set logzio-k8s-telemetry.enableMetricsFilter.eks=true \\",
"condition": "$[?(@ == 'EKS')]",
"targetElement":
"datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isFilter')].value"
"targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isFilter')].value"
},
{
"template": " --set logzio-k8s-telemetry.enableMetricsFilter.aks=true \\",
"condition": "$[?(@ == 'AKS' || @ == 'DigitalOcean')]",
"targetElement":
"datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isFilter')].value"
"targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isFilter')].value"
},
{
"template": " --set logzio-k8s-telemetry.enableMetricsFilter.gke=true \\",
"condition": "$[?(@ == 'GKE')]",
"targetElement":
"datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isFilter')].value"
"targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isFilter')].value"
},
{
"template": " --set logzio-k8s-telemetry.collector.mode=standalone \\",
Expand All @@ -78,13 +77,11 @@
},
{
"template": " --set logzio-k8s-telemetry.k8sObjectsConfig.enabled=true \\",
"targetElement":
"datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isObjectLogs')].value"
"targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isObjectLogs')].value"
},
{
"template": " --set logzio-k8s-telemetry.secrets.k8sObjectsLogsToken='<<LOGZIO_LOGS_SHIPPING_TOKEN>>' \\",
"targetElement":
"datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isObjectLogs')].value"
"targetElement": "datasources[?(@.name=='Kubernetes')].telemetries[?(@.type=='METRICS')].params[?(@.name=='isObjectLogs')].value"
},
{
"template": " --set logzio-k8s-telemetry.secrets.LogzioRegion='<<LOGZIO_ACCOUNT_REGION_CODE>>' \\"
Expand Down Expand Up @@ -154,5 +151,7 @@
}
]
},
{ "template": "logzio-monitoring logzio-helm/logzio-monitoring" }
]
{
"template": "logzio-monitoring logzio-helm/logzio-monitoring"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ function Build-LogzioRegionHelmSet {
$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Write-Log $script:LogLevelDebug $Message
Expand Down Expand Up @@ -230,4 +235,4 @@ function Build-LogzioSpmTokenHelmSet {

Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'"
Write-TaskPostRun "`$script:HelmSets += '$HelmSet'"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ function Build-EnableObjectLogsHelmSet {
Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'"
Write-TaskPostRun "`$script:HelmSets += '$HelmSet'"
}

# Builds Logz.io region Helm set
# Input:
# FuncArgs - Hashtable {ListenerUrl = $script:ListenerUrl}
Expand All @@ -365,6 +364,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down Expand Up @@ -230,4 +235,4 @@ function Build-LogzioSpmTokenHelmSet {

Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'"
Write-TaskPostRun "`$script:HelmSets += '$HelmSet'"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down Expand Up @@ -230,4 +235,4 @@ function Build-LogzioSpmTokenHelmSet {

Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'"
Write-TaskPostRun "`$script:HelmSets += '$HelmSet'"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ function Build-LogzioRegionHelmSet {

$local:ExitCode = 3
$local:FuncName = $MyInvocation.MyCommand.Name

# Check if LogzioRegion already exists in HelmSets
if ($script:LogHelmSets -match "logzio-k8s-telemetry\.secrets\.LogzioRegion=[^ ]+") {
return
}

$local:Message = 'Building Logz.io region Helm set ...'
Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource
Expand Down Expand Up @@ -230,4 +235,4 @@ function Build-LogzioSpmTokenHelmSet {

Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'"
Write-TaskPostRun "`$script:HelmSets += '$HelmSet'"
}
}
4 changes: 2 additions & 2 deletions resources-linux/k8s/datasource_logs_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function build_logzio_logs_region_helm_set {
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_log "$LOG_LEVEL_DEBUG" "$message"

local helm_set=" --set logzio-logs-collector.secrets.LogzioRegion=$region"
local helm_set=" --set logzio-logs-collector.secrets.logzioRegion=$region"

message="Logz.io region Helm set is '$helm_set'"
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
Expand Down Expand Up @@ -322,4 +322,4 @@ function build_deploy_events_environment_id_helm_set {

write_task_post_run "LOG_HELM_SETS+='$helm_set'"
write_task_post_run "HELM_SETS+='$helm_set'"
}
}
6 changes: 5 additions & 1 deletion resources-linux/k8s/datasource_metrics_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ function build_enable_object_logs_helm_set {
function build_logzio_region_helm_set {
local func_name="${FUNCNAME[0]}"

# Check if LogzioRegion already exists in HelmSets
if [[ "$LOG_HELM_SETS" =~ logzio-k8s-telemetry.secrets.LogzioRegion ]]; then
return
fi

local message='Building Logz.io region Helm set ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_log "$LOG_LEVEL_DEBUG" "$message"
Expand Down Expand Up @@ -241,4 +246,3 @@ function build_logzio_object_logs_token_helm_set {
write_task_post_run "LOG_HELM_SETS+='$helm_set'"
write_task_post_run "HELM_SETS+='$helm_set'"
}

7 changes: 6 additions & 1 deletion resources-linux/k8s/datasource_traces_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ function build_logzio_traces_token_helm_set {
# HELM_SETS - Contains all the Helm sets
function build_logzio_region_helm_set {
local func_name="${FUNCNAME[0]}"

# Check if LogzioRegion already exists in HelmSets
if [[ "$LOG_HELM_SETS" =~ logzio-k8s-telemetry.secrets.LogzioRegion ]]; then
return
fi

local message='Building Logz.io region Helm set ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
Expand Down Expand Up @@ -123,4 +128,4 @@ function build_logzio_spm_token_helm_set {

write_task_post_run "LOG_HELM_SETS+='$helm_set'"
write_task_post_run "HELM_SETS+='$helm_set'"
}
}
4 changes: 2 additions & 2 deletions resources-mac/k8s/datasource_logs_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function build_logzio_logs_region_helm_set {
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_log "$LOG_LEVEL_DEBUG" "$message"

local helm_set=" --set logzio-logs-collector.secrets.LogzioRegion=$region"
local helm_set=" --set logzio-logs-collector.secrets.logzioRegion=$region"

message="Logz.io region Helm set is '$helm_set'"
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
Expand Down Expand Up @@ -322,4 +322,4 @@ function build_deploy_events_environment_id_helm_set {

write_task_post_run "LOG_HELM_SETS+='$helm_set'"
write_task_post_run "HELM_SETS+='$helm_set'"
}
}
7 changes: 6 additions & 1 deletion resources-mac/k8s/datasource_metrics_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ function build_enable_object_logs_helm_set {
# HELM_SETS - Contains all the Helm sets
function build_logzio_region_helm_set {
local func_name="${FUNCNAME[0]}"

# Check if LogzioRegion already exists in HelmSets
if [[ "$LOG_HELM_SETS" =~ logzio-k8s-telemetry.secrets.LogzioRegion ]]; then
return
fi

local message='Building Logz.io region Helm set ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
Expand Down Expand Up @@ -240,4 +245,4 @@ function build_logzio_object_logs_token_helm_set {

write_task_post_run "LOG_HELM_SETS+='$helm_set'"
write_task_post_run "HELM_SETS+='$helm_set'"
}
}
7 changes: 6 additions & 1 deletion resources-mac/k8s/datasource_traces_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ function build_logzio_traces_token_helm_set {
function build_logzio_region_helm_set {
local func_name="${FUNCNAME[0]}"

# Check if LogzioRegion already exists in HelmSets
if [[ "$LOG_HELM_SETS" =~ logzio-k8s-telemetry.secrets.LogzioRegion ]]; then
return
fi

local message='Building Logz.io region Helm set ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_log "$LOG_LEVEL_DEBUG" "$message"
Expand Down Expand Up @@ -123,4 +128,4 @@ function build_logzio_spm_token_helm_set {

write_task_post_run "LOG_HELM_SETS+='$helm_set'"
write_task_post_run "HELM_SETS+='$helm_set'"
}
}

0 comments on commit 5bb0465

Please sign in to comment.