-
Notifications
You must be signed in to change notification settings - Fork 106
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
Pass additional information to downward API (k8s version, kc version, k8s g/v) #846
Conversation
0483769
to
e49b956
Compare
e5dd634
to
48c5c5c
Compare
Signed-off-by: Neil Hickey <[email protected]>
9180374
to
d91178f
Compare
Signed-off-by: Neil Hickey <[email protected]>
d91178f
to
084e920
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.
I have some comments and questions but i wouldn't argue with merging this as-is. we can catch up real quick tomorrow AM about whether it's worth addressing any of these in this iteration.
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.
Added some comments
pkg/componentInfo/component_info.go
Outdated
} | ||
|
||
// NewComponentInfo returns a ComponentInfo | ||
func NewComponentInfo(coreClient kubernetes.Interface, clusterAccess *kubeconfig.Kubeconfig, kappControllerVersion string) *ComponentInfo { |
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.
The clusterAccess
parameter could also be an interface.
pkg/template/values.go
Outdated
coreClient kubernetes.Interface | ||
appContext AppContext | ||
coreClient kubernetes.Interface | ||
additionalDownwardAPIValues AdditionalDownwardAPIValues | ||
} | ||
|
||
func (t Values) AsPaths(dirPath string) ([]string, func(), error) { |
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.
Just a comment about this function and maybe not be actionable in this PR.
This signature feels strange, the main reason for that is the return of that func()
that you need to read the code to understand that it is the removal of the created folders.
It is the responsibility of the creator of dirPath
to delete that folder, while this function is only responsible for creating the folders it needs inside the dirPath
.
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.
Not going to action on this one in this PR
4714056
to
69e9c3b
Compare
- renaming some things - moved away from a values factory back to values struct - minor fixups Signed-off-by: Neil Hickey <[email protected]>
69e9c3b
to
e2dc9c7
Compare
v.Pre = semver.PRVersion{} | ||
v.Build = semver.BuildMeta{} |
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.
should this move into ComponentInfo? seems its more related to version parsing rather than package matching
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.
The constraint matching is specific to packageinstall (i.e the choice to drop the pre and build fields of KC version), so I think it makes more sense here. The kapp-controller version should always be as it is in the cluster, regardless of how / why we manipulate it in kapp-controller.
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 understand the point that it's not entirely semantically in-scope for the reader of PackageInstall to know about the effects of resetting the members of the version, v
struct. However it's less obvious to me where to move that logic, and i think it'll be a similar number of lines of code, just maybe a little faster to read packageinstall.go until your concern is this logic specifically. To the extent the concern is just readability, it feels like a refactor or an explanatory comment would have similar benefits.
Signed-off-by: Neil Hickey <[email protected]>
ba3e515
to
46cacc6
Compare
- Add template() test to validate memoizing works Signed-off-by: Neil Hickey <[email protected]>
46cacc6
to
7f0abc2
Compare
- memoizing within packageinstall didnt actually memoize - memoizing within componentinfo was too aggressive so controller would not receive updated version after cluster is updated
2e50459
to
43408dc
Compare
43408dc
to
5969595
Compare
Signed-off-by: Neil Hickey [email protected]
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #781
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
Review Checklist:
change
a link to that PR
Additional documentation e.g., Proposal, usage docs, etc.: