ansible/awx

Hostnames in dev environment fail validator, makes no-op PATCH error

Open

#13.292 aperta il 6 dic 2022

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Python (3333 fork)batch import
component:apihelp wanted

Metriche repository

Star
 (13.071 star)
Metriche merge PR
 (Merge medio 24g 6h) (30 PR mergiate in 30 g)

Descrizione

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
SUMMARY

A new Instance hostname validator fails with the basic docker development environment.

Also, we seem to validate the field even when it's not changing, which makes it hard to do other things in the API.

ENVIRONMENT
  • AWX install method: developer environment
STEPS TO REPRODUCE

Start the docker-compose development environment with 1 hybrid instance.

PATCH with default data

https://localhost:8043/api/v2/instances/1/

EXPECTED RESULTS

A 200 response code.

ACTUAL RESULTS

A 400 response code with

{
    "hostname": [
        "illegal characters detected in hostname=awx_1. Please verify."
    ]
}
ADDITIONAL INFORMATION

It seems questionable that we allow registration with a hostname that would fail validation?

Provided that we don't want to fix that, then we must assume that we have invalid hostnames in all cases, and it would be nice to only validate when it is changing.

Guida contributor