Skip to content

Commit aa0c41f

Browse files
Md. Emruz Hossaintamalsaha
authored andcommitted
Add PusgatewayURL input for Functions (#816)
1 parent 0a45b44 commit aa0c41f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

apis/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ const (
4747
IONiceClassData = "IONICE_CLASS_DATA"
4848

4949
StatusSubresourceEnabled = "ENABLE_STATUS_SUBRESOURCE"
50+
51+
PushgatewayURL = "PUSH_GATEWAY_URL"
5052
)

pkg/controller/inputs.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ func (c *StashController) inputsForBackupConfig(backupConfig api.BackupConfigura
2727
// always enable cache if nothing specified
2828
inputs[apis.EnableCache] = strconv.FormatBool(!backupConfig.Spec.TempDir.DisableCaching)
2929

30+
// add PushgatewayURL as input
31+
metricInputs := c.inputForMetrics()
32+
inputs = core_util.UpsertMap(inputs, metricInputs)
33+
3034
return inputs, nil
3135
}
3236

@@ -48,6 +52,10 @@ func (c *StashController) inputsForRestoreSession(restoreSession api.RestoreSess
4852
// always enable cache if nothing specified
4953
inputs[apis.EnableCache] = strconv.FormatBool(!restoreSession.Spec.TempDir.DisableCaching)
5054

55+
// add PushgatewayURL as input
56+
metricInputs := c.inputForMetrics()
57+
inputs = core_util.UpsertMap(inputs, metricInputs)
58+
5159
return inputs, nil
5260
}
5361

@@ -139,3 +147,9 @@ func (c *StashController) inputsForRetentionPolicy(retentionPolicy apiAlpha.Rete
139147
}
140148
return inputs
141149
}
150+
151+
func (c *StashController) inputForMetrics() map[string]string {
152+
return map[string]string{
153+
apis.PushgatewayURL: util.PushgatewayURL(),
154+
}
155+
}

0 commit comments

Comments
 (0)