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

Optionally allow SKC checkout to persist #41

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

MoteHue
Copy link
Contributor

@MoteHue MoteHue commented Oct 10, 2023

Adds a flag to allow the current copy of kayobe-config to be used, rather than copying in a clean version.

This is useful if you want to use previously-generated Kolla config under kayobe-config/etc/kolla

@MoteHue MoteHue requested a review from a team as a code owner October 10, 2023 15:16
@MoteHue
Copy link
Contributor Author

MoteHue commented Oct 10, 2023

Just for full context on why this is useful, I'm using this as part of a workflow to check octavia cert expiry. This needs the KA config generated so the certs are in the location (kayobe-config/etc/kolla/config/octavia) that KA checks for.

        run: |
          /src/.automation/pipeline/overcloud-service-configuration-generate.sh "/tmp/ignore"
        env:
          HOME: /stack
          KAYOBE_ENVIRONMENT: ${{ needs.env.outputs.environment }}
          KOLLA_TAGS: none

      - name: Check Octavia certificates expiry
        run: |
          /src/.automation/pipeline/kolla-ansible-run.sh "octavia-certificates --check-expiry ${{ github.event.inputs.days }}"
        env:
          HOME: /stack
          KAYOBE_ENVIRONMENT: ${{ needs.env.outputs.environment }}
          KAYOBE_AUTOMATION_ALLOW_UNCLEAN_KAYOBE_CONFIG: true

@MoteHue MoteHue requested a review from scrungus October 10, 2023 15:20
@jovial
Copy link
Collaborator

jovial commented Oct 11, 2023

Looks reasonable. Annoying that the github checkout action can't clone to an absolute path, otherwise we could clone to /home/stack/kayobe-automation-env/src/kayobe-config and achieve the same effect. Alternative would be to checkout and then copy to /home/stack/kayobe-automation-env/src/kayobe-config.

See: actions/checkout#197

functions Outdated Show resolved Hide resolved
Adds a flag to allow the current copy of kayobe-config to be used,
rather than copying in a clean version.

This is useful if you want to use previously-generated Kolla config
under kayobe-config/etc/kolla
Copy link
Contributor

@scrungus scrungus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MoteHue MoteHue merged commit a889e93 into main Oct 18, 2023
4 checks passed
@MoteHue MoteHue deleted the allow-unclean-skc-checkout branch October 18, 2023 08:25
@jackhodgkiss
Copy link
Contributor

This change has introduced an issue whereby all attempts to run kayobe-automation yield the following error.

49.74 ~/kayobe-automation-env/src/kayobe ~
49.74 ~
49.74 /tmp/src/.automation/utils/../functions: line 649: /stack/kayobe-automation-env/src/kayobe-config/kayobe-env: No such file or directory
------
Dockerfile:86
--------------------
  85 |     # Control host bootsrap without leaving kayobe-config in the image
  86 | >>> RUN --mount=type=ssh,uid=1000 --mount=type=tmpfs,target=/tmp/src --mount=type=bind,source=.,target=/src sudo cp -rfp /src /tmp/ && \
  87 | >>>   sudo chown -Rf stack:stack /tmp/src && \
  88 | >>>   # Strip the secrets so that we don't need to pass in a vault-password
  89 | >>>   grep -lR "\$ANSIBLE_VAULT" /tmp/src | xargs rm -f && \
  90 | >>>   bash /tmp/src/.automation/utils/kayobe-automation-install && \
  91 | >>>   (rm -f /stack/.ssh/{id_rsa,id_rsa.pub} || true) && \
  92 | >>>   (mkdir /stack/.ansible || true) && \
  93 | >>>   (cp -rfp /stack/kayobe-automation-env/src/kayobe-config/etc/kayobe/ansible/roles /stack/.ansible/kayobe-automation-roles || true) && \
  94 | >>>   (cp -rfp /stack/kayobe-automation-env/src/kayobe-config/etc/kayobe/ansible/collections /stack/.ansible/kayobe-automation-collections || true) && \
  95 | >>>   rm -rf /stack/kayobe-automation-env/src/kayobe-config
  96 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c sudo cp -rfp /src /tmp/ &&   sudo chown -Rf stack:stack /tmp/src &&   grep -lR \"\\$ANSIBLE_VAULT\" /tmp/src | xargs rm -f &&   bash /tmp/src/.automation/utils/kayobe-automation-install &&   (rm -f /stack/.ssh/{id_rsa,id_rsa.pub} || true) &&   (mkdir /stack/.ansible || true) &&   (cp -rfp /stack/kayobe-automation-env/src/kayobe-config/etc/kayobe/ansible/roles /stack/.ansible/kayobe-automation-roles || true) &&   (cp -rfp /stack/kayobe-automation-env/src/kayobe-config/etc/kayobe/ansible/collections /stack/.ansible/kayobe-automation-collections || true) &&   rm -rf /stack/kayobe-automation-env/src/kayobe-config" did not complete successfully: exit code: 1
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c sudo cp -rfp /src /tmp/ &&   sudo chown -Rf stack:stack /tmp/src &&   grep -lR \"\\$ANSIBLE_VAULT\" /tmp/src | xargs rm -f &&   bash /tmp/src/.automation/utils/kayobe-automation-install &&   (rm -f /stack/.ssh/{id_rsa,id_rsa.pub} || true) &&   (mkdir /stack/.ansible || true) &&   (cp -rfp /stack/kayobe-automation-env/src/kayobe-config/etc/kayobe/ansible/roles /stack/.ansible/kayobe-automation-roles || true) &&   (cp -rfp /stack/kayobe-automation-env/src/kayobe-config/etc/kayobe/ansible/collections /stack/.ansible/kayobe-automation-collections || true) &&   rm -rf /stack/kayobe-automation-env/src/kayobe-config" did not complete successfully: exit code: 1

I think this should amendmended such that the original behaviour is the default.

@MoteHue
Copy link
Contributor Author

MoteHue commented Oct 23, 2023

I think this should amendmended such that the original behaviour is the default.

Ah this was meant to be the intention. Looks like I messed it up when changing from "true/false" to "1/0".

@MoteHue
Copy link
Contributor Author

MoteHue commented Oct 23, 2023

PR to fix here: #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants