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

chore(gha-runner-scale-set): update indentation of initContainers #2638

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

kahirokunn
Copy link
Contributor

@kahirokunn kahirokunn commented Jun 1, 2023

When setting dind and initContainers with values like the following, the following error occurs:

Error: UPGRADE FAILED: YAML parse error on gha-runner-scale-set/templates/autoscalingrunnerset.yaml: error converting YAML to JSON: yaml: line 49: did not find expected key
containerMode:
  type: "dind"
template:
  spec:
    initContainers:
    - name: kube-init
      image: ghcr.io/actions/actions-runner:latest
      imagePullPolicy: IfNotPresent
      command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"]
      volumeMounts:
      - name: work
        mountPath: /home/runner/_work

When outputting with the debug option, the indentation was shifted as follows:

      initContainers:
      - name: init-dind-externals

        image: quay.io/kahirokunn/actions-runner:latest
        command: ["cp"]
        args: ["-r", "-v", "/home/runner/externals/.", "/home/runner/tmpDir/"]
        volumeMounts:
          - name: dind-externals
            mountPath: /home/runner/tmpDir
        - command:
          - sudo
          - chown
          - -R
          - 1001:123
          - /home/runner/_work
          image: quay.io/kahirokunn/actions-runner:latest
          name: kube-init
          volumeMounts:
          - mountPath: /home/runner/_work
            name: work

Therefore, in this modification, the indentation will be corrected as follows:

  initContainers:
  - name: init-dind-externals
    image: ghcr.io/actions/actions-runner:latest
    command: ["cp"]
    args: ["-r", "-v", "/home/runner/externals/.", "/home/runner/tmpDir/"]
    volumeMounts:
      - name: dind-externals
        mountPath: /home/runner/tmpDir
  - command:
    - sudo
    - chown
    - -R
    - 1001:123
    - /home/runner/_work
    image: ghcr.io/actions/actions-runner:latest
    name: kube-init
    volumeMounts:
    - mountPath: /home/runner/_work
      name: work

@nikola-jokic nikola-jokic added gha-runner-scale-set Related to the gha-runner-scale-set mode community Community contribution labels Jun 1, 2023
@nikola-jokic nikola-jokic self-assigned this Jun 1, 2023
@nikola-jokic
Copy link
Member

Can you please write a test to cover this scenario?

@kahirokunn
Copy link
Contributor Author

@nikola-jokic done

Copy link
Member

@nikola-jokic nikola-jokic left a comment

Choose a reason for hiding this comment

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

LGTM

@nikola-jokic nikola-jokic merged commit 2343cd2 into actions:master Jun 21, 2023
15 checks passed
@kahirokunn kahirokunn deleted the fix-miss-indent branch June 21, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution gha-runner-scale-set Related to the gha-runner-scale-set mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants