Skip to content

Update .goreleaser.yaml to include a Kubernetes manifest. #18

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

ryotarai
Copy link
Collaborator

This is the diff between https://github.com/pfnet/hierarchical-namespaces/releases/download/v1.1.0-pfnet.7/hrq.yaml and the manifest generated by this release script:

--- /Users/ryotarai/Downloads/hrq.yaml  2025-05-26 23:59:16
+++ ./releases/hrq.yaml 2025-05-27 00:22:11
@@ -845,7 +845,7 @@
         - --enable-hrq
         command:
         - /manager
-        image: ghcr.io/pfnet/hierarchical-namespaces:1.1.0-pfnet.7
+        image: ghcr.io/pfnet/hierarchical-namespaces:1.1.0-pfnet.7-SNAPSHOT-fe64d323
         livenessProbe:
           failureThreshold: 1
           httpGet:
@@ -1085,4 +1085,4 @@
     - UPDATE
     resources:
     - namespaces
-  sideEffects: None
\ No newline at end of file
+  sideEffects: None

Comment on lines +23 to +25
release:
extra_files:
- glob: "releases/hrq.yaml"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://goreleaser.com/customization/release/#github

  # You can add extra pre-existing files to the release.
  # The filename on the release will be the last part of the path (base).
  # If another file with the same name exists, the last one found will be used.
  #
  # Templates: allowed.
  extra_files:
    - glob: ./path/to/file.txt
    - glob: ./glob/**/to/**/file/**/*
    - glob: ./glob/foo/to/bar/file/foobar/override_from_previous
    - glob: ./single_file.txt
      name_template: file.txt # note that this only works if glob matches 1 file only

@ryotarai ryotarai marked this pull request as ready for review May 26, 2025 15:25
@utam0k
Copy link
Member

utam0k commented Jun 2, 2025

Timed out after 5.023s.
Command: [kubectl create ns acme-org]
Expected success, but got an error:
<*errors.errorString | 0xc000260690>: {
s: "Error: exit status 1\nOutput: Error from server (InternalError): Internal error occurred: failed calling webhook "namespaces.hnc.x-k8s.io": failed to call webhook: Post "[https://hnc-webhook-service.hnc-system.svc:443/validate-v1-namespace?timeout=10s](https://hnc-webhook-service.hnc-system.svc/validate-v1-namespace?timeout=10s)": dial tcp 10.96.103.106:443: connect: connection refused\n",
}
Error: exit status 1
Output: Error from server (InternalError): Internal error occurred: failed calling webhook "namespaces.hnc.x-k8s.io": failed to call webhook: Post "https://hnc-webhook-service.hnc-system.svc:443/validate-v1-namespace?timeout=10s": dial tcp 10.96.103.106:443: connect: connection refused

Hmm, it may be a bit flaky. I guess this change doesn't relate to this error.

@utam0k utam0k requested a review from Copilot June 2, 2025 04:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the .goreleaser.yaml configuration to generate and include a Kubernetes manifest (hrq.yaml) during the release process.

  • Added a new hook to generate the hrq.yaml manifest using a kustomize command.
  • Included the generated hrq.yaml as an extra file in the release section.
Comments suppressed due to low confidence (2)

.goreleaser.yaml:5

  • Consider verifying that the relative path '../../../releases/hrq.yaml' resolves correctly in all environments; if the command logic becomes more complex, extracting it into a dedicated script could improve clarity and maintainability.
  - bash -eux -o pipefail -c "mkdir -p releases; cd config/variants/hrq; kustomize edit set image controller=ghcr.io/pfnet/{{ .ProjectName }}:{{ .Version }}; kustomize build . > ../../../releases/hrq.yaml"

.goreleaser.yaml:23

  • Ensure that the 'extra_files' glob pattern ('releases/hrq.yaml') correctly captures the intended manifest file, and consider adding tests to validate this part of the release process.
release:

@utam0k utam0k merged commit aeefd17 into pfnet:master Jun 2, 2025
2 of 4 checks passed
@ryotarai ryotarai deleted the ryotarai/add-hrq.yaml-to-release branch June 9, 2025 11:33
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.

2 participants