Skip to content

Commit 01b4db3

Browse files
committed
Adding environment field for AROClusterLogs
1 parent b0eb120 commit 01b4db3

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

pkg/deploy/assets/gateway-production.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/deploy/assets/rp-production.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pkg/deploy/generator/scripts/gatewayVMSS.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ main() {
9292
[FILTER]
9393
Name modify
9494
Match journald
95-
Remove_wildcard _
96-
Remove TIMESTAMP
95+
Add ENVIRONMENT \${ENVIRONMENT}
9796
9897
[FILTER]
9998
Name modify
10099
Match journald
101-
Add ENVIRONMENT \${ENVIRONMENT}
100+
Remove_wildcard _
101+
Remove TIMESTAMP
102102
103103
[OUTPUT]
104104
Name forward

pkg/deploy/generator/scripts/rpVMSS.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ main() {
109109
[FILTER]
110110
Name modify
111111
Match journald
112-
Remove_wildcard _
113-
Remove TIMESTAMP
112+
Add ENVIRONMENT \${ENVIRONMENT}
114113
115114
[FILTER]
116115
Name modify
117116
Match journald
118-
Add ENVIRONMENT \${ENVIRONMENT}
117+
Remove_wildcard _
118+
Remove TIMESTAMP
119119
120120
[FILTER]
121121
Name rewrite_tag

pkg/operator/controllers/genevalogging/genevalogging.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ func (r *Reconciler) daemonset(cluster *arov1alpha1.Cluster) (*appsv1.DaemonSet,
232232
Name: "MONITORING_USE_GENEVA_CONFIG_SERVICE",
233233
Value: "true",
234234
},
235+
{
236+
Name: "MONITORING_ENVIRONMENT",
237+
Value: cluster.Spec.OperatorFlags.GetWithDefault("aro.environment", ""),
238+
},
235239
{
236240
Name: "MONITORING_TENANT",
237241
Value: cluster.Spec.Location,

pkg/operator/deploy/deploy.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ func (o *operator) clusterObject() (*arov1alpha1.Cluster, error) {
366366
},
367367
}
368368

369+
// Set aro.environment operator flag for MONITORING_ENVIRONMENT in cluster logs
370+
if cluster.Spec.OperatorFlags == nil {
371+
cluster.Spec.OperatorFlags = arov1alpha1.OperatorFlags{}
372+
}
373+
if _, exists := cluster.Spec.OperatorFlags["aro.environment"]; !exists {
374+
cluster.Spec.OperatorFlags["aro.environment"] = o.env.EnvironmentType()
375+
}
376+
369377
if o.oc.Properties.FeatureProfile.GatewayEnabled && o.oc.Properties.NetworkProfile.GatewayPrivateEndpointIP != "" {
370378
cluster.Spec.GatewayDomains = append(o.env.GatewayDomains(), o.oc.Properties.ImageRegistryStorageAccountName+".blob."+o.env.Environment().StorageEndpointSuffix)
371379
} else {

0 commit comments

Comments
 (0)