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

🔥 Migrating to Makefile Modules ALL AT ONCE 🔥 #556

Merged
merged 17 commits into from
Sep 30, 2024

Conversation

maelvls
Copy link
Member

@maelvls maelvls commented Aug 13, 2024

I've revived #555. Here is why I don't think we should do gradually:

  1. The old make build-docker-images was running a make command within a container in a buildx env, which made things super complicated for nothing
  2. Building in a container using buildx/QEMU isn't needed, slows us down. If we had CGO_ENABLED=1 set, I would understand. But since we don't, we should Ko.
  3. I don't think the existing Makefile was doing much anyways.

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...

  • The binary was located at /bin/preflight and is now located at /ko-app/preflight.
  • The binary used to weight 72 MB, it now weights 55 MB (not sure why).

Full diff:

--- /dev/fd/11	2024-09-30 15:28:37
+++ /dev/fd/13	2024-09-30 15:28:37
@@ -1,456 +1,49 @@
 .dockerenv
-bin/
-bin/preflight
-boot/
 dev/
 dev/console
+dev/null
 dev/pts/
+dev/random
 dev/shm/
+dev/urandom
+dev/zero
 etc/
-etc/debian_version
-etc/default/
-etc/dpkg/
-etc/dpkg/origins/
-etc/dpkg/origins/debian
-etc/ethertypes
+etc/apk/
+etc/apk/arch
+etc/apk/keys/
+etc/apk/keys/alpine-devel@lists.alpinelinux.org-58cbb476.rsa.pub
+etc/apk/keys/alpine-devel@lists.alpinelinux.org-616ae350.rsa.pub
+etc/apk/repositories
+etc/apk/world
 etc/group
-etc/host.conf
 etc/hostname
 etc/hosts
-etc/issue
-etc/issue.net
 etc/mtab
-etc/nsswitch.conf
-etc/os-release
 etc/passwd
-etc/preflight/
-etc/preflight/agent.yaml
-etc/profile.d/
-etc/protocols
 etc/resolv.conf
-etc/rpc
-etc/services
-etc/skel/
 etc/ssl/
+etc/ssl/cert.pem
 etc/ssl/certs/
 etc/ssl/certs/ca-certificates.crt
-etc/update-motd.d/
-etc/update-motd.d/10-uname
+etc/ssl1.1/
+etc/ssl1.1/cert.pem
+etc/ssl1.1/certs
 home/
 home/nonroot/
+ko-app/
+ko-app/preflight
 lib/
+lib/apk/
+lib/apk/db/
+lib/apk/db/installed
+lib/apk/db/lock
+lib/apk/db/scripts.tar
+lib/apk/db/triggers
 proc/
-root/
-run/
-sbin/
 sys/
 tmp/
 usr/
-usr/bin/
-usr/games/
-usr/include/
-usr/lib/
-usr/lib/os-release
-usr/sbin/
 usr/share/
-usr/share/base-files/
-usr/share/base-files/dot.bashrc
-usr/share/base-files/dot.profile
-usr/share/base-files/dot.profile.md5sums
-usr/share/base-files/info.dir
-usr/share/base-files/motd
-usr/share/base-files/profile
-usr/share/base-files/profile.md5sums
-usr/share/base-files/staff-group-for-usr-local
-usr/share/common-licenses/
-usr/share/common-licenses/Apache-2.0
-usr/share/common-licenses/Artistic
-usr/share/common-licenses/BSD
-usr/share/common-licenses/CC0-1.0
-usr/share/common-licenses/GFDL
-usr/share/common-licenses/GFDL-1.2
-usr/share/common-licenses/GFDL-1.3
-usr/share/common-licenses/GPL
-usr/share/common-licenses/GPL-1
-usr/share/common-licenses/GPL-2
-usr/share/common-licenses/GPL-3
-usr/share/common-licenses/LGPL
-usr/share/common-licenses/LGPL-2
-usr/share/common-licenses/LGPL-2.1
-usr/share/common-licenses/LGPL-3
-usr/share/common-licenses/MPL-1.1
-usr/share/common-licenses/MPL-2.0
-usr/share/dict/
-usr/share/doc/
-usr/share/doc/base-files/
-usr/share/doc/base-files/FAQ
-usr/share/doc/base-files/README
-usr/share/doc/base-files/README.FHS
-usr/share/doc/base-files/changelog.gz
-usr/share/doc/base-files/copyright
-usr/share/doc/ca-certificates/
-usr/share/doc/ca-certificates/copyright
-usr/share/doc/netbase/
-usr/share/doc/netbase/changelog.gz
-usr/share/doc/netbase/copyright
-usr/share/doc/preflight/
-usr/share/doc/preflight/github.com/
-usr/share/doc/preflight/github.com/Jeffail/
-usr/share/doc/preflight/github.com/Jeffail/gabs/
-usr/share/doc/preflight/github.com/Jeffail/gabs/v2/
-usr/share/doc/preflight/github.com/Jeffail/gabs/v2/LICENSE
-usr/share/doc/preflight/github.com/Khan/
-usr/share/doc/preflight/github.com/Khan/genqlient/
-usr/share/doc/preflight/github.com/Khan/genqlient/graphql/
-usr/share/doc/preflight/github.com/Khan/genqlient/graphql/LICENSE
-usr/share/doc/preflight/github.com/Venafi/
-usr/share/doc/preflight/github.com/Venafi/vcert/
-usr/share/doc/preflight/github.com/Venafi/vcert/v5/
-usr/share/doc/preflight/github.com/Venafi/vcert/v5/LICENSE
-usr/share/doc/preflight/github.com/antlr/
-usr/share/doc/preflight/github.com/antlr/antlr4/
-usr/share/doc/preflight/github.com/antlr/antlr4/runtime/
-usr/share/doc/preflight/github.com/antlr/antlr4/runtime/Go/
-usr/share/doc/preflight/github.com/antlr/antlr4/runtime/Go/antlr/
-usr/share/doc/preflight/github.com/antlr/antlr4/runtime/Go/antlr/v4/
-usr/share/doc/preflight/github.com/antlr/antlr4/runtime/Go/antlr/v4/LICENSE
-usr/share/doc/preflight/github.com/asaskevich/
-usr/share/doc/preflight/github.com/asaskevich/govalidator/
-usr/share/doc/preflight/github.com/asaskevich/govalidator/LICENSE
-usr/share/doc/preflight/github.com/aymerick/
-usr/share/doc/preflight/github.com/aymerick/douceur/
-usr/share/doc/preflight/github.com/aymerick/douceur/LICENSE
-usr/share/doc/preflight/github.com/beorn7/
-usr/share/doc/preflight/github.com/beorn7/perks/
-usr/share/doc/preflight/github.com/beorn7/perks/quantile/
-usr/share/doc/preflight/github.com/beorn7/perks/quantile/LICENSE
-usr/share/doc/preflight/github.com/blang/
-usr/share/doc/preflight/github.com/blang/semver/
-usr/share/doc/preflight/github.com/blang/semver/v4/
-usr/share/doc/preflight/github.com/blang/semver/v4/LICENSE
-usr/share/doc/preflight/github.com/cenkalti/
-usr/share/doc/preflight/github.com/cenkalti/backoff/
-usr/share/doc/preflight/github.com/cenkalti/backoff/LICENSE
-usr/share/doc/preflight/github.com/cespare/
-usr/share/doc/preflight/github.com/cespare/xxhash/
-usr/share/doc/preflight/github.com/cespare/xxhash/v2/
-usr/share/doc/preflight/github.com/cespare/xxhash/v2/LICENSE.txt
-usr/share/doc/preflight/github.com/davecgh/
-usr/share/doc/preflight/github.com/davecgh/go-spew/
-usr/share/doc/preflight/github.com/davecgh/go-spew/spew/
-usr/share/doc/preflight/github.com/davecgh/go-spew/spew/LICENSE
-usr/share/doc/preflight/github.com/emicklei/
-usr/share/doc/preflight/github.com/emicklei/go-restful/
-usr/share/doc/preflight/github.com/emicklei/go-restful/v3/
-usr/share/doc/preflight/github.com/emicklei/go-restful/v3/LICENSE
-usr/share/doc/preflight/github.com/evanphx/
-usr/share/doc/preflight/github.com/evanphx/json-patch/
-usr/share/doc/preflight/github.com/evanphx/json-patch/v5/
-usr/share/doc/preflight/github.com/evanphx/json-patch/v5/LICENSE
-usr/share/doc/preflight/github.com/fatih/
-usr/share/doc/preflight/github.com/fatih/color/
-usr/share/doc/preflight/github.com/fatih/color/LICENSE.md
-usr/share/doc/preflight/github.com/fsnotify/
-usr/share/doc/preflight/github.com/fsnotify/fsnotify/
-usr/share/doc/preflight/github.com/fsnotify/fsnotify/LICENSE
-usr/share/doc/preflight/github.com/go-http-utils/
-usr/share/doc/preflight/github.com/go-http-utils/headers/
-usr/share/doc/preflight/github.com/go-http-utils/headers/LICENSE
-usr/share/doc/preflight/github.com/go-logr/
-usr/share/doc/preflight/github.com/go-logr/logr/
-usr/share/doc/preflight/github.com/go-logr/logr/LICENSE
-usr/share/doc/preflight/github.com/go-openapi/
-usr/share/doc/preflight/github.com/go-openapi/jsonpointer/
-usr/share/doc/preflight/github.com/go-openapi/jsonpointer/LICENSE
-usr/share/doc/preflight/github.com/go-openapi/jsonreference/
-usr/share/doc/preflight/github.com/go-openapi/jsonreference/LICENSE
-usr/share/doc/preflight/github.com/go-openapi/swag/
-usr/share/doc/preflight/github.com/go-openapi/swag/LICENSE
-usr/share/doc/preflight/github.com/gogo/
-usr/share/doc/preflight/github.com/gogo/protobuf/
-usr/share/doc/preflight/github.com/gogo/protobuf/LICENSE
-usr/share/doc/preflight/github.com/golang-jwt/
-usr/share/doc/preflight/github.com/golang-jwt/jwt/
-usr/share/doc/preflight/github.com/golang-jwt/jwt/v4/
-usr/share/doc/preflight/github.com/golang-jwt/jwt/v4/LICENSE
-usr/share/doc/preflight/github.com/golang/
-usr/share/doc/preflight/github.com/golang/groupcache/
-usr/share/doc/preflight/github.com/golang/groupcache/lru/
-usr/share/doc/preflight/github.com/golang/groupcache/lru/LICENSE
-usr/share/doc/preflight/github.com/golang/protobuf/
-usr/share/doc/preflight/github.com/golang/protobuf/proto/
-usr/share/doc/preflight/github.com/golang/protobuf/proto/LICENSE
-usr/share/doc/preflight/github.com/google/
-usr/share/doc/preflight/github.com/google/cel-go/
-usr/share/doc/preflight/github.com/google/cel-go/LICENSE
-usr/share/doc/preflight/github.com/google/gnostic-models/
-usr/share/doc/preflight/github.com/google/gnostic-models/LICENSE
-usr/share/doc/preflight/github.com/google/go-cmp/
-usr/share/doc/preflight/github.com/google/go-cmp/cmp/
-usr/share/doc/preflight/github.com/google/go-cmp/cmp/LICENSE
-usr/share/doc/preflight/github.com/google/gofuzz/
-usr/share/doc/preflight/github.com/google/gofuzz/LICENSE
-usr/share/doc/preflight/github.com/google/uuid/
-usr/share/doc/preflight/github.com/google/uuid/LICENSE
-usr/share/doc/preflight/github.com/gorilla/
-usr/share/doc/preflight/github.com/gorilla/css/
-usr/share/doc/preflight/github.com/gorilla/css/scanner/
-usr/share/doc/preflight/github.com/gorilla/css/scanner/LICENSE
-usr/share/doc/preflight/github.com/gorilla/websocket/
-usr/share/doc/preflight/github.com/gorilla/websocket/LICENSE
-usr/share/doc/preflight/github.com/hashicorp/
-usr/share/doc/preflight/github.com/hashicorp/errwrap/
-usr/share/doc/preflight/github.com/hashicorp/errwrap/LICENSE
-usr/share/doc/preflight/github.com/hashicorp/errwrap/README.md
-usr/share/doc/preflight/github.com/hashicorp/errwrap/errwrap.go
-usr/share/doc/preflight/github.com/hashicorp/errwrap/errwrap_test.go
-usr/share/doc/preflight/github.com/hashicorp/errwrap/go.mod
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/.circleci/
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/.circleci/config.yml
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/LICENSE
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/Makefile
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/README.md
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/append.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/append_test.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/flatten.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/flatten_test.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/format.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/format_test.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/go.mod
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/go.sum
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/group.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/group_test.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/multierror.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/multierror_test.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/prefix.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/prefix_test.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/sort.go
-usr/share/doc/preflight/github.com/hashicorp/go-multierror/sort_test.go
-usr/share/doc/preflight/github.com/imdario/
-usr/share/doc/preflight/github.com/imdario/mergo/
-usr/share/doc/preflight/github.com/imdario/mergo/LICENSE
-usr/share/doc/preflight/github.com/jetstack/
-usr/share/doc/preflight/github.com/jetstack/preflight/
-usr/share/doc/preflight/github.com/jetstack/preflight/LICENSE
-usr/share/doc/preflight/github.com/josharian/
-usr/share/doc/preflight/github.com/josharian/intern/
-usr/share/doc/preflight/github.com/josharian/intern/license.md
-usr/share/doc/preflight/github.com/json-iterator/
-usr/share/doc/preflight/github.com/json-iterator/go/
-usr/share/doc/preflight/github.com/json-iterator/go/LICENSE
-usr/share/doc/preflight/github.com/juju/
-usr/share/doc/preflight/github.com/juju/errors/
-usr/share/doc/preflight/github.com/juju/errors/.github/
-usr/share/doc/preflight/github.com/juju/errors/.github/workflows/
-usr/share/doc/preflight/github.com/juju/errors/.github/workflows/gotest.yml
-usr/share/doc/preflight/github.com/juju/errors/.gitignore
-usr/share/doc/preflight/github.com/juju/errors/LICENSE
-usr/share/doc/preflight/github.com/juju/errors/Makefile
-usr/share/doc/preflight/github.com/juju/errors/README.md
-usr/share/doc/preflight/github.com/juju/errors/checkers_test.go
-usr/share/doc/preflight/github.com/juju/errors/doc.go
-usr/share/doc/preflight/github.com/juju/errors/error.go
-usr/share/doc/preflight/github.com/juju/errors/error_test.go
-usr/share/doc/preflight/github.com/juju/errors/errortypes.go
-usr/share/doc/preflight/github.com/juju/errors/errortypes_test.go
-usr/share/doc/preflight/github.com/juju/errors/example_test.go
-usr/share/doc/preflight/github.com/juju/errors/functions.go
-usr/share/doc/preflight/github.com/juju/errors/functions_test.go
-usr/share/doc/preflight/github.com/juju/errors/go.mod
-usr/share/doc/preflight/github.com/juju/errors/go.sum
-usr/share/doc/preflight/github.com/juju/errors/package_test.go
-usr/share/doc/preflight/github.com/mailru/
-usr/share/doc/preflight/github.com/mailru/easyjson/
-usr/share/doc/preflight/github.com/mailru/easyjson/LICENSE
-usr/share/doc/preflight/github.com/mattn/
-usr/share/doc/preflight/github.com/mattn/go-colorable/
-usr/share/doc/preflight/github.com/mattn/go-colorable/LICENSE
-usr/share/doc/preflight/github.com/mattn/go-isatty/
-usr/share/doc/preflight/github.com/mattn/go-isatty/LICENSE
-usr/share/doc/preflight/github.com/microcosm-cc/
-usr/share/doc/preflight/github.com/microcosm-cc/bluemonday/
-usr/share/doc/preflight/github.com/microcosm-cc/bluemonday/LICENSE.md
-usr/share/doc/preflight/github.com/modern-go/
-usr/share/doc/preflight/github.com/modern-go/concurrent/
-usr/share/doc/preflight/github.com/modern-go/concurrent/LICENSE
-usr/share/doc/preflight/github.com/modern-go/reflect2/
-usr/share/doc/preflight/github.com/modern-go/reflect2/LICENSE
-usr/share/doc/preflight/github.com/munnerz/
-usr/share/doc/preflight/github.com/munnerz/goautoneg/
-usr/share/doc/preflight/github.com/munnerz/goautoneg/LICENSE
-usr/share/doc/preflight/github.com/pkg/
-usr/share/doc/preflight/github.com/pkg/errors/
-usr/share/doc/preflight/github.com/pkg/errors/LICENSE
-usr/share/doc/preflight/github.com/pmylund/
-usr/share/doc/preflight/github.com/pmylund/go-cache/
-usr/share/doc/preflight/github.com/pmylund/go-cache/LICENSE
-usr/share/doc/preflight/github.com/prometheus/
-usr/share/doc/preflight/github.com/prometheus/client_golang/
-usr/share/doc/preflight/github.com/prometheus/client_golang/prometheus/
-usr/share/doc/preflight/github.com/prometheus/client_golang/prometheus/LICENSE
-usr/share/doc/preflight/github.com/prometheus/client_golang/prometheus/NOTICE
-usr/share/doc/preflight/github.com/prometheus/client_model/
-usr/share/doc/preflight/github.com/prometheus/client_model/go/
-usr/share/doc/preflight/github.com/prometheus/client_model/go/LICENSE
-usr/share/doc/preflight/github.com/prometheus/client_model/go/NOTICE
-usr/share/doc/preflight/github.com/prometheus/common/
-usr/share/doc/preflight/github.com/prometheus/common/LICENSE
-usr/share/doc/preflight/github.com/prometheus/common/NOTICE
-usr/share/doc/preflight/github.com/prometheus/common/internal/
-usr/share/doc/preflight/github.com/prometheus/common/internal/bitbucket.org/
-usr/share/doc/preflight/github.com/prometheus/common/internal/bitbucket.org/ww/
-usr/share/doc/preflight/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/
-usr/share/doc/preflight/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
-usr/share/doc/preflight/github.com/prometheus/procfs/
-usr/share/doc/preflight/github.com/prometheus/procfs/LICENSE
-usr/share/doc/preflight/github.com/prometheus/procfs/NOTICE
-usr/share/doc/preflight/github.com/sosodev/
-usr/share/doc/preflight/github.com/sosodev/duration/
-usr/share/doc/preflight/github.com/sosodev/duration/LICENSE
-usr/share/doc/preflight/github.com/spf13/
-usr/share/doc/preflight/github.com/spf13/cobra/
-usr/share/doc/preflight/github.com/spf13/cobra/LICENSE.txt
-usr/share/doc/preflight/github.com/spf13/pflag/
-usr/share/doc/preflight/github.com/spf13/pflag/LICENSE
-usr/share/doc/preflight/github.com/stoewer/
-usr/share/doc/preflight/github.com/stoewer/go-strcase/
-usr/share/doc/preflight/github.com/stoewer/go-strcase/LICENSE
-usr/share/doc/preflight/github.com/vektah/
-usr/share/doc/preflight/github.com/vektah/gqlparser/
-usr/share/doc/preflight/github.com/vektah/gqlparser/v2/
-usr/share/doc/preflight/github.com/vektah/gqlparser/v2/LICENSE
-usr/share/doc/preflight/github.com/youmark/
-usr/share/doc/preflight/github.com/youmark/pkcs8/
-usr/share/doc/preflight/github.com/youmark/pkcs8/LICENSE
-usr/share/doc/preflight/go.uber.org/
-usr/share/doc/preflight/go.uber.org/multierr/
-usr/share/doc/preflight/go.uber.org/multierr/LICENSE.txt
-usr/share/doc/preflight/go.uber.org/zap/
-usr/share/doc/preflight/go.uber.org/zap/LICENSE.txt
-usr/share/doc/preflight/golang.org/
-usr/share/doc/preflight/golang.org/x/
-usr/share/doc/preflight/golang.org/x/crypto/
-usr/share/doc/preflight/golang.org/x/crypto/LICENSE
-usr/share/doc/preflight/golang.org/x/exp/
-usr/share/doc/preflight/golang.org/x/exp/LICENSE
-usr/share/doc/preflight/golang.org/x/net/
-usr/share/doc/preflight/golang.org/x/net/LICENSE
-usr/share/doc/preflight/golang.org/x/oauth2/
-usr/share/doc/preflight/golang.org/x/oauth2/LICENSE
-usr/share/doc/preflight/golang.org/x/sync/
-usr/share/doc/preflight/golang.org/x/sync/singleflight/
-usr/share/doc/preflight/golang.org/x/sync/singleflight/LICENSE
-usr/share/doc/preflight/golang.org/x/sys/
-usr/share/doc/preflight/golang.org/x/sys/LICENSE
-usr/share/doc/preflight/golang.org/x/term/
-usr/share/doc/preflight/golang.org/x/term/LICENSE
-usr/share/doc/preflight/golang.org/x/text/
-usr/share/doc/preflight/golang.org/x/text/LICENSE
-usr/share/doc/preflight/golang.org/x/time/
-usr/share/doc/preflight/golang.org/x/time/rate/
-usr/share/doc/preflight/golang.org/x/time/rate/LICENSE
-usr/share/doc/preflight/gomodules.xyz/
-usr/share/doc/preflight/gomodules.xyz/jsonpatch/
-usr/share/doc/preflight/gomodules.xyz/jsonpatch/v2/
-usr/share/doc/preflight/gomodules.xyz/jsonpatch/v2/LICENSE
-usr/share/doc/preflight/google.golang.org/
-usr/share/doc/preflight/google.golang.org/genproto/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/api/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/api/expr/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/api/expr/v1alpha1/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/api/expr/v1alpha1/LICENSE
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/rpc/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/rpc/status/
-usr/share/doc/preflight/google.golang.org/genproto/googleapis/rpc/status/LICENSE
-usr/share/doc/preflight/google.golang.org/protobuf/
-usr/share/doc/preflight/google.golang.org/protobuf/LICENSE
-usr/share/doc/preflight/gopkg.in/
-usr/share/doc/preflight/gopkg.in/inf.v0/
-usr/share/doc/preflight/gopkg.in/inf.v0/LICENSE
-usr/share/doc/preflight/gopkg.in/ini.v1/
-usr/share/doc/preflight/gopkg.in/ini.v1/LICENSE
-usr/share/doc/preflight/gopkg.in/yaml.v2/
-usr/share/doc/preflight/gopkg.in/yaml.v2/LICENSE
-usr/share/doc/preflight/gopkg.in/yaml.v2/NOTICE
-usr/share/doc/preflight/gopkg.in/yaml.v3/
-usr/share/doc/preflight/gopkg.in/yaml.v3/LICENSE
-usr/share/doc/preflight/gopkg.in/yaml.v3/NOTICE
-usr/share/doc/preflight/k8s.io/
-usr/share/doc/preflight/k8s.io/api/
-usr/share/doc/preflight/k8s.io/api/LICENSE
-usr/share/doc/preflight/k8s.io/apiextensions-apiserver/
-usr/share/doc/preflight/k8s.io/apiextensions-apiserver/pkg/
-usr/share/doc/preflight/k8s.io/apiextensions-apiserver/pkg/LICENSE
-usr/share/doc/preflight/k8s.io/apimachinery/
-usr/share/doc/preflight/k8s.io/apimachinery/pkg/
-usr/share/doc/preflight/k8s.io/apimachinery/pkg/LICENSE
-usr/share/doc/preflight/k8s.io/apimachinery/third_party/
-usr/share/doc/preflight/k8s.io/apimachinery/third_party/forked/
-usr/share/doc/preflight/k8s.io/apimachinery/third_party/forked/golang/
-usr/share/doc/preflight/k8s.io/apimachinery/third_party/forked/golang/LICENSE
-usr/share/doc/preflight/k8s.io/apiserver/
-usr/share/doc/preflight/k8s.io/apiserver/pkg/
-usr/share/doc/preflight/k8s.io/apiserver/pkg/LICENSE
-usr/share/doc/preflight/k8s.io/client-go/
-usr/share/doc/preflight/k8s.io/client-go/LICENSE
-usr/share/doc/preflight/k8s.io/component-base/
-usr/share/doc/preflight/k8s.io/component-base/LICENSE
-usr/share/doc/preflight/k8s.io/klog/
-usr/share/doc/preflight/k8s.io/klog/v2/
-usr/share/doc/preflight/k8s.io/klog/v2/LICENSE
-usr/share/doc/preflight/k8s.io/kube-openapi/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/LICENSE
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/internal/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/internal/third_party/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/LICENSE
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/errors/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/errors/LICENSE
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/spec/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/spec/LICENSE
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/strfmt/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/strfmt/LICENSE
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/validate/
-usr/share/doc/preflight/k8s.io/kube-openapi/pkg/validation/validate/LICENSE
-usr/share/doc/preflight/k8s.io/utils/
-usr/share/doc/preflight/k8s.io/utils/LICENSE
-usr/share/doc/preflight/k8s.io/utils/internal/
-usr/share/doc/preflight/k8s.io/utils/internal/third_party/
-usr/share/doc/preflight/k8s.io/utils/internal/third_party/forked/
-usr/share/doc/preflight/k8s.io/utils/internal/third_party/forked/golang/
-usr/share/doc/preflight/k8s.io/utils/internal/third_party/forked/golang/net/
-usr/share/doc/preflight/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE
-usr/share/doc/preflight/sigs.k8s.io/
-usr/share/doc/preflight/sigs.k8s.io/controller-runtime/
-usr/share/doc/preflight/sigs.k8s.io/controller-runtime/pkg/
-usr/share/doc/preflight/sigs.k8s.io/controller-runtime/pkg/LICENSE
-usr/share/doc/preflight/sigs.k8s.io/json/
-usr/share/doc/preflight/sigs.k8s.io/json/LICENSE
-usr/share/doc/preflight/sigs.k8s.io/structured-merge-diff/
-usr/share/doc/preflight/sigs.k8s.io/structured-merge-diff/v4/
-usr/share/doc/preflight/sigs.k8s.io/structured-merge-diff/v4/LICENSE
-usr/share/doc/preflight/sigs.k8s.io/yaml/
-usr/share/doc/preflight/sigs.k8s.io/yaml/LICENSE
-usr/share/doc/preflight/sigs.k8s.io/yaml/goyaml.v2/
-usr/share/doc/preflight/sigs.k8s.io/yaml/goyaml.v2/LICENSE
-usr/share/doc/preflight/sigs.k8s.io/yaml/goyaml.v2/NOTICE
-usr/share/doc/tzdata/
-usr/share/doc/tzdata/README.Debian
-usr/share/doc/tzdata/changelog.Debian.gz
-usr/share/doc/tzdata/changelog.gz
-usr/share/doc/tzdata/copyright
-usr/share/info/
-usr/share/lintian/
-usr/share/lintian/overrides/
-usr/share/lintian/overrides/base-files
-usr/share/lintian/overrides/tzdata
-usr/share/man/
-usr/share/misc/
 usr/share/zoneinfo/
 usr/share/zoneinfo/Africa/
 usr/share/zoneinfo/Africa/Abidjan
@@ -1071,70 +664,6 @@
 usr/share/zoneinfo/Zulu
 usr/share/zoneinfo/iso3166.tab
 usr/share/zoneinfo/leap-seconds.list
-usr/share/zoneinfo/leapseconds
-usr/share/zoneinfo/localtime
-usr/share/zoneinfo/posix/
-usr/share/zoneinfo/posix/Africa
-usr/share/zoneinfo/posix/America
-usr/share/zoneinfo/posix/Antarctica
-usr/share/zoneinfo/posix/Arctic
-usr/share/zoneinfo/posix/Asia
-usr/share/zoneinfo/posix/Atlantic
-usr/share/zoneinfo/posix/Australia
-usr/share/zoneinfo/posix/Brazil
-usr/share/zoneinfo/posix/CET
-usr/share/zoneinfo/posix/CST6CDT
-usr/share/zoneinfo/posix/Canada
-usr/share/zoneinfo/posix/Chile
-usr/share/zoneinfo/posix/Cuba
-usr/share/zoneinfo/posix/EET
-usr/share/zoneinfo/posix/EST
-usr/share/zoneinfo/posix/EST5EDT
-usr/share/zoneinfo/posix/Egypt
-usr/share/zoneinfo/posix/Eire
-usr/share/zoneinfo/posix/Etc
-usr/share/zoneinfo/posix/Europe
-usr/share/zoneinfo/posix/Factory
-usr/share/zoneinfo/posix/GB
-usr/share/zoneinfo/posix/GB-Eire
-usr/share/zoneinfo/posix/GMT
-usr/share/zoneinfo/posix/GMT+0
-usr/share/zoneinfo/posix/GMT-0
-usr/share/zoneinfo/posix/GMT0
-usr/share/zoneinfo/posix/Greenwich
-usr/share/zoneinfo/posix/HST
-usr/share/zoneinfo/posix/Hongkong
-usr/share/zoneinfo/posix/Iceland
-usr/share/zoneinfo/posix/Indian
-usr/share/zoneinfo/posix/Iran
-usr/share/zoneinfo/posix/Israel
-usr/share/zoneinfo/posix/Jamaica
-usr/share/zoneinfo/posix/Japan
-usr/share/zoneinfo/posix/Kwajalein
-usr/share/zoneinfo/posix/Libya
-usr/share/zoneinfo/posix/MET
-usr/share/zoneinfo/posix/MST
-usr/share/zoneinfo/posix/MST7MDT
-usr/share/zoneinfo/posix/Mexico
-usr/share/zoneinfo/posix/NZ
-usr/share/zoneinfo/posix/NZ-CHAT
-usr/share/zoneinfo/posix/Navajo
-usr/share/zoneinfo/posix/PRC
-usr/share/zoneinfo/posix/PST8PDT
-usr/share/zoneinfo/posix/Pacific
-usr/share/zoneinfo/posix/Poland
-usr/share/zoneinfo/posix/Portugal
-usr/share/zoneinfo/posix/ROC
-usr/share/zoneinfo/posix/ROK
-usr/share/zoneinfo/posix/Singapore
-usr/share/zoneinfo/posix/Turkey
-usr/share/zoneinfo/posix/UCT
-usr/share/zoneinfo/posix/US
-usr/share/zoneinfo/posix/UTC
-usr/share/zoneinfo/posix/Universal
-usr/share/zoneinfo/posix/W-SU
-usr/share/zoneinfo/posix/WET
-usr/share/zoneinfo/posix/Zulu
 usr/share/zoneinfo/posixrules
 usr/share/zoneinfo/right/
 usr/share/zoneinfo/right/Africa/
@@ -1754,26 +1283,11 @@
 usr/share/zoneinfo/right/W-SU
 usr/share/zoneinfo/right/WET
 usr/share/zoneinfo/right/Zulu
-usr/share/zoneinfo/tzdata.zi
 usr/share/zoneinfo/zone.tab
 usr/share/zoneinfo/zone1970.tab
-usr/src/
 var/
-var/backups/
 var/cache/
-var/lib/
-var/lib/dpkg/
-var/lib/dpkg/status.d/
-var/lib/dpkg/status.d/base-files
-var/lib/dpkg/status.d/base-files.md5sums
-var/lib/dpkg/status.d/netbase
-var/lib/dpkg/status.d/netbase.md5sums
-var/lib/dpkg/status.d/tzdata
-var/lib/dpkg/status.d/tzdata.md5sums
-var/lib/misc/
-var/local/
-var/lock/
-var/log/
+var/cache/apk/
+var/cache/misc/
 var/run/
-var/spool/
-var/tmp/
+var/run/ko/

Notes:

  • 🚨 MAYBE BREAKING 🚨 I propose to stop pushing the image quay.io/jetstack/preflight, and to have quay.io/jetstack/venafi-agent as the only image we push since that's the image that gets mirrored. The old Helm chart deploy/charts/jetstack-secure can be updated to use quay.io/jetstack/venafi-agent if needed.

Tests Performed

$ make release VERSION=v0.0.1-dev oci_preflight_image_name=ttl.sh/maelvls/venafi-agent helm_chart_repo_base=oci://ttl.sh/maelvls/charts
RELEASE_OCI_preflight_IMAGE=ttl.sh/maelvls/venafi-agent
RELEASE_OCI_preflight_TAG=v1.0.0-41-g8f1697a39afca3-dirty
RELEASE_HELM_CHART_NAME=venafi-kubernetes-agent
RELEASE_HELM_CHART_VERSION=1.0.0-41-g8f1697a39afca3-dirty
RELEASE_HELM_CHART_TAR=_bin/scratch/image/venafi-kubernetes-agent-1.0.0-41-g8f1697a39afca3-dirty.tgz
Release complete!

$ helm install venafi-kubernetes-agent oci://ttl.sh/maelvls/charts/venafi-kubernetes-agent --version 0.0.1-dev

@maelvls maelvls changed the title https://github.com/jetstack/jetstack-secure/pull/555 🔥 Migrating to Makefile Modules ALL AT ONCE 🔥 Aug 13, 2024
@maelvls
Copy link
Member Author

maelvls commented Aug 13, 2024

I will continue this on Monday, Aug 19th if that's OK. I really enjoy working with Makefile Modules.

Comment on lines -11 to +12
fmt.Println("Preflight version: ", version.PreflightVersion, version.Platform)
fmt.Println("Preflight version: ", version.PreflightVersion, runtime.GOOS+"/"+runtime.GOARCH)
Copy link
Member Author

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.

@maelvls maelvls marked this pull request as draft August 19, 2024 13:01
@maelvls maelvls force-pushed the step1-makefile-modules branch 3 times, most recently from fdf4cac to ab0f53f Compare August 19, 2024 13:24
maelvls added a commit that referenced this pull request Aug 19, 2024
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
maelvls added a commit that referenced this pull request Aug 20, 2024
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
maelvls added a commit that referenced this pull request Aug 20, 2024
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
maelvls added a commit that referenced this pull request Aug 20, 2024
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
maelvls added a commit that referenced this pull request Aug 20, 2024
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
maelvls added a commit that referenced this pull request Aug 20, 2024
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
maelvls added a commit that referenced this pull request Aug 20, 2024
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
Copy link
Contributor

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))
}
Copy link
Contributor

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.

@maelvls
Copy link
Member Author

maelvls commented Sep 12, 2024

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?

@maelvls maelvls force-pushed the step1-makefile-modules branch from ab0f53f to 2373a00 Compare September 26, 2024 13:35
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).
@maelvls maelvls force-pushed the step1-makefile-modules branch from 2373a00 to cce1879 Compare September 26, 2024 13:37
@@ -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.
Copy link
Member Author

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

@maelvls maelvls force-pushed the step1-makefile-modules branch from 6b3b365 to 3aa2fe8 Compare September 30, 2024 10:25
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
@maelvls maelvls force-pushed the step1-makefile-modules branch from 3aa2fe8 to 3c98fb5 Compare September 30, 2024 10:29
inteon and others added 6 commits September 30, 2024 12:56
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>
@inteon inteon force-pushed the step1-makefile-modules branch from 775fa69 to 83a24f1 Compare September 30, 2024 12:05
make/02_mod.mk Outdated Show resolved Hide resolved
maelvls and others added 2 commits September 30, 2024 14:28
…pending

Co-authored-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@maelvls maelvls force-pushed the step1-makefile-modules branch from a16d1d3 to f20e5fb Compare September 30, 2024 12:28
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@inteon inteon marked this pull request as ready for review September 30, 2024 13:19
@inteon
Copy link
Contributor

inteon commented Sep 30, 2024

@maelvls I think the PR is ready to be merged.
In follow-up PRs, we can:

  • rename "github.com/jetstack/preflight" to "github.com/jetstack/jetstack-secure" and "preflight" to "agent"
  • remove old unused files
  • fix linter errors
  • add e2e test

@maelvls
Copy link
Member Author

maelvls commented Sep 30, 2024

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.
@maelvls maelvls merged commit 8d559ad into master Sep 30, 2024
2 checks passed
@maelvls maelvls deleted the step1-makefile-modules branch September 30, 2024 14:08
@inteon inteon mentioned this pull request Sep 30, 2024
# -- 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"
Copy link
Member

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.

Copy link
Member

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:

Copy link
Member Author

@maelvls maelvls Oct 10, 2024

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 this I created a ticket: https://venafi.atlassian.net/browse/VC-36700

Copy link
Contributor

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.

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.

3 participants