-
Notifications
You must be signed in to change notification settings - Fork 227
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
kpt fn render
includes local and meta resources by default
#2781
kpt fn render
includes local and meta resources by default
#2781
Conversation
@@ -92,12 +92,18 @@ func (e *Executor) Execute(ctx context.Context) error { | |||
at := attribution.Attributor{Resources: hctx.root.resources, CmdGroup: "fn"} | |||
at.Process() | |||
|
|||
includeMetaResources := true |
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.
will this eventually be changed as a configurable flag? Or kpt always include meta resources in fn render
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.
at the moment no plans to make it configurable.
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.
Actually, thought some more and realized exposing this as configurable
flag will make it consistent with other fn
commands and also provide a way to address the breaking change. Users can run fn render --include-meta-resources false
to get the previous behavior. I will update the PR.
b627961
to
8a45dd9
Compare
ref: #2590 |
kpt fn render
includes local and meta resources by default
14592a9
to
825e9ae
Compare
Quick update: Now this PR is against the target feature branch |
/lgtm |
internal/cmdrender/executor.go
Outdated
fnResults: fnresult.NewResultList(), | ||
imagePullPolicy: e.ImagePullPolicy, | ||
allowExec: e.AllowExec, | ||
encludeMetaResources: e.ExcludeMetaResources, |
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.
nit: a typo "exclude"
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 for catching it.
internal/cmdrender/executor.go
Outdated
@@ -168,6 +176,10 @@ type hydrationContext struct { | |||
// imagePullPolicy controls the image pulling behavior. | |||
imagePullPolicy fnruntime.ImagePullPolicy | |||
|
|||
// indicate if package meta resources such as Kptfile | |||
// to be excluded from the function in put during render. | |||
encludeMetaResources bool |
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.
ditto
This PR adds support for including
local
andmeta
resources by default infn render
.To exclude meta resource (just the
Kptfile
), users can runkpt fn render --exclude-meta-resources
.