-
Notifications
You must be signed in to change notification settings - Fork 25
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
🔥 Migrating to Makefile Modules ALL AT ONCE 🔥 #556
Conversation
I will continue this on Monday, Aug 19th if that's OK. I really enjoy working with Makefile Modules. |
fmt.Println("Preflight version: ", version.PreflightVersion, version.Platform) | ||
fmt.Println("Preflight version: ", version.PreflightVersion, runtime.GOOS+"/"+runtime.GOARCH) |
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.
Self-review: I've (somewhat) checked that the old version.Platform
had the same values as the new runtime.GOOS+"/"+runtime.GOARCH
since it used to be set to
-X "github.com/jetstack/preflight/pkg/version.Platform=$(GOOS)/$(GOARCH)" \
which were set using
GOOS:=$(shell go env GOOS)
GOARCH:=$(shell go env GOARCH)
which matches the new Go string above.
fdf4cac
to
ab0f53f
Compare
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
Note that I should probably have gone with a fake of the ConnectionHandler instead of an envtest. We will move to the fake later on. I added the venaficonnection CRDs manually for now. I have a PR to automate pulling these CRDs from the venafi-connection-lib project: #556 For now, I added these manifests manually with the following commands: gh pr checkout 556 git checkout - git checkout step1-makefile-modules -- deploy/charts/venafi-kubernetes-agent/templates/venafi-connection-crd{,.without-validations}.yaml
repo_ref: main | ||
repo_hash: 2547c81aaa2ff4aeefdda53988191b5cbe929985 | ||
repo_path: modules/oci-publish | ||
- folder_name: repository-base |
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.
I think we should probably skip this module for now. It is very specific for cert-manager repos atm. (eg. creates the OWNERS_ALIASES file).
// pull the CRD manifest from the venafi-connection-lib project. | ||
func main() { | ||
fmt.Print(string(crd.VenafiConnectionCrd)) | ||
} |
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.
@maelvls you can take a look at https://github.com/jetstack/venafi-enhanced-issuer which has some logic for generating and modifying these Venafi Connection CRDs.
Thanks for the review, Tim. For context, I paused working on this because I have been focusing on VC-35568 which (I was told) is higher priority. I want to resume working on this as soon as I make some progress on VC-35568. Although I'd love to continue working on this, I think it can wait one week or two. WDYT? |
ab0f53f
to
2373a00
Compare
Initially, my goal was to just renamed the Makefile to make/02_mod.mk, and change nothing else, with the intent of migrating bit by bit. After a few attempts, I found that the fact that the Makefile is being run within a container makes things needlessly complex, and trying to make makefile-modules work in that context isn't worth it. That's why I propose to migrate everything at once, with the goal of making no breaking changes to the Helm charts and containers (except for the binary location, binary name, entrypoint, and cmd).
2373a00
to
cce1879
Compare
@@ -1,23 +1,20 @@ | |||
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. | |||
# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base/.github/dependabot.yaml instead. |
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.
Broken link, I've fixed this upstream: cert-manager/makefile-modules#196
6b3b365
to
3aa2fe8
Compare
Using set -x, I noticed that LDFLAGS= was being split on the commas: + LDFLAGS='-X version.Commit=6b3b365dbf4a3a907b6fd97d745efbd889afde0f -X version.BuildDate=Thu,' + 26 Sep 2024 14:34:51 '+0000 -X client.ClientID=k3TrDbfLhCgnpAbOiiT2kIE1AbovKzjo To fix this, I've decided to print the date without spaces or special chars. Before, it looked like this: Fri, 27 Sep 2024 10:15:10 +0000 Now, it looks like this: 2024-09-27-12:15:16-CEST
3aa2fe8
to
3c98fb5
Compare
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
These markers are only meant for properties that don't have a default value.
These markers are only meant for properties that don't have a default value.
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
775fa69
to
83a24f1
Compare
…pending Co-authored-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
a16d1d3
to
f20e5fb
Compare
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@maelvls I think the PR is ready to be merged.
|
Thanks for working on the GitHub Actions. I've looked at them and they look OK. Let's merge this and try releasing v1.1.0-alpha.0 to see if everything works. |
The official registry is oci://eu.gcr.io/jetstack-secure-enterprise/charts, but we haven't configured access to this GCR registry in GitHub Actions for now, so we will be pushing to Quay for now.
# -- Specify image pull credentials if using a private registry | ||
# example: - name: my-pull-secret | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "v0.0.0" |
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.
@maelvls This default value makes it into the README file which may confuse users:
$ helm inspect readme _bin/scratch/image/venafi-kubernetes-agent-1.1.0-dirty.tgz | fgrep -A 5 image.tag
#### **image.tag** ~ `string`
> Default value:
> ```yaml
> v0.0.0
> ```
make helm-chart
uses yq
to modify this value after running helm package
.
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.
The image.tag
value is not on the documentation website:
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.
Well spotted, that’s a problem.
- I’ll let Michael know about the outdated Helm reference page,
- I propose that we remove the default tag and only show an example
I can open a PR with thisI created a ticket: https://venafi.atlassian.net/browse/VC-36700
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.
I propose that we remove the default tag and only show an example; I can open a PR with this.
👍
Sounds like a good idea, I think that will work.
I've revived #555. Here is why I don't think we should do gradually:
make build-docker-images
was running a make command within a container in a buildx env, which made things super complicated for nothingCGO_ENABLED=1
set, I would understand. But since we don't, we should Ko.This PR is my ongoing effort to fully migrate this repo to makefile-modules.
A few things are already working:
make helm-chart make oci-push-preflight # To generate jetstack.io_venaficonnections.yaml: make generate-manifests
🚨 MAYBE BREAKING 🚨 The image's binary location isn't the same. The images are vastly different...
/bin/preflight
and is now located at/ko-app/preflight
.Full diff:
Notes:
quay.io/jetstack/preflight
, and to havequay.io/jetstack/venafi-agent
as the only image we push since that's the image that gets mirrored. The old Helm chartdeploy/charts/jetstack-secure
can be updated to usequay.io/jetstack/venafi-agent
if needed.Tests Performed