Skip to content
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

feat: refactor set-image with go sdk #904

Merged
merged 48 commits into from Aug 30, 2022
Merged

Conversation

zyy98
Copy link
Contributor

@zyy98 zyy98 commented Aug 12, 2022

To fix the issues kptdev/kpt#3444
Start by refactoring set-image functions using go-sdk package.

Additional changes:
Allow both digest and tag set in input.
To test Runner interface, replace unit tests with end-to-end tests.

@zyy98 zyy98 requested a review from yuwenma August 15, 2022 18:05
Copy link
Contributor

@yuwenma yuwenma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't checked the unittests. Two major areas to consider:

  1. fn.Result seems to be redundant, can you either use existing functions (e.g. ConfigObjectResult) or develop something new in the sdk?
  2. it seems that there are some duplicated code, e.g. validateInput, shall we cleanup them? FYI, to keep additionalFields, I'm expecting that we can completely separate the solutions using kyaml lib and the go sdk lib. The pseudo code can be like
    parse input yaml --> initialize imageTransformer --> transform configs from A to B --> additionalField detected --> initialize the kyaml filters and other objects --> transform modified config B to C --> log results.

functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
functions/go/set-image/transformer/images.go Outdated Show resolved Hide resolved
Copy link
Contributor

@yuwenma yuwenma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo approve since this PR adds some more changes.

@yuwenma yuwenma merged commit 272744d into GoogleContainerTools:master Aug 30, 2022
@zyy98 zyy98 changed the title refactor set-image with go sdk feat: refactor set-image with go sdk Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants