DomainID or DomainName validation is inconsistent

Aperta
#63 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
cloud

Direzione di ricerca

Riproduci il comportamento di validazione con il test.pkr.hcl fornito usando packer validate, confrontando i casi domain_id, domain_name, token e OS_DOMAIN_ID. Traccia il punto di ingresso della validazione che produce i due errori in conflitto e aggiungi o aggiorna la copertura per queste configurazioni. Il lavoro è completato quando configurazioni equivalenti ricevono risultati di validazione coerenti e corretti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
29
Fork
27
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hashicorp/packer-plugin-openstack

Tutte le issue di hashicorp/packer-plugin-openstack

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.