Skip to content

Commit 78b8139

Browse files
committed
Merge branch 'master' into issue4928-append-honors-key-style
2 parents 096b2c4 + 76f8d28 commit 78b8139

File tree

105 files changed

+861
-596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+861
-596
lines changed

.github/workflows/apidiff.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: APIDiff
2+
3+
# Trigger the workflow on pull requests and direct pushes to any branch
4+
on:
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
go-apidiff:
10+
name: Verify API differences
11+
runs-on: ubuntu-latest
12+
# Pull requests from different repository only trigger this checks
13+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
14+
steps:
15+
- name: Clone the code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Setup Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version-file: go.work
23+
- name: Execute go-apidiff
24+
uses: joelanford/[email protected]
25+
with:
26+
compare-imports: true
27+
print-compatible: true
28+
- name: Report failure
29+
uses: nashmaniac/[email protected]
30+
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
31+
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
32+
with:
33+
title: 🐛 go-apidiff failed for ${{ github.sha }}
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
labels: kind/bug
36+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- kyaml/v*
7+
- cmd/config/v*
8+
- api/v*
9+
- kustomize/v*
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out code into the Go module directory
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go 1.x
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version-file: go.work
23+
id: go
24+
- run: ./releasing/create-release.sh "${tag}"
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
tag: ${{ github.ref_name }}

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,35 @@ Administrative notes:
6464
- The [OWNERS file spec] is a useful resources in making changes.
6565
- Maintainers and admins must be added to the appropriate lists in both [Kustomize OWNERS_ALIASES] and [SIG-CLI Teams]. If this isn't done, the individual in question will lack either PR approval rights (Kustomize list) or the appropriate Github repository permissions (community list).
6666

67+
## Project/Product Managers
68+
69+
Kustomize will have opportunities to join in a project/product manager role. You can
70+
typically start working on this role as part of a kustomize training cohort, so please
71+
keep an eye out for that or reach out to the leads if you are interested in this type of
72+
work. Expectations for this role are:
73+
74+
- Triage 1 feature request each week, and bring it to weekly stand-up for discussion. Feature
75+
requests are issues labeled kind/feature, and you can find them [here](https://github.com/kubernetes-sigs/kustomize/issues?q=is%3Aissue+is%3Aopen+kind+feature+label%3Akind%2Ffeature).
76+
Triaging a feature request means:
77+
- Understand what the user is asking for, and their use case.
78+
- Verify that it is not an [eschewed feature](https://kubectl.docs.kubernetes.io/faq/kustomize/eschewedfeatures/#build-time-side-effects-from-cli-args-or-env-variables)
79+
- Verify that it is not a duplicate issue.
80+
- Look into workarounds. Is there another way that the user can achieve their use case with existing features?
81+
- If you are new to this role, prior to leaving a comment on the issue, please bring it to weekly standup
82+
for group discussion to make sure that we are all on the same page.
83+
- Once you feel ready, you can label it with a triage label. Here's an [example](https://github.com/kubernetes-sigs/kustomize/issues/5049). You can also
84+
look at other feature request issues to see how they were triaged and resolved. There are a few different triage labels that you can use, you can see the
85+
full list [here](https://github.com/kubernetes-sigs/kustomize/labels?q=triage).
86+
- Monitor the kustomize Slack channel and try to help users if you can. It is a pretty
87+
active channel, so responding to 4-5 users per week is sufficient even if some
88+
questions go unanswered. If there is an interesting topic or a recurring problem that many
89+
users are having, please bring it up in weekly stand-up.
90+
- Keeping track of a queue of backlog issues or PRs that are not being actively looked at in any existing project board.
91+
- Organizing or reorganizing project tracking boards when it makes sense.
92+
93+
You will also be asked to help with roadmap planning, deprecation communication, prioritization,
94+
and doing research on kustomize usage when appropriate, though these responsibilities will occur less
95+
frequently.
6796

6897
## Contact Information
6998

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Makefile for kustomize CLI and API.
55

6-
LATEST_RELEASE=v5.0.3
6+
LATEST_RELEASE=v5.1.1
77

88
SHELL := /usr/bin/env bash
99
GOOS = $(shell go env GOOS)
@@ -126,6 +126,14 @@ check-license: $(MYGOBIN)/addlicense
126126
lint: $(MYGOBIN)/golangci-lint $(MYGOBIN)/goimports $(builtinplugins)
127127
./hack/for-each-module.sh "make lint"
128128

129+
.PHONY: apidiff
130+
apidiff: go-apidiff ## Run the go-apidiff to verify any API differences compared with origin/master
131+
$(GOBIN)/go-apidiff master --compare-imports --print-compatible --repo-path=.
132+
133+
.PHONY: go-apidiff
134+
go-apidiff:
135+
go install github.com/joelanford/[email protected]
136+
129137
.PHONY: test-unit-all
130138
test-unit-all: \
131139
test-unit-non-plugin \

api/filters/patchjson6902/patchjson6902.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package patchjson6902
66
import (
77
"strings"
88

9-
jsonpatch "github.com/evanphx/json-patch"
9+
jsonpatch "gopkg.in/evanphx/json-patch.v5"
1010
"sigs.k8s.io/kustomize/kyaml/kio"
1111
"sigs.k8s.io/kustomize/kyaml/yaml"
1212
k8syaml "sigs.k8s.io/yaml"

api/filters/replacement/replacement.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ func applyReplacement(nodes []*yaml.RNode, value *yaml.RNode, targetSelectors []
126126
}
127127

128128
// filter targets by matching resource IDs
129-
for i, id := range ids {
130-
if id.IsSelectedBy(selector.Select.ResId) && !rejectId(selector.Reject, &ids[i]) {
129+
for _, id := range ids {
130+
if id.IsSelectedBy(selector.Select.ResId) && !containsRejectId(selector.Reject, ids) {
131131
err := copyValueToTarget(possibleTarget, value, selector)
132132
if err != nil {
133133
return nil, err
@@ -168,10 +168,15 @@ func matchesAnnoAndLabelSelector(n *yaml.RNode, selector *types.Selector) (bool,
168168
return annoMatch && labelMatch, nil
169169
}
170170

171-
func rejectId(rejects []*types.Selector, id *resid.ResId) bool {
171+
func containsRejectId(rejects []*types.Selector, ids []resid.ResId) bool {
172172
for _, r := range rejects {
173-
if !r.ResId.IsEmpty() && id.IsSelectedBy(r.ResId) {
174-
return true
173+
if r.ResId.IsEmpty() {
174+
continue
175+
}
176+
for _, id := range ids {
177+
if id.IsSelectedBy(r.ResId) {
178+
return true
179+
}
175180
}
176181
}
177182
return false

api/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ module sigs.k8s.io/kustomize/api
33
go 1.20
44

55
require (
6-
github.com/evanphx/json-patch v4.12.0+incompatible
76
github.com/go-errors/errors v1.4.2
87
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
98
github.com/imdario/mergo v0.3.6
109
github.com/stretchr/testify v1.8.1
10+
gopkg.in/evanphx/json-patch.v5 v5.6.0
1111
gopkg.in/yaml.v2 v2.4.0
1212
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961
13-
sigs.k8s.io/kustomize/kyaml v0.14.2
13+
sigs.k8s.io/kustomize/kyaml v0.14.3
1414
sigs.k8s.io/yaml v1.3.0
1515
)
1616

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
55
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
66
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
77
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8-
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
9-
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
108
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
119
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
1210
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
@@ -75,6 +73,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
7573
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7674
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
7775
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
76+
gopkg.in/evanphx/json-patch.v5 v5.6.0 h1:BMT6KIwBD9CaU91PJCZIe46bDmBWa9ynTQgJIOpfQBk=
77+
gopkg.in/evanphx/json-patch.v5 v5.6.0/go.mod h1:/kvTRh1TVm5wuM6OkHxqXtE/1nUZZpihg29RtuIyfvk=
7878
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
7979
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
8080
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

api/internal/builtins/PatchJson6902Transformer.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/internal/builtins/PatchTransformer.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)