pulp / pulp/pulp-operator

custom_pulp_settings config map requires double quotation

Open
#1,511 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue Triage-Needed
Dominant language
Go
Stars
88
Forks
66
Avg merge
53m
Merged PRs (30d)
1

Description

Version
Pulp Operator 1.0.1

Describe the bug
When using custom_pulp_settings on the Operator, that requires quoting. Otherwise python processes complain about syntax errors.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
  name: pulp-custom-config
  namespace: pulp-operator
data:
  CONTENT_ORIGIN: "https://repo.home-organization.com/"
  1. Add pulp_custom_config: pulp-custom-config to the Pulp CRD.

Expected behavior
The new content origin is accepted and properly quoted inserted into the secret at settings.py.

Actual behavior
I get a Syntax error, as this is rendered as

CONTENT_ORIGIN = https://repo.home-organization.com/

within the settings.py

Additional context
This can be worked around using double quotation on the yaml file:

apiVersion: v1
kind: ConfigMap
metadata:
  name: pulp-custom-config
  namespace: pulp-operator
data:
  CONTENT_ORIGIN: '"https://repo.home-organization.com/"'

But that wouldn't be something that I would expect. Additionally I'm a bit puzzled why this was not catched in testing, as it looks to me like you would directly stumble upon this issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown ConfigMap and the Pulp CRD setting, then trace how the operator renders custom configuration into settings.py. Check the generated settings.py for the unquoted CONTENT_ORIGIN value. Done means a normal YAML URL is accepted without nested quotation and the rendered Python remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, python
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.