DomainID or DomainName validation is inconsistent

Đang mở
#63 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
cloud

Hướng nghiên cứu

Tái hiện hành vi xác thực bằng test.pkr.hcl được cung cấp với packer validate, so sánh các trường hợp domain_id, domain_name, token và OS_DOMAIN_ID. Truy vết điểm vào của quá trình xác thực tạo ra hai lỗi xung đột, đồng thời thêm hoặc cập nhật coverage cho các cấu hình này. Công việc hoàn tất khi các cấu hình tương đương nhận được kết quả xác thực nhất quán và chính xác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Overview of the Issue

Using hashicorp/packer container with a HCL file that contains token:

  • Setting domain_id (without domain_name) ask to remove it because is not required while using token
  • If neither domain_name or domain_id is used then error asking for one of them
  • If neither domain_name or domain_id is used but OS_DOMAIN_ID env var exported then is OK
Reproduction Steps
packer validate test.pkr.hcl

If domain_id = "default" + token = '...' then:

packer validate vault-raft.pkr.hcl
Error: 1 error(s) occurred:
* DomainID may not be provided when authenticating with a TokenID
  on vault-raft.pkr.hcl line 1:
  (source code not available)

If #domain_id = "default" = token = '...' then:

Error: 1 error(s) occurred:
* You must provide exactly one of DomainID or DomainName in a Scope with ProjectName
  on vault-raft.pkr.hcl line 1:
  (source code not available)

If #domain_id = "default" = token = '...' + export OS_DOMAIN_ID=default then:

The configuration is valid.
Plugin and Packer version
packer version
Packer v1.8.0
Simplified Packer Buildfile

test.pkr.hcl file:

source "openstack" "hello" {
  #domain_id                 = "default"
  token                     = "TheRealTokenWasHere"
  identity_endpoint         = "https://auth.cloud.ovh.net/v3"
  image_name                = "debian-hello-test"
  source_image_name         = "Debian 11"
  flavor                    = "s1-2"
  tenant_name               = "TheTenantNameWasHere"
  region                    = "GRA7"
  ssh_username              = "debian"
  networks                   = ["TheNetworkIdWasHere"]
}
build {
  sources = ["source.openstack.hello"]
  provisioner "shell" {
      execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
      scripts         = fileset(".", "scripts/{install,secure}.sh")
  }
}
Operating system and Environment details

Docker image hashicorp/packer running in GitlabCI runner ignoring the entrypoint

Also tested in a Debian 11 laptop running the same Packer version.

Ngôn ngữ chính
Go
Star
29
Fork
27
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hashicorp/packer-plugin-openstack

Tất cả issue của hashicorp/packer-plugin-openstack

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.