Skip to content

output from kpt fn render -o unwrap cannot be piped with kubectl apply -f - #3844

Description

@ericzzzzzzz

Expected behavior

Actual behavior

  • got errors due to crd not installed
  • example error message: error: resource mapping not found for name: "apply-setters-simple" namespace: "" from "STDIN": no matches for kind "Kptfile" in version "kpt.dev/v1" ensure CRDs are installed first

Information

kpt version: 1.0.0-beta.19
example : Kpt Package that can demonstrate the error. (https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/apply-setters-simple@apply-setters/v0.2.0)

The cause of this is not working is that kpt fn render -o unwrap now output Kptfile and configMap files defined ini Kptfile, those are not recognized by k8s cluster. Although, we can create .krmignore to exclude Kptfile in output, but this trick cannot be used to configMap files defined in Kptfile, as that would cause dataMap being ignored by krm functions as well.

Before certain version, those stuff are not included in the output from kpt fn render -o unwrap, reverting the behavior will probably introduce another breaking change, but could you add a flag to control the output not including Kptfile and congiMap files?

Steps to reproduce the behavior

  • run kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-catalog.git/examples/apply-setters-simple@apply-setters/v0.2.0 with the latest kpt
  • then in apply-setters-simple folder, run kpt fn render -o unwrap | kubectl apply -f -

Metadata

Metadata

Assignees

Labels

area/hydratedocumentationImprovements or additions to documentationtriagedIssue has been triaged by adding an `area/` label

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions