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

Support filebase64 function with Noamd #11522

Closed
MatthiasZerau opened this issue Nov 17, 2021 · 2 comments · Fixed by #11791
Closed

Support filebase64 function with Noamd #11522

MatthiasZerau opened this issue Nov 17, 2021 · 2 comments · Fixed by #11791
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/hcl type/enhancement
Milestone

Comments

@MatthiasZerau
Copy link

Proposal

Please support filebase64 function like it is available for Terraform.

Use-cases

As part of a job specification, I want to provide the content of a file as base64 encoded value via the env stanza.

Attempted Solutions

I've tried the following:

...
task "myTask" {
  ...
  env {
    DATA_BASE64 = base64encode(file(var.data_file))
  }
}

As the file is not UTF-8 encoded it fails with following error:

Error getting job struct: Error parsing job file from exampletask.nomad:
exampletask.nomad:122,56-61: Error in function call; Call to function "file" failed: contents of D:\a\path\to\file.dat are not valid UTF-8; use the filebase64 function to obtain the Base64 encoded contents or the other file functions (e.g. filemd5, filesha256) to obtain file hashing results instead.

(with Nomad 1.1.0)

@lgfa29 lgfa29 added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/hcl labels Nov 25, 2021
@lgfa29 lgfa29 added this to Needs Triage in Nomad - Community Issues Triage via automation Nov 25, 2021
@lgfa29
Copy link
Contributor

lgfa29 commented Nov 25, 2021

Thank you @MatthiasZerau. I think this function does sound useful in some scenarions. I've set this idea for further triaging.

I'm adding the Terraform docs here for reference:
https://www.terraform.io/docs/language/functions/filebase64.html

@tgross tgross moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Dec 6, 2021
@tgross tgross added this to the 1.3.2 milestone Jun 6, 2022
@tgross tgross moved this from Needs Roadmapping to In Progress in Nomad - Community Issues Triage Jun 6, 2022
Nomad - Community Issues Triage automation moved this from In Progress to Done Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Oct 7, 2022

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/hcl type/enhancement
Projects
Development

Successfully merging a pull request may close this issue.

3 participants