Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: tasks_post_script does not work correctly #214

Closed
AlexGacon opened this issue Sep 27, 2024 · 2 comments
Closed

Bug: tasks_post_script does not work correctly #214

AlexGacon opened this issue Sep 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@AlexGacon
Copy link
Collaborator

Bug Description

When defining the following task_post_script code in the values file of our deployment, we have an error message 'Error: YAML parse error on geonode-k8s/templates/geonode/geonode-tasks-py-conf.yaml: error converting YAML to JSON: yaml: line 438: could not find expected ':''.

  tasks_post_script: |
    ctx.run("rm -rf /tmp/egis_oauth.json", pty=True)
    print("Generate OAuth configuration ...")
    oauth_client_id = os.environ["C2C_OAUTH_CLIENT_ID"]
    oauth_secret = os.environ["C2C_OAUTH_SECRET"]
    default_fixture = [
        {
              "model":"socialaccount.socialapp",
              "pk":12,
              "fields":{
                  "id":"12",
                  "provider":"microsoft",
                  "name":"C2C Authentification",
                  "client_id":oauth_client_id,
                  "secret":oauth_secret
              }
        },
        {
              "model":"socialaccount.socialapp_sites",
              "pk":12,
              "fields":{
                  "id":1,
                  "socialapp_id":1,
                  "site_id":1
              }
        }
    ]
    with open("/tmp/egis_oauth.json", "w") as fixturefile:
        json.dump(default_fixture, fixturefile)
    ctx.run(
        f"python manage.py loaddata /tmp/egis_oauth.json \
          --settings={_localsettings()}",
        pty=True,
    )

Reproduction Steps

Run a helm template with a values.yaml containing the above code.

Behavior

No error should be raised.

Additional Information

Any additional information or context that may be helpful in resolving the bug.

@AlexGacon AlexGacon added the bug Something isn't working label Sep 27, 2024
@AlexGacon AlexGacon self-assigned this Sep 27, 2024
@AlexGacon
Copy link
Collaborator Author

We already have a bugfix on our fork, I will create a PR soon.

@mwallschlaeger
Copy link
Contributor

close with PR #215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants