-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore: remove validation for kpt version #8425
chore: remove validation for kpt version #8425
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8425 +/- ##
==========================================
- Coverage 70.48% 65.22% -5.27%
==========================================
Files 515 607 +92
Lines 23150 30078 +6928
==========================================
+ Hits 16317 19617 +3300
- Misses 5776 8987 +3211
- Partials 1057 1474 +417
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
writer := kio.ByteWriter{Writer: b} | ||
// Kpt fn render outputs Kptfile content in result, we don't want this in our manifestList as Kptfile resource cannot be deployed to k8s cluster. | ||
pipeline := kio.Pipeline{Filters: []kio.Filter{framework.ResourceMatcherFunc(func(node *yaml.RNode) bool { | ||
return node.GetKind() != kptfile.KptFileKind |
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.
If I recall correctly, I think the issue is not only with the Kptfile
but with all the yaml files during rendering: kpt will read all the yaml files in the folder and render them. So, in the case we have a folder structure like this:
project/
Kptfile
deployment.yaml
skaffold.yaml
We'll need to filter the Kptfile
and the skaffold.yaml
or a deployer like kubectl
will fail; I think the kpt deployer is able to filter this by itself properly. 🤔
Also, not sure how common is a folder structure like the one I mentioned.
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.
users can also ignore skaffold.yaml file by .krmignore file, but there might be another problem related to fn render
output, the command currently also output configMap file which cannot be used for deployment either, I'm gonna create an issue with kpt maintainers.
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.
We don't filter out skaffold.yaml ourselves, any yamls with Apiversion
, Kind
, metadata.name
will be included regardless of which kpt version we use . It is users responsibility to make sure they put the right files in their kpt package that should include Kptfile
, deployments files
, data config files
, we can filter deployments files from the kpt fn render
. Every standard kpt Data config file is expected to have config.kubernetes.io/local-config: "true"
annotation , we can inspect the annotation for each yaml resource from kpt fn render
and then filter them out.
b817f85
to
07b5996
Compare
Fixes: #8306
Related: kptdev/kpt#3844
Related: Relevant tracking issues, for context
Merge before/after: Dependent or prerequisite PRs
Description
wget https://storage.googleapis.com/skaffold/deps/kpt/v1.0.0-beta.24/kpt_linux_amd64 -O kpt && shasum -a 256 -c ${skaffold_repo}deploy/skaffold/digests/kpt.amd64.sha256
should output okFollow-up Work (remove if N/A)