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

rebase rule and e2e tests for pkgrs with identical pkgs #657

Merged
merged 25 commits into from
Jun 8, 2022

Conversation

joe-kimmel-vmw
Copy link
Contributor

@joe-kimmel-vmw joe-kimmel-vmw commented Apr 28, 2022

hack/dev-deploy.sh Outdated Show resolved Hide resolved
@joe-kimmel-vmw joe-kimmel-vmw changed the title wip - tentative rebase rule and first e2e test for pkgrs with identical rebase rule and e2e tests for pkgrs with identical pkgs Apr 30, 2022
@joe-kimmel-vmw joe-kimmel-vmw marked this pull request as ready for review April 30, 2022 01:18
pkg/pkgrepository/app_deploy.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_deploy.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_deploy.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_deploy.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_deploy.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_deploy.go Outdated Show resolved Hide resolved
Comment on lines 668 to 1022
"%s%s%s",
fmt.Sprintf(pkgrPreamble, 3),
fmt.Sprintf(pkgTemplate, "shirt-mgr.co.uk", "5.5.5"),
strings.Replace(fmt.Sprintf(pkgTemplate, "contooor.co.uk", "0.22.0"), "k8slt/kctrl-example-pkg:v1.0.0", "k8slt/some-other-image:latest", -1))
Copy link
Contributor

Choose a reason for hiding this comment

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

string building throughout tests seem really brittle and quite hard to piece together. lets come up with a different way to adjust inputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

happy to talk about it but I didn't immediately see other options I thought were better. it's all compromises, imo, between hardcoding each one fully redundantly on the one end and pumping test artifacts through ytt on the other end.

test/e2e/kappcontroller/package_repo_test.go Outdated Show resolved Hide resolved
test/e2e/kappcontroller/package_repo_test.go Outdated Show resolved Hide resolved
test/e2e/kappcontroller/package_repo_test.go Show resolved Hide resolved
@joe-kimmel-vmw joe-kimmel-vmw force-pushed the pkgrs-with-identical-packages branch 3 times, most recently from 1adb883 to 3566712 Compare May 13, 2022 20:39
@joe-kimmel-vmw joe-kimmel-vmw force-pushed the pkgrs-with-identical-packages branch 6 times, most recently from c16663c to bffb61e Compare May 31, 2022 19:53
pkgr templating applies a rebase rule that inserts a noop
annotation on a package coming from a PKGR in cases where
a package with identical name and contents is already provided
by a different repo.

- revision annotation allows changes to the package yaml without
  changing the version
- packages that are not identical will still fail to reconcile
cli/test/e2e/package_repository_test.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
pkg/pkgrepository/app_template.go Outdated Show resolved Hide resolved
test/e2e/kappcontroller/helm_test.go Outdated Show resolved Hide resolved
pkg/pkgrepository/package_repo_app.go Outdated Show resolved Hide resolved
Comment on lines 64 to 74
fmt.Println(kubectl.Run([]string{"get", "pkg", "pkg.test.carvel.dev.3.0.0-rc.1", "-oyaml"}))

for i := 1; i < 5; i++ {
out = kubectl.Run([]string{"get", "packagerepository", pkgrName})
fmt.Println(out)
if strings.Contains(out, "failed") {
fmt.Println(kubectl.Run([]string{"get", "packagerepository", pkgrName, "-oyaml"}))
}
require.NotContains(t, out, "failed")
time.Sleep(time.Duration(i) * time.Second)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

note: no need for this.

@joe-kimmel-vmw
Copy link
Contributor Author

@cppforlife cppforlife merged commit d6c7d28 into develop Jun 8, 2022
@joe-kimmel-vmw joe-kimmel-vmw deleted the pkgrs-with-identical-packages branch June 17, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants