-
Notifications
You must be signed in to change notification settings - Fork 37
Sync additional changes from Porch #747
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
Conversation
go/fn/kptfile/kptfile.go
Outdated
| ) | ||
|
|
||
| // Kptfile provides an API to manipulate the Kptfile of a kpt package | ||
| type Kptfile struct { |
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 think we should try to move to a clearer name here. The mix of KptFile across the 2 repos is confusing.
I was thinking maybe something like:
PackageMetadata
It clarifies that the sdk works with the KptFile metadata only. (No "file" operations) and ties in with the kpt/krm package idea.
Would this be a major breaking change? I think it would be worth it to remove any confusion for end users.
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 agree, but I think the name should indicate that this is just a wrapper around KubeObject with Kptfile specific methods.
Would KptfileKubeObject be too long?
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 guess so, on the KubeObject Wrapper. Ye the name is applicable to the whole pkg really so not sure. go/fn/kptfileko/
Whatever make sense to the reader really.
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 know it's a pretty blunt metric but do we have any test coverage for the new code?
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 added some unit tests, is 75.1% good enough for now?
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.
Absolutely.
go/fn/kptfile/pipeline.go
Outdated
| // If the function already exists, it is updated. If it doesn't exist, it is added at the specified position. | ||
| // If insertPosition is negative, the insert position is counted backwards from the end of the list | ||
| // (i.e. -1 will append to the list). | ||
| func (kf *Kptfile) UpsertPipelineFunctions(fns []kptfileapi.Function, fieldName string, insertPosition int) 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.
Nice. I needed this a while back to insert a fn at a specific point in the pipeline. Thanks for adding it.
Co-authored-by: kispaljr <istvan.kispal@nokia.com> Co-authored-by: dgyorgy-nokia <daniel.gyorgy@nokia.com> Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
135446c to
d1eccc3
Compare
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
d1eccc3 to
dff322b
Compare
|
Might have missed a sign-off on last commit @mozesl-nokia |
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
baec26b to
02a4737
Compare
Some additional changes we have made to the SDK in out Porch fork. Most of these changes will be used by the async render pipeline in Porch, so it would be nice to get them in ahead of time.
Please note some API changes, such as the renaming of
fn.NewKptfileFromPackagetokptfile.NewFromPackageor that in theKubeObjectwrappingKptfilestruct, the innerKubeObjectis now anonymous. (We can discuss if these should be reverted)Co-developed by @kispaljr and @dgyorgy-nokia