-
Notifications
You must be signed in to change notification settings - Fork 191
feat: add checking in remote repo if manifest is a chart #3811
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for zarf-docs canceled.
|
Hey team, I believe that this PR is in a better state to be reviewed. I have fixed the unit tests to maintained backwards-compatibility with the current logic, e.i. if A) it can not reach the zarf registry, or B) if the media type is not of type Please let me know if there are any changes you would like to make Edit: I will be also updating the docs and what not, so well the code stuff is ready for review the UX/docs needs to be updated |
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.
This is an excellent start, thank you for doing research and driving this forward!
Codecov ReportAttention: Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
No problem at all! |
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.
A few nits, and some test cleanup to be done. Overall changes are looking good.
@@ -35,6 +35,111 @@ func createFluxOCIRepoAdmissionRequest(t *testing.T, op v1.Operation, fluxOCIRep | |||
} | |||
} | |||
|
|||
func TestFluxOCIHelmMutationWebhook(t *testing.T) { |
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.
Instead of a new function here we should move these into the existing function. We actually want the registry to be setup for the other test as currently the test takes an extra 10 seconds so it can timeout
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.
Tbh, the separate function was mostly so that I can focus my tests on the function I was creating, so I can merge that back into one function without too much issue
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.
So I update the tests into one, had to change some of the existing tests to match the new url.... but I'm having issues with the test that use a custom svc
such as here:
zarf/src/internal/agent/hooks/flux-ocirepo_test.go
Lines 317 to 336 in 420c4c9
svc: &corev1.Service{ | |
TypeMeta: metav1.TypeMeta{ | |
APIVersion: corev1.SchemeGroupVersion.String(), | |
Kind: "Service", | |
}, | |
ObjectMeta: metav1.ObjectMeta{ | |
Name: "zarf-docker-registry", | |
Namespace: "zarf", | |
}, | |
Spec: corev1.ServiceSpec{ | |
Type: corev1.ServiceTypeNodePort, | |
Ports: []corev1.ServicePort{ | |
{ | |
NodePort: int32(31999), | |
Port: 5000, | |
}, | |
}, | |
ClusterIP: "10.11.12.13", | |
}, | |
}, |
Any input on how to update the tests would be great!
9bac17c
to
db059bf
Compare
Signed-off-by: Allen Conlon <[email protected]>
Description
Makes call to zarf registry when trying to mutate
ocirepo
resource, and checks if the manifest is a helm chartRelated Issue
Fixes #3435
Checklist before merging