Skip to content

Implement render for kustomize #3110

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

Merged

Conversation

arminbuerkle
Copy link
Contributor

Relates to #1937 and #2957 for kustomize.

Description

Implements the render command for kustomize. Basically copied the way kubectl render works to kustomize to try it out. It works for my current purpose so i added a unit test.

If it looks good you can merge it, if someone else is already working on this feel free to close it.

User facing changes
Implements the render command for kustomize.

Next PRs.

n/a

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Mentions any output changes.
  • Adds documentation as needed: user docs, YAML reference, CLI reference. (Not needed?)
  • Adds integration tests if needed. (Not needed?)

Reviewer Notes

  • The code flow looks good.
  • Unit test added.
  • User facing changes look good.

Release Notes

- Implement `skaffold render` for `kustomize` deployer

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

return NewDeploySuccessResult(namespaces)
}

func (k *KustomizeDeployer) renderManifests(ctx context.Context, out io.Writer, builds []build.Artifact, labellers []Labeller) (deploy.ManifestList, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why Render doesn't have []Labeller as parameter. I think that's something that should get added in the future so the behaviour is similar to Deploy.

Copy link
Contributor

Choose a reason for hiding this comment

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

it should have it. looks like maybe I forgot to put it in there when I added the boilerplate a while back.

@codecov
Copy link

codecov bot commented Oct 22, 2019

Codecov Report

Merging #3110 into master will decrease coverage by 0.03%.
The diff coverage is 41.66%.

Impacted Files Coverage Δ
pkg/skaffold/deploy/kustomize.go 71.63% <41.66%> (-2.57%) ⬇️

@arminbuerkle arminbuerkle force-pushed the add-render-to-kustomize branch from aaa3ec5 to f908b60 Compare October 22, 2019 09:59
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@arminbuerkle arminbuerkle force-pushed the add-render-to-kustomize branch from f908b60 to d35d3ae Compare October 23, 2019 07:09
@dgageot dgageot added the kokoro:run runs the kokoro jobs on a PR label Oct 31, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Oct 31, 2019
@arminbuerkle arminbuerkle force-pushed the add-render-to-kustomize branch from d35d3ae to a009263 Compare November 7, 2019 17:23
@arminbuerkle
Copy link
Contributor Author

@dgageot No sure whom to mention but is this PR going to make it? Should i keep it updated?

@dgageot
Copy link
Contributor

dgageot commented Nov 7, 2019

Sorry @arminbuerkle, the team was quite busy launching version 1.0. I guess it's best to ping @nkubala

@dgageot dgageot added the kokoro:run runs the kokoro jobs on a PR label Nov 15, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Nov 15, 2019
@arminbuerkle arminbuerkle force-pushed the add-render-to-kustomize branch from a009263 to 5daa2e0 Compare November 21, 2019 10:53
@arminbuerkle
Copy link
Contributor Author

@nkubala friendly reminder that having this feature would be awesome and improve the gitops workflow with kustomize mentioned in #1937 & #2957

@arminbuerkle arminbuerkle force-pushed the add-render-to-kustomize branch from 5daa2e0 to 387829f Compare December 6, 2019 10:34
Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

hey @arminbuerkle, thanks for the contribution and really sorry it took me ages to get to you on this one!

I implemented this in #2911 a while ago, but closed it to split it up into smaller PRs and never got it back in. what you have here is very close to my original PR, but can you have a look at my implementation there and try and match what you have to that? specifically around the event handling and the labels being passed in to the renderer.

@arminbuerkle arminbuerkle force-pushed the add-render-to-kustomize branch from 387829f to ce818aa Compare December 10, 2019 09:52
@arminbuerkle
Copy link
Contributor Author

@nkubala PTAL. I fixed the event handling.

The labeling requires changing the Render interface and consequently all of its implementations. Not really something that should be in this PR.

I'm happy to submit a follow up PR that fixes labeling and introduces a cmd flag to allow setting labels when using skaffold render.

Signed-off-by: Armin Buerkle <[email protected]>
@dgageot dgageot added the kokoro:run runs the kokoro jobs on a PR label Dec 18, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Dec 18, 2019
@alnr
Copy link

alnr commented Jan 7, 2020

Is there any update on this PR?

Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

@arminbuerkle sorry for taking so long with this one. I tested this out and it seems to work well enough, so let's go ahead and get this in. we should definitely have a follow up PR to enable setting labels in Render - would you like to send that?

I opened #3482 to track.

@nkubala nkubala merged commit 824a03a into GoogleContainerTools:master Jan 8, 2020
@arminbuerkle arminbuerkle mentioned this pull request Jan 22, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants