Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE: {{ .Now }} #432

Open
PinoOG opened this issue Nov 20, 2024 · 5 comments
Open

ISSUE: {{ .Now }} #432

PinoOG opened this issue Nov 20, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@PinoOG
Copy link

PinoOG commented Nov 20, 2024

Hello, I have a problem with .Now variable, it seems like its called once both for send-before and send-after giving so a non correct time output for send-after http hook.

@PinoOG
Copy link
Author

PinoOG commented Nov 20, 2024

Same applies to run commands, variables are all parsed when execution of the backup starts, reporting not update values for {{ .Now }} in this case

@creativeprojects
Copy link
Owner

Anything inside a double curly bracket (go template) is generated just once, before reading the configuration. So it's actually the normal behaviour.

I do understand your use case though: I could regenerate a full configuration file on each command, but I'm not entirely sure that wouldn't break any existing configuration. I need to verify that first 🤔

@creativeprojects creativeprojects added the enhancement New feature or request label Nov 21, 2024
@PinoOG
Copy link
Author

PinoOG commented Nov 21, 2024

Anything inside a double curly bracket (go template) is generated just once, before reading the configuration. So it's actually the normal behaviour.

I do understand your use case though: I could regenerate a full configuration file on each command, but I'm not entirely sure that wouldn't break any existing configuration. I need to verify that first 🤔

Thank you for replying, maybe this can be done using an option inside a profile?
so only users putting in that profile this option will turn on the feature you said.

@creativeprojects
Copy link
Owner

That would be one way of doing it safely, for sure.

This templating system is still confusing though and I'm thinking we should probably populate an environment variable before each step instead.

So we would use $NOW instead of {{ .Now }}

@PinoOG
Copy link
Author

PinoOG commented Nov 21, 2024

Yeah, it's not a bad idea. Unfortunately, I'm not an expert in Go. I wish I could have been more useful in this situation.

@creativeprojects creativeprojects self-assigned this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants