ansible/awx

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

Open

#13,292 建立於 2022年12月6日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Python (3,333 fork)batch import
component:apihelp wanted

倉庫指標

Star
 (13,071 star)
PR 合併指標
 (平均合併 24天 6小時) (30 天內合併 30 個 PR)

描述

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.

貢獻者指南