Skip to content

Commit

Permalink
Ensurepackage deprecated: => move to EnsurePackageWith
Browse files Browse the repository at this point in the history
Signed-off-by: Troy Connor <[email protected]>
  • Loading branch information
troy0820 committed Aug 10, 2023
1 parent ea66afe commit 2619064
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,18 @@ func kustomize(args ...string) shx.PreparedCommand {

// Ensure yq is installed.
func EnsureYq() {
mgx.Must(pkg.EnsurePackage("github.com/mikefarah/yq/v4", "", ""))
mgx.Must(pkg.EnsurePackageWith(pkg.EnsurePackageOptions{
Name: "github.com/mikefarah/yq/v4",
}))
}

// Ensure ginkgo is installed.
func EnsureGinkgo() {
mgx.Must(pkg.EnsurePackage("github.com/onsi/ginkgo/ginkgo", "1.16.5", "version"))
mgx.Must(pkg.EnsurePackageWith(pkg.EnsurePackageOptions{
Name: "github.com/onsi/ginkgo/ginkgo",
DefaultVersion: "1.16.5",
VersionCommand: "version",
}))
}

// Ensure kustomize is installed.
Expand All @@ -664,7 +670,11 @@ func EnsureKustomize() {

// Ensure controller-gen is installed.
func EnsureControllerGen() {
mgx.Must(pkg.EnsurePackage("sigs.k8s.io/controller-tools/cmd/controller-gen", "v0.8.0", "--version"))
mgx.Must(pkg.EnsurePackageWith(pkg.EnsurePackageOptions{
Name: "sigs.k8s.io/controller-tools/cmd/controller-gen",
DefaultVersion: "v0.12.1",
VersionCommand: "--version",
}))
}

func pwd() string {
Expand Down

0 comments on commit 2619064

Please sign in to comment.