-
Notifications
You must be signed in to change notification settings - Fork 373
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
could not login to OCI registry (ecr) #844
Comments
I think this is actually caused by Edit: Reverting to 2.4.1 works without modifying state data "aws_ecr_authorization_token" "token" {}
resource "null_resource" "helm_login" {
triggers = {
always_run = timestamp()
}
provisioner "local-exec" {
command = <<-EOT
HELM_EXPERIMENTAL_OCI=1 \
helm registry login \
--username "${data.aws_ecr_authorization_token.token.user_name}" \
--password "${data.aws_ecr_authorization_token.token.password}" \
${data.aws_ecr_authorization_token.token.proxy_endpoint}
EOT
}
} |
I'm noticing the same thing from my CI server. Reverting the provider back to 2.4.1 and the CLI to 3.7.1 fixed things again but I had to also revert the code to my solution described here using a null resource. |
@ashtonian have you tried time_rotating resource to force re-read of the token data source? |
@junaid-ali maybe I'm missing something but how would you hook that up to the ecr_authorization_token data source? |
further investigating - the state file has the correct key in hex format which is what matches |
@rpf3 I thought the data source isn't refreshing so was wondering if a time_rotating resource could help there. It's definitely not needed in this case: https://www.terraform.io/language/data-sources#data-resource-behavior I checked the debug log for
That could be causing the issue for helm_release to not use the updated datasource values. |
The issue seems to be that during the refresh stage, Terraform only has access to the values present in the state file. However, logging in during the refresh is actually unnecessary, as the chart is never pulled. I submitted a PR at #846 that fixes this issue by dropping the login during refresh. During the create & update it will always use the latest configured credentials. I tested it successfully locally using Amazon ECR as described in the original post. |
@mKeRix for the terraform helm diff to work, wouldn't the login be necessary? |
The refresh doesn't look at the chart from what I saw - just the resource diff function, which seems to be run with the updated credentials though. I pinged the original author of the code in the PR to make sure I didn't overlook something. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform, Provider, Kubernetes and Helm Versions
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
terraform apply
Expected Behavior
Helm provider should be able to login to ecr.
Actual Behavior
It was working yesterday after the new release, but now seems to not be working. Maybe its not refreshing the creds properly as ecr credentials require being constantly refreshed?
Community Note
The text was updated successfully, but these errors were encountered: