-
Notifications
You must be signed in to change notification settings - Fork 194
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 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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!
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.
db059bf
to
1a89c64
Compare
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 small tweaks, otherwise looks good
s = &state.State{RegistryInfo: types.RegistryInfo{ | ||
Address: fmt.Sprintf("%s:%d", tt.svc.Spec.ClusterIP, tt.svc.Spec.Ports[0].Port), | ||
}} | ||
} |
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.
I have some mixed feelings on how I implemented this part, where I override the test endpoint of the zarf docker registry, the tests do now pass... but Please let me know if you want me to rework it
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.
thanks github for not saying that this wasn't visible to anyone else...
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 cleaner solution could be to move up setupRegistry
above the table tests, then add a field registryAddress
to admissionTest
. Then we can avoid the if statement, and each entry could own it's address
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.
I intend to dig into this more intentionally asap - I am curious if this pattern tests the logic accordingly or is working-around it - but I need to step through the code. Will report back.
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.
Appreciate the patience. Core functionality looks great but I'd like to revisit this test so as to have the purpose of the svc
object in the admissionTest
appropriately testing our logic for internal service lookup.
Spent some time mapping these changes to the test on main
and do believe this is working-around the issue and not testing service discovery logic.
Stepping through the test -> NewOCIRepositoryMutationHook -> mutateOCIRepo -> GetServiceInfoFromRegistryAddress -> serviceInfoFromNodePortURL -> content
The workaround currently pre-sets the state to the internal IP:port - which isn't a valid state. So it fails in the early detection stages.
I'd like to see registry still set as the nodeport url 127.0.0.1:31999
and then identifying the internal service:port as intended. The ReplacePatchOperation should then be expecting the original 127.0.0.1:31999
.
All of that said - it probably puts you back in the original spot. I can help run through the debugging more but do believe some of the root of the issue is that localhost
was used in some of the tests for not mutating andserviceInfoFromNodePortURL()
cannot actually handle that as expected (maybe a bug - maybe expected - needs refinement).
Appreciate your bearing with us as we get better about responding to these PR's.
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.
I like the direction - appreciate your patience. Planning to step through the testing shortly but wanted to pass on some thoughts.
s = &state.State{RegistryInfo: types.RegistryInfo{ | ||
Address: fmt.Sprintf("%s:%d", tt.svc.Spec.ClusterIP, tt.svc.Spec.Ports[0].Port), | ||
}} | ||
} |
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.
I intend to dig into this more intentionally asap - I am curious if this pattern tests the logic accordingly or is working-around it - but I need to step through the code. Will report back.
1cd6678
to
8a62fe8
Compare
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.
great intent - want to see the testing provenance align otherwise looks great. Tough edge to solve.
s = &state.State{RegistryInfo: types.RegistryInfo{ | ||
Address: fmt.Sprintf("%s:%d", tt.svc.Spec.ClusterIP, tt.svc.Spec.Ports[0].Port), | ||
}} | ||
} |
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.
Appreciate the patience. Core functionality looks great but I'd like to revisit this test so as to have the purpose of the svc
object in the admissionTest
appropriately testing our logic for internal service lookup.
Spent some time mapping these changes to the test on main
and do believe this is working-around the issue and not testing service discovery logic.
Stepping through the test -> NewOCIRepositoryMutationHook -> mutateOCIRepo -> GetServiceInfoFromRegistryAddress -> serviceInfoFromNodePortURL -> content
The workaround currently pre-sets the state to the internal IP:port - which isn't a valid state. So it fails in the early detection stages.
I'd like to see registry still set as the nodeport url 127.0.0.1:31999
and then identifying the internal service:port as intended. The ReplacePatchOperation should then be expecting the original 127.0.0.1:31999
.
All of that said - it probably puts you back in the original spot. I can help run through the debugging more but do believe some of the root of the issue is that localhost
was used in some of the tests for not mutating andserviceInfoFromNodePortURL()
cannot actually handle that as expected (maybe a bug - maybe expected - needs refinement).
Appreciate your bearing with us as we get better about responding to these PR's.
Signed-off-by: Allen Conlon <[email protected]>
Signed-off-by: Allen Conlon <[email protected]>
Signed-off-by: Allen Conlon <[email protected]>
Signed-off-by: Allen Conlon <[email protected]>
Signed-off-by: Brandt Keller <[email protected]>
Signed-off-by: Brandt Keller <[email protected]>
Signed-off-by: Allen Conlon <[email protected]>
Signed-off-by: Allen Conlon <[email protected]>
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.
LGTM, only thing that's a bit awkward is that the example won't work if someone tries it on the latest release of Zarf. No changes requested, but I might wait until we're a bit closer to release (July 25th) to merge
Ok, that works from me, Thanks @AustinAbro321 |
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.
lgtm - we did just merge the migration of the agent orchestration from manifests to helm chart - so this will require a quick conflict resolve.
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