Skip to content

Commit

Permalink
chore(charts): rename crds subchart to logging-operator-crds
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Nov 28, 2024
1 parent 7fb6cc8 commit 512c74f
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 29 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,69 +387,69 @@ jobs:
if: github.repository == 'kube-logging/logging-operator'
name: CRD subchart
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
id-token: write
security-events: write

outputs:
name: ${{ steps.oci-chart-name.outputs.value }}
tag: ${{ steps.version.outputs.value }}
package: ${{ steps.build.outputs.package }}

env:
subchartPath: logging-operator/charts/crds
subchartName: crds
subchartPath: logging-operator/charts/logging-operator-crds
subchartName: logging-operator-crds

steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.12.0

- name: Set up Cosign
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0

- name: Set chart name
id: chart-name
run: echo "value=${{ github.event.repository.name }}/$subchartName" >> "$GITHUB_OUTPUT"

- name: Set OCI registry name
id: oci-registry-name
run: echo "value=ghcr.io/${{ github.repository_owner }}/helm-charts" >> "$GITHUB_OUTPUT"

- name: Set OCI chart name
id: oci-chart-name
run: echo "value=${{ steps.oci-registry-name.outputs.value }}/${{ steps.chart-name.outputs.value }}" >> "$GITHUB_OUTPUT"

- name: Helm lint
run: helm lint charts/$subchartPath

- name: Determine raw version
uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd # v1.2.1
id: version
with:
cond: ${{ inputs.release }}
if_true: ${{ github.ref_name }}
if_false: 0.0.0

- name: Helm package
id: build
run: |
helm package charts/$subchartPath --version ${{ steps.version.outputs.value }} --app-version ${{ steps.version.outputs.value }}
echo "package=${{ github.workspace }}/$subchartName-${{ steps.version.outputs.value }}.tgz" >> "$GITHUB_OUTPUT"
- name: Upload chart as artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: "[${{ github.job }}] Helm chart"
path: ${{ steps.build.outputs.package }}

- name: Login to GitHub Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
Expand All @@ -466,13 +466,13 @@ jobs:
env:
HELM_REGISTRY_CONFIG: ~/.docker/config.json
if: inputs.publish && inputs.release

- name: Sign chart with GitHub OIDC Token
if: ${{ inputs.publish && inputs.release && github.repository_owner == 'kube-logging' }} # Check if the workflow is called by the same GitHub organization
env:
DIGEST: ${{ steps.push.outputs.digest }}
run: cosign sign --yes --rekor-url "https://rekor.sigstore.dev/" "${{ steps.oci-chart-name.outputs.value }}@${DIGEST}"

- name: Verify signed chart with cosign
if: ${{ inputs.publish && inputs.release && github.repository_owner == 'kube-logging' }} # Check if the workflow is called by the same GitHub organization
env:
Expand All @@ -482,7 +482,7 @@ jobs:
--rekor-url "https://rekor.sigstore.dev/" \
--certificate-identity "https://github.com/${{ github.repository }}/.github/workflows/artifacts.yaml@${{ github.ref }}" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" | jq
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # 0.28.0
env:
Expand All @@ -493,14 +493,14 @@ jobs:
scan-ref: charts/${{ steps.chart-name.outputs.value }}
format: sarif
output: trivy-results.sarif

- name: Upload Trivy scan results as artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: "[${{ github.job }}] Trivy scan results"
path: trivy-results.sarif
retention-days: 5

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ manifests: ${CONTROLLER_GEN} ## Generate manifests e.g. CRD, RBAC etc.
cd pkg/sdk && $(CONTROLLER_GEN) $(CRD_OPTIONS) webhook paths="./..." output:crd:artifacts:config=../../config/crd/bases output:webhook:artifacts:config=../../config/webhook
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./controllers/..." output:rbac:artifacts:config=./config/rbac
cp config/crd/bases/* charts/logging-operator/crds/
for f in config/crd/bases/*.yaml; do sed '/controller-gen.kubebuilder.io\/version/ r hack/crds.annotations.snippet.txt' $${f} > charts/logging-operator/charts/crds/templates/$${f##*/}; done
for f in config/crd/bases/*.yaml; do sed '/controller-gen.kubebuilder.io\/version/ r hack/crds.annotations.snippet.txt' $${f} > charts/logging-operator/charts/logging-operator-crds/templates/$${f##*/}; done
echo "{{- if .Values.rbac.enabled }}" > ./charts/logging-operator/templates/clusterrole.yaml
cat config/rbac/role.yaml | sed -e 's@manager-role@{{ template "logging-operator.fullname" . }}@' | sed -e '/creationTimestamp/d' | cat >> ./charts/logging-operator/templates/clusterrole.yaml
echo "{{- end }}" >> ./charts/logging-operator/templates/clusterrole.yaml
Expand Down
4 changes: 2 additions & 2 deletions charts/logging-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ sources:
- https://github.com/kube-logging/logging-operator
- https://github.com/kube-logging/helm-charts/tree/main/charts/logging-operator
dependencies:
- name: crds
- name: logging-operator-crds
version: 0.0.0
condition: crds.install
condition: logging-operator-crds.install
4 changes: 2 additions & 2 deletions charts/logging-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Use `createCustomResource=false` with Helm v3 to avoid trying to create CRDs fro
| namespaceOverride | string | `""` | A namespace override for the app. |
| annotations | object | `{}` | Define annotations for logging-operator pods. |
| createCustomResource | bool | `false` | Deploy CRDs used by Logging Operator. |
| crds.install | bool | `false` | Toggle to install and upgrade CRDs from a subchart. Make sure to use it with `--skip-crds` to avoid conflicts. [More info about limitations on CRDs in Helm 3](https://helm.sh/docs/topics/charts/#limitations-on-crds) |
| crds.annotations | object | `{}` | Annotations to be added to all CRDs |
| logging-operator-crds.install | bool | `false` | Toggle to install and upgrade CRDs from a subchart. Make sure to use it with `--skip-crds` to avoid conflicts. [More info about limitations on CRDs in Helm 3](https://helm.sh/docs/topics/charts/#limitations-on-crds) |
| logging-operator-crds.annotations | object | `{}` | Annotations to be added to all CRDs |
| http.port | int | `8080` | HTTP listen port number. |
| http.service | object | `{"annotations":{},"clusterIP":"None","labels":{},"type":"ClusterIP"}` | Service definition for query http service. |
| rbac.enabled | bool | `true` | Create rbac service account and roles. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
apiVersion: v2
name: crds
name: logging-operator-crds
version: 0.0.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# crds
# logging-operator-crds

![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square)

Expand Down
2 changes: 1 addition & 1 deletion charts/logging-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ annotations: {}
createCustomResource: false

## Custom resource configuration defined as a dependency chart
crds:
logging-operator-crds:
# -- Toggle to install and upgrade CRDs from a subchart. Make sure to use it with `--skip-crds` to avoid conflicts. [More info about limitations on CRDs in Helm 3](https://helm.sh/docs/topics/charts/#limitations-on-crds)
install: false
# -- Annotations to be added to all CRDs
Expand Down

0 comments on commit 512c74f

Please sign in to comment.