-
Notifications
You must be signed in to change notification settings - Fork 1
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
(Cypress) Automate renewal certificate for orakl-backend
#296
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Aider chat conversation: USER: 만약 toYaml이 들어간 라인을 들여쓰기하면 nindent를 지워도 되나요? 아니면 이는 템플릿에서 보일 때만 적용될 뿐 실제 파일이 generate될 때 적용될 indent에는 반드시 nindent 함수를 사용해야 하나요? ASSISTANT: `toYaml` 함수를 사용할 때 들여쓰기를 직접 하면 `nindent`를 사용하지 않아도 됩니다. 그러나 Helm 템플릿에서는 `nindent` 함수를 사용하는 것이 일반적으로 권장됩니다. 이 함수는 지정된 수의 공백을 추가하여 새로운 줄에서 시작하는 문자열을 생성합니다. 이는 템플릿이 보기에만 좋게 만드는 것이 아니라, 실제로 파일이 생성될 때 적용되는 들여쓰기를 제어합니다. `nindent`는 특히 여러 줄에 걸친 YAML 블록을 생성할 때 유용합니다. 예를 들어, 여러 줄의 YAML을 생성하고 이를 특정 수준으로 들여쓰기하려면 `nindent`를 사용하는 것이 좋습니다. 이렇게 하면 생성된 YAML이 올바른 위치에 들여쓰기되어 Kubernetes 매니페스트 파일로서 올바르게 작동하게 됩니다. 따라서, `nindent` 함수는 실제 파일 생성 시에도 적용되는 들여쓰기를 제어하기 위해 필요합니다. USER: 그렇다면 들여쓰기가 분명한 위치이고, 가독성을 위해서도 필요한데, 이번 케이스에 한해 nindent 2를 제거해도 될까요? 반드시 사용해야 하는 경우는 어떤 경우인지 잘 이해했습니다. ASSISTANT: 만약 `toYaml` 함수를 사용한 라인이 이미 올바른 들여쓰기 위치에 있고, `nindent` 없이도 YAML 파일이 올바르게 생성될 것이라 확신한다면 `nindent`를 제거할 수 있습니다. `nindent`는 주로 자동으로 들여쓰기를 추가해야 할 때 사용되며, 수동으로 들여쓰기를 제어할 수 있는 상황에서는 생략할 수 있습니다. `nindent`가 반드시 필요한 경우는 다음과 같습니다: - 여러 줄에 걸친 YAML 블록을 생성하고, 이를 특정 수준으로 들여쓰기해야 할 때. - 템플릿의 다른 부분에서 생성된 변수를 사용하여 들여쓰기를 동적으로 조정해야 할 때. - 템플릿의 들여쓰기 수준이 불분명하거나 일관되지 않을 때. 이번 케이스에 한해 `nindent`를 제거하고자 한다면, 다음과 같이 `clusterrole.yaml` 파일을 수정할 수 있습니다: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ rules: - {{ toYaml $job.rules | nindent 2 }} + {{ toYaml $job.rules }} {{- end }} ``` 위의 변경 사항은 `nindent` 함수를 제거하고, `toYaml` 함수만을 사용하여 `rules`를 YAML 형식으로 변환합니다. 이렇게 하면 `rules` 블록이 `clusterrole.yaml` 파일에 올바른 들여쓰기 수준으로 포함됩니다.
… secret in cronjob.
…etes secret. # Aider chat conversation: USER: values.yaml에 clusterRole을 도와주신 덕분에 잘 설정했습니다. args를 잘 보시면 이미 존재하는 디스크에 접근하여 존재하는 파일로 TLS인증서를 갱신하는데요. 갱신된 인증서를 이용하여 kubernetes secret으로 내보내는 라인을 추가해주실 수 있나요? 인증서 파일은 /etc/letsencrpyt/live/orakl.network 경로에 cert.pem 파일과 keyfile.pem으로 저장됩니다. ASSISTANT: To add the necessary lines to export the renewed TLS certificate to a Kubernetes secret, I will modify the `args` section of the `orakl-tls-renew` job in the `values.yaml` file. Here is the diff for the changes: ```diff --- cronjobs/values.yaml +++ cronjobs/values.yaml @@ ... @@ echo "Step 3: Export to Kubernetes secret" - sleep infinity + kubectl create secret tls orakl-network-tls --cert=/etc/letsencrypt/live/orakl.network/cert.pem --key=/etc/letsencrypt/live/orakl.network/privkey.pem --dry-run=client -o yaml | kubectl apply -f - ``` This change will create a new Kubernetes secret named `orakl-network-tls` with the certificate and private key files from the specified directory. The `--dry-run=client -o yaml | kubectl apply -f -` part of the command ensures that the secret is created in a declarative way, which is a best practice for managing Kubernetes resources.
…m values.yaml and fallback to Helm release namespace if not specified. # Aider chat conversation: USER: 한국어로 답해주세요. 지금까지 말씀해주신 대로 작업해서 거의 다 왔는데, values.yaml 파일에 namespace를 잘 기재했음에도 clusterrole에서 $job.namespace로 내용을 읽어오지 못 합니다. 오류 메시지는 다음과 같으며 무엇이 문제일까요? Error: UPGRADE FAILED: failed to create resource: ClusterRoleBinding.rbac.authorization.k8s.io "orakl-cronjobs-orakl-db-backup" is invalid: subjects[0].namespace: Required value ASSISTANT: 해당 문제는 `values.yaml` 파일에 정의된 `namespace` 값을 `cronjobs/templates/clusterrole.yaml` 파일에서 제대로 참조하지 못해서 발생하는 것으로 보입니다. `ClusterRoleBinding` 정의에서 `namespace` 값을 동적으로 가져오도록 템플릿을 수정해야 할 것 같습니다. `values.yaml` 파일에 `namespace`가 각 job에 명시적으로 정의되어 있는지 확인하고, `clusterrole.yaml` 템플릿 파일에서 이 값을 올바르게 참조하도록 수정하겠습니다. 다음은 `cronjobs/templates/clusterrole.yaml` 파일에 대한 수정 사항입니다: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ subjects: - kind: ServiceAccount {{- if and (hasKey $job "serviceAccount") (hasKey $job "serviceAccount.name") }} name: {{ $job.serviceAccount.name }} {{- else }} name: {{ $.Release.Name}}-{{ $jobname }} {{- end }} - namespace: {{ $job.namespace }} + namespace: {{ default $.Release.Namespace $job.namespace }} roleRef: kind: ClusterRole {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} name: {{ $job.clusterRole.name }} {{- else }} name: {{ $.Release.Name }}-{{ $jobname }} {{- end }} apiGroup: rbac.authorization.k8s.io ``` 이 변경 사항은 `namespace` 값이 `values.yaml` 파일의 각 job 섹션에 없을 경우 기본적으로 Helm 릴리스의 네임스페이스를 사용하도록 설정합니다. 이렇게 하면 `ClusterRoleBinding` 생성 시 필요한 `namespace` 값을 항상 제공할 수 있습니다.
…ssing kubectl command in cronjobs/values.yaml. # Aider chat conversation: USER: kubectl 명령어가 없다고 실패했는데, 이를 해결해주세요. 한국어로 답해주세요. ASSISTANT: kubectl 명령어가 없어서 실패하는 문제를 해결하기 위해, 해당 명령어를 사용하는 컨테이너에 kubectl을 설치하는 단계를 추가하겠습니다. 이를 위해 `cronjobs/values.yaml` 파일에 kubectl 설치 명령어를 추가하는 패치를 만들겠습니다. ```diff --- cronjobs/values.yaml +++ cronjobs/values.yaml @@ ... @@ echo "Step 1: Install dependencies" apt -y update && apt -y install python3 python3-pip python3-venv python3 -m venv /certbot && /certbot/bin/pip3 install -U certbot-dns-godaddy + apt-get install -y curl + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl echo "Step 2: Renew TLS certificate" /certbot/bin/certbot renew \ ``` 위의 패치는 `orakl-tls-renew` 작업에 대한 `cronjobs/values.yaml` 파일의 `args` 섹션에 kubectl을 설치하는 명령어를 추가합니다. 이렇게 하면 해당 작업이 실행될 때 kubectl 명령어를 사용할 수 있게 됩니다.
# Aider chat conversation: USER: 한국어로 답해주세요. helm install로 설치했고, template에서 cronjob이나 serviceaccount는 잘 생성되는데, clusterrole만 생성되지 않습니다. 오류가 나오지 않는데 디버깅을 어떻게 해야할까요? ASSISTANT: ClusterRole이 생성되지 않는 문제를 해결하기 위해 Helm 차트의 템플릿을 확인해야 합니다. ClusterRole이 생성되지 않는 경우, Helm 템플릿에 문제가 있거나, Helm 차트의 values 파일에 올바른 설정이 되어 있지 않을 수 있습니다. 먼저, `cronjobs/templates/clusterrole.yaml` 파일을 확인하여 ClusterRole이 조건에 따라 생성되도록 되어 있는지 확인해야 합니다. 그리고 `cronjobs/values.yaml` 파일에서 ClusterRole에 대한 설정이 올바르게 정의되어 있는지 확인해야 합니다. ClusterRole이 생성되지 않는 문제를 디버깅하기 위해 다음 단계를 수행할 수 있습니다: 1. Helm 차트의 템플릿 파일에서 ClusterRole 정의 부분이 조건문에 의해 올바르게 생성되도록 되어 있는지 확인합니다. 2. Helm의 `--dry-run` 옵션을 사용하여 실제로 클러스터에 적용되기 전에 생성될 리소스를 미리 볼 수 있습니다. 3. Helm의 `--debug` 옵션을 사용하여 설치 과정에서 발생하는 내용을 자세히 볼 수 있습니다. 4. Kubernetes 클러스터의 RBAC 설정이 ClusterRole을 생성할 수 있는 권한을 가지고 있는지 확인합니다. 현재 제공된 `cronjobs/templates/clusterrole.yaml` 파일을 기반으로 ClusterRole이 생성되지 않는 문제를 해결하기 위한 수정 사항을 제안하겠습니다. ClusterRole 생성 조건을 확인하고, 필요한 경우 수정하겠습니다. ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ {{- range $jobname, $job := .Values.jobs }} {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} name: {{ $job.clusterRole.name }} {{- else }} - name: {{ $.Release.Name }}-{{ $jobname }} + # 주석 처리된 부분을 제거하거나 조건을 수정하여 ClusterRole이 항상 생성되도록 할 수 있습니다. {{- end }} labels: {{- include "cronjobs.labels" $ | nindent 4 }} cron: {{ $jobname }} {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.annotations") }} {{- with $job.clusterRole.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} rules: {{ toYaml $job.rules }} {{- end }} ``` 위의 diff 출력은 `cronjobs/templates/clusterrole.yaml` 파일에서 ClusterRole이 생성되지 않는 문제를 해결하기 위한 예시 수정 사항입니다. 실제 문제 해결을 위해서는 Helm 차트의 나머지 부분과 함께 전체적인 검토가 필요합니다.
…y for jobs with clusterRole property. # Aider chat conversation: USER: 한국어로 답해주세요. job이 clusterRole이나 clusterRole.name 속성을 가지고 있는 경우에만 생성하도록 했는데, dry-run으로 결과물을 보면 clusterRole을 가지지 않은 backdb-job에 대해서도 롤이 생성됩니다. 원인이 무엇이고, 어떻게 해결하나요? ASSISTANT: 문제의 원인은 `cronjobs/templates/clusterrole.yaml` 파일에서 `ClusterRole`과 `ClusterRoleBinding` 리소스를 생성하는 조건문이 잘못되어 있기 때문입니다. 현재 조건문은 `clusterRole`과 `clusterRole.name` 속성이 있는지만 확인하고 있으며, 이 속성들이 없는 job에 대해서도 리소스를 생성하고 있습니다. 해결 방법은 `range` 루프 안에서 `clusterRole` 속성의 존재 여부를 확인하는 조건문을 추가하여, 해당 속성이 없는 경우 리소스 생성을 건너뛰도록 수정하는 것입니다. 다음은 수정된 `cronjobs/templates/clusterrole.yaml` 파일의 diff 결과입니다: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ {{- range $jobname, $job := .Values.jobs }} -{{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} +{{- if hasKey $job "clusterRole" }} --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ $job.clusterRole.name }} labels: {{- include "cronjobs.labels" $ | nindent 4 }} cron: {{ $jobname }} {{- with $job.clusterRole.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} rules: {{ toYaml $job.clusterRole.rules | nindent 2 }} {{- end }} --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ $job.clusterRole.name | default (printf "%s-%s" $.Release.Name $jobname) }} subjects: - kind: ServiceAccount name: {{ $job.serviceAccount.name | default (printf "%s-%s" $.Release.Name $jobname) }} namespace: {{ default $.Release.Namespace $job.namespace }} roleRef: kind: ClusterRole name: {{ $job.clusterRole.name | default (printf "%s-%s" $.Release.Name $jobname) }} apiGroup: rbac.authorization.k8s.io -{{- end }} +{{- end }} {{- end }} ``` 이 변경사항은 `clusterRole` 속성이 있는 job에 대해서만 `ClusterRole`과 `ClusterRoleBinding` 리소스를 생성하도록 수정합니다.
…ronjobs/templates/clusterrole.yaml` to prevent errors with empty names. # Aider chat conversation: USER: 한국어로 답해주세요. 말씀해주신 대로 수정 후에는 다음과 같은 오류가 발생합니다. Error: INSTALLATION FAILED: Unable to continue with install: could not get information about the resource ClusterRole "" in namespace "": resource name may not be empty ASSISTANT: 해당 오류는 Kubernetes의 ClusterRole 리소스 이름이 비어 있기 때문에 발생합니다. 이 문제를 해결하기 위해 `cronjobs/templates/clusterrole.yaml` 파일에서 ClusterRole 및 ClusterRoleBinding의 이름을 설정하는 로직을 수정해야 합니다. 이름이 제대로 설정되지 않은 경우 기본값을 사용하도록 변경하겠습니다. 다음은 수정된 `cronjobs/templates/clusterrole.yaml` 파일의 diff입니다: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ {{- range $jobname, $job := .Values.jobs }} {{- if hasKey $job "clusterRole" }} --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} - name: {{ $job.clusterRole.name }} + name: {{ default (print $.Release.Name "-" $jobname) $job.clusterRole.name }} {{- end }} namespace: {{ default $.Release.Namespace $job.namespace }} labels: {{- include "cronjobs.labels" $ | nindent 4 }} cron: {{ $jobname }} {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.annotations") }} {{- with $job.clusterRole.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }} rules: {{ toYaml $job.rules }} {{- end }} --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} - name: {{ $job.clusterRole.name }} + name: {{ default (print $.Release.Name "-" $jobname "-binding") $job.clusterRole.name }} {{- else }} name: {{ $.Release.Name }}-{{ $jobname }} {{- end }} subjects: - kind: ServiceAccount {{- if and (hasKey $job "serviceAccount") (hasKey $job "serviceAccount.name") }} name: {{ $job.serviceAccount.name }} {{- else }} name: {{ $.Release.Name}}-{{ $jobname }} {{- end }} namespace: {{ default $.Release.Namespace $job.namespace }} roleRef: kind: ClusterRole {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} - name: {{ $job.clusterRole.name }} + name: {{ default (print $.Release.Name "-" $jobname) $job.clusterRole.name }} {{- else }} name: {{ $.Release.Name }}-{{ $jobname }} {{- end }} apiGroup: rbac.authorization.k8s.io {{- end }} ``` 이 변경 사항은 ClusterRole 및 ClusterRoleBinding의 이름이 비어 있지 않도록 기본값을 설정합니다. ClusterRoleBinding의 이름에 "-binding" 접미사를 추가하여 이름 충돌을 방지합니다.
…y ClusterRole name issue. # Aider chat conversation: USER: 한국어로 답해주세요. 말씀해주신 수정 후에도 여전히 같은 문제가 발생합니다. ASSISTANT: 안녕하세요, 문제가 발생하는 부분에 대해 구체적으로 설명해주시면 수정을 도와드리겠습니다. 어떤 문제가 발생하는지, 어떤 파일을 수정해야 하는지, 그리고 어떤 변경을 원하시는지 알려주세요. USER: Error: INSTALLATION FAILED: Unable to continue with install: could not get information about the resource ClusterRole "" in namespace "": resource name may not be empty 해당 오류요 ASSISTANT: 해당 오류는 Kubernetes 클러스터에서 Helm 차트를 설치할 때 발생하는 것으로 보입니다. 오류 메시지에 따르면, `ClusterRole`의 이름이 비어있어서 발생하는 문제로 보입니다. `cronjobs/templates/clusterrole.yaml` 파일에서 `ClusterRole`과 `ClusterRoleBinding`의 이름을 정의하는 부분을 확인하고 수정해야 할 것 같습니다. `cronjobs/templates/clusterrole.yaml` 파일에서 `ClusterRole`과 `ClusterRoleBinding`의 이름을 설정하는 로직에 문제가 있을 수 있으므로, 해당 부분을 수정하는 diff를 생성하겠습니다. ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} - name: {{ default (print $.Release.Name "-" $jobname) $job.clusterRole.name }} + name: {{ $job.clusterRole.name | default (print $.Release.Name "-" $jobname) }} {{- end }} namespace: {{ default $.Release.Namespace $job.namespace }} @@ ... @@ {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} - name: {{ default (print $.Release.Name "-" $jobname "-binding") $job.clusterRole.name }} + name: {{ $job.clusterRole.name | default (print $.Release.Name "-" $jobname "-binding") }} {{- else }} @@ ... @@ {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.name") }} - name: {{ default (print $.Release.Name "-" $jobname) $job.clusterRole.name }} + name: {{ $job.clusterRole.name | default (print $.Release.Name "-" $jobname) }} {{- else }} ``` 위의 diff는 `default` 함수의 사용 방식을 수정하여 `ClusterRole`과 `ClusterRoleBinding`의 이름이 비어있지 않도록 합니다. Helm 템플릿에서 `default` 함수는 첫 번째 인자가 비어있거나 정의되지 않았을 때 두 번째 인자를 사용하도록 합니다. 이 변경을 통해 `ClusterRole`의 이름이 비어있는 문제를 해결할 수 있습니다. 이 수정이 문제를 해결하는 데 도움이 되었기를 바랍니다. 추가적인 수정이 필요하거나 다른 문제가 발생하면 알려주세요.
… file. # Aider chat conversation: USER: 한국어로 답해주세요. 저는 values에 적어둔 rules처럼 clusterRole에 삽입하고 싶은데, 현 상태에서 toYaml로 들어갈 때는 제가 의도한 것과는 다르게 삽입되는 것 같습니다. 아래는 렌더링된 결과입니다. rules: - apiGroups: - apps resources: - deployments verbs: - get - list - apiGroups: - "" resources: - pods - secrets verbs: - get - list - exec - apiGroups: - "" resources: - pods/exec verbs: - create ASSISTANT: 문제를 해결하기 위해 `toYaml` 함수를 사용할 때 발생하는 들여쓰기 문제를 수정하겠습니다. `toYaml` 함수가 생성하는 YAML 형식이 의도한 대로 들여쓰기 되지 않는 것을 고치기 위해, `nindent` 함수의 들여쓰기 수준을 조정하겠습니다. 다음은 `cronjobs/templates/clusterrole.yaml` 파일에 대한 수정 사항입니다: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ {{- with $job.clusterRole.rules }} rules: - {{- toYaml . | nindent 4}} + {{- toYaml . | nindent 2}} {{- end }} ``` 이 변경을 통해 `rules` 항목이 올바른 들여쓰기 수준으로 YAML 파일에 삽입될 것입니다.
…ng `nindent` and `|-` block chomping. # Aider chat conversation: USER: toYaml을 적용했을 때 배열로 들어간 값들이 모두 풀려서 원래 문법과 다르게 적용되는 것 같습니다. values.yaml에 적혀있는 그대로 삽입하려면 어떻게 해야 하나요? ASSISTANT: To ensure that the YAML array values are preserved exactly as they are in the `values.yaml` file when using `toYaml`, you can use the `nindent` function along with the `>-` block chomping indicator in Helm templates. This will maintain the indentation and format of the array as it is in the `values.yaml` file. Here's the diff for the `cronjobs/templates/clusterrole.yaml` file to apply this change: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ {{- with $job.clusterRole.rules }} rules: - {{- toYaml . | nindent 2}} + - |- + {{- toYaml . | nindent 6 }} {{- end }} ``` This change will ensure that the `rules` array from the `values.yaml` file is inserted into the template with the correct indentation and without expanding the array elements. The `|-` block chomping indicator keeps the newline at the end of the string, and `nindent 6` ensures the correct indentation level.
… to prevent errors in `cronjobs/templates/clusterrole.yaml`. # Aider chat conversation: USER: 한국어로 답해주세요. values에 있는 rules 내용을 그대로 넣고 싶어서, 멀티라인 텍스트로 변경했더니 전혀 관련 없는 위치에서 ㅇ오류가 발생합니다. 오류 위치는 clusterrole의 labels 쪽에서 발생하며 메시지는 line 13: did not find expected key입니다. ASSISTANT: 문제를 해결하기 위해 `cronjobs/templates/clusterrole.yaml` 파일의 `rules` 섹션을 멀티라인 문자열로 변경하겠습니다. 이렇게 하면 YAML 파서가 `rules`의 내용을 올바르게 처리할 수 있을 것입니다. 또한, `labels` 섹션에서 발생하는 오류를 수정하기 위해 해당 부분을 살펴보고 필요한 수정을 적용하겠습니다. 다음은 수정된 내용을 반영한 diff입니다: ```diff --- cronjobs/templates/clusterrole.yaml +++ cronjobs/templates/clusterrole.yaml @@ ... @@ labels: {{- include "cronjobs.labels" $ | nindent 4 }} cron: {{ $jobname }} {{- if and (hasKey $job "clusterRole") (hasKey $job "clusterRole.annotations") }} annotations: {{- toYaml . | nindent 4 }} {{- end }} -rules: | - {{ $job.clusterRole.rules }} +rules: + {{- toYaml $job.clusterRole.rules | nindent 2 }} ``` 위의 변경 사항은 `rules`를 멀티라인 문자열로 처리하도록 수정하고, `labels` 섹션에서 발생할 수 있는 오류를 방지하기 위해 `nindent`를 사용하여 올바른 들여쓰기를 적용합니다. YAML에서 들여쓰기는 매우 중요하므로, 이 부분을 주의 깊게 확인해야 합니다.
nick-bisonai
approved these changes
Apr 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added many files by mistake. (But them already required.)
Please review
cronjobs/values.yaml
andcronjobs/template/clusterrole.yaml
file. 🙏🏼