Conversation
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #1332 +/- ##
==========================================
- Coverage 67.34% 67.17% -0.17%
==========================================
Files 133 138 +5
Lines 8210 8503 +293
==========================================
+ Hits 5529 5712 +183
- Misses 2231 2343 +112
+ Partials 450 448 -2
|
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
|
Still to do:
Before I proceed further, I'd like to confirm that we indeed want to add these additional resources ^^ (Slack thread) Maintainers, please opine! |
e735f8a to
16515e9
Compare
|
|
||
| e2e: | ||
| $(GOCMD) test --timeout=30m -v ./test/... | ||
| $(GOCMD) test --timeout=30m -failfast -v ./test/... |
There was a problem hiding this comment.
We don't have to add this... but I like it
Signed-off-by: Natalie Arellano <narellano@vmware.com>
16515e9 to
160ce19
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
98befe4 to
dbaa66d
Compare
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Natalie Arellano <narellano@vmware.com>
|
|
||
| func TestParseURL(t *testing.T) { | ||
| spec.Focus(t, "Test Parse Git URL", testParseURL) | ||
| spec.Focus(t, "Test Parse Git URL", testParseURL) // TODO: should this be .Focus? |
There was a problem hiding this comment.
Is this a forgotten .Focus?
There was a problem hiding this comment.
I suspect that it works because its the only thing in the function but it probably should not be a focus
| }, | ||
| Spec: buildapi.ExtensionSpec{ | ||
| ImageSource: corev1alpha1.ImageSource{ | ||
| Image: "natalieparellano/sample-extension", // FIXME |
There was a problem hiding this comment.
Perhaps we could build the sample extension and push it along with all the other images from hack/local.sh or equivalent?
There was a problem hiding this comment.
that feels slightly odd to me since we don't do that with buildpacks. maybe we can put a sample extension in the projects ghcr repo or something
There was a problem hiding this comment.
I would prefer to use a properly released (read: maintained) extension, does CNB have a sample one? What about paketo or other well known buildpack authors?
| //require.True(t, fakeTracker.IsTrackingKind( | ||
| // kreconciler.KeyForObject(extension).GroupKind, | ||
| // builder.NamespacedName())) | ||
| //require.True(t, fakeTracker.IsTrackingKind( | ||
| // kreconciler.KeyForObject(clusterExtension).GroupKind, | ||
| // builder.NamespacedName())) |
There was a problem hiding this comment.
I have no idea what this is testing or why it's failing. Maintainers, please help!
There was a problem hiding this comment.
The tracker is a thing we use to force reconciliation of related objects. The usage is that it is first added as an event handler to a specific informer, and then during each reconcile loop we can decide to register individual things to track. Then when these things get modified (by the user or other controllers), it triggers a reconcile loop on a separate reconciler.
To give an example, the Builder reconciler sets up a tracker for all Buildpack objects. This is so that if a buildpack was changed (i.e. user updated the .spec.image field), we want to force a reconciliation of any builders that uses it:
kpack/pkg/reconciler/builder/builder.go
Lines 97 to 101 in b14fce9
Once the tracker is set to handle events for all Buildpacks, it can register individual objects (in this case a ClusterStore) for tracking
kpack/pkg/reconciler/builder/builder.go
Lines 175 to 184 in b14fce9
Or track all group kind (in this case Buildpacks) in a namespace
kpack/pkg/reconciler/builder/builder.go
Lines 192 to 195 in b14fce9
The test injects a fake tracker into the reconciler and asserts that it's setting up the expected namespaced-objects/group-version-kind to track.
There was a problem hiding this comment.
So you'll probably have to setup the tracker in the builder reconciler to also watch for changes to the [Cluster]Extension resource. If you don't, the builder won't be reconciled if a new extension is added, or if an existing extension changes.
| //require.True(t, fakeTracker.IsTrackingKind( | ||
| // kreconciler.KeyForObject(clusterExtension).GroupKind, builder.NamespacedName())) |
There was a problem hiding this comment.
I have no idea what this is testing or why it's failing. Maintainers, please help!
There was a problem hiding this comment.
Same as #1332 (comment), with the only difference being that it only watches for ClusterExtensions instead of both Extension and ClusterExtension
Signed-off-by: Natalie Arellano <narellano@vmware.com>
| return nil | ||
| } | ||
|
|
||
| if len(builder.ExtensionMetadata()) > 0 { |
There was a problem hiding this comment.
Without this, if extensions are used to switch the runtime base image, the image will never stop building because the reconciler always sees a stack change. Future versions of kpack should improve this by (somehow) tying the image back to a "stack" that includes the runtime base image that was switched to.
Signed-off-by: Natalie Arellano <narellano@vmware.com>
|
The integration tests won't run in CI until this is merged, but here is my local output if that's helpful: |
| container.SecurityContext.RunAsUser = intPointer(0) | ||
| container.SecurityContext.RunAsGroup = intPointer(0) | ||
| container.SecurityContext.RunAsNonRoot = boolPointer(false) | ||
| container.SecurityContext.Capabilities = &corev1.Capabilities{Add: []corev1.Capability{"SETGID", "SETUID"}} |
There was a problem hiding this comment.
Discussed in 10/31 Working Group, run as root is unnecessary if all we're doing is switching the runtime base. We should make this configurable by the end user (and default to the most secure setting).
|
@tomkennedy513 @chenbh did you have a chance to go through all the changes? If so I can pick this up again |
There are still some open TODOs but this is ready for detailed feedback
Summary of larger changes
Unresolved