Skip to content

Commit

Permalink
upgrade to kyaml 0.13.0+ (#2603)
Browse files Browse the repository at this point in the history
* upgrade to kyaml 0.13.0+

* use the latest kyaml
  • Loading branch information
Mengqi Yu authored Dec 3, 2021
1 parent cbd93fa commit ac17e15
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 100 deletions.
2 changes: 1 addition & 1 deletion e2e/testdata/fn-eval/error-in-pipe/.expected/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdErr: |
[RUNNING] "gcr.io/kpt-fn/set-namespace:v0.1.3"
[FAIL] "gcr.io/kpt-fn/set-namespace:v0.1.3" in 0s
Results:
[ERROR] failed to configure function: input namespace cannot be empty
[error]: failed to configure function: input namespace cannot be empty
Stderr:
"[error] /// : failed to configure function: input namespace cannot be empty"
Exit code: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stdErr: |
[RUNNING] "gcr.io/kpt-fn/set-labels:v0.1.3"
[PASS] "gcr.io/kpt-fn/set-labels:v0.1.3" in 0s
stdOut: |
apiVersion: config.kubernetes.io/v1alpha1
apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
# Copyright 2021 Google LLC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

stdOut: |
apiVersion: config.kubernetes.io/v1alpha1
apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- # Copyright 2021 Google LLC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testType: eval
image: gcr.io/kpt-fn/search-replace:v0.1
fnConfig: ../search-replace-conf.yaml
# Non-error messages should be printed to stderr
stdErr: "[INFO]"
stdErr: "[info]"
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# non-zero exit code and no changes in the resources.
exitCode: 1
disableOutputTruncate: true
stdErr: '[ERROR] Invalid type. Expected: [integer,null], given: string in object "apps/v1/Deployment/nginx-deployment" in file "resources.yaml" in field "spec.replicas"'
stdErr: '[error] apps/v1/Deployment/nginx-deployment spec.replicas: Invalid type. Expected: [integer,null], given: string'
2 changes: 1 addition & 1 deletion e2e/testdata/fn-render/fn-failure/.expected/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ stdErr: |
[RUNNING] "gcr.io/kpt-fn/starlark:v0.2.1"
[FAIL] "gcr.io/kpt-fn/starlark:v0.2.1" in 0s
Results:
[ERROR] httpbin-gen:4:1: got newline, want primary expression
[error]: httpbin-gen:4:1: got newline, want primary expression
Stderr:
"[error] : httpbin-gen:4:1: got newline, want primary expression"
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# One of the functions in the pipeline fails resulting in
# non-zero exit code and no changes in the resources.
exitCode: 1
stdErr: '[ERROR] Invalid type. Expected: [integer,null], given: string in object "apps/v1/Deployment/nginx-deployment" in file "resources.yaml" in field "spec.replicas"'
stdErr: '[error] apps/v1/Deployment/nginx-deployment spec.replicas: Invalid type. Expected: [integer,null], given: string'
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
# One of the functions in the pipeline fails resulting in
# non-zero exit code and no changes in the resources.
exitCode: 1
stdErr: '[ERROR] selector is required in object "apps/v1/Deployment/nginx-deployment" in file "resources.yaml" in field "selector"'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
stdOut: |
apiVersion: config.kubernetes.io/v1alpha1
apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
# Copyright 2021 Google LLC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stdErr: |
[PASS] "gcr.io/kpt-fn/set-labels:v0.1.3" in 0s
stdOut: |
apiVersion: config.kubernetes.io/v1alpha1
apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
# Copyright 2021 Google LLC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ stdErr: |
[PASS] "gcr.io/kpt-fn/set-namespace:v0.1.3" in 0s
stdOut: |
apiVersion: config.kubernetes.io/v1alpha1
apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
# Copyright 2021 Google LLC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
stdOut: |-
apiVersion: config.kubernetes.io/v1alpha1
apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- # Copyright 2021 Google LLC
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ require (
github.com/stretchr/testify v1.7.0
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca
gotest.tools v2.2.0+incompatible
k8s.io/api v0.22.2
k8s.io/api v0.22.3
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/apimachinery v0.22.3
k8s.io/cli-runtime v0.22.2
k8s.io/client-go v0.22.2
k8s.io/klog/v2 v2.10.0
k8s.io/kube-openapi v0.0.0-20211109043139-026bd182f079 // indirect
k8s.io/kubectl v0.22.2
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e
sigs.k8s.io/cli-utils v0.26.1-0.20211020064957-d62b5c62002d
sigs.k8s.io/kustomize/api v0.8.11
sigs.k8s.io/kustomize/kyaml v0.12.1-0.20211012224254-55ac9ca88db9
sigs.k8s.io/kustomize/kyaml v0.13.1-0.20211203194734-cd2c6a1ad117
)
17 changes: 12 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw=
k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8=
k8s.io/api v0.22.3 h1:wOoES2GoSkUsdped2RB4zYypPqWtvprGoKCENTOOjP4=
k8s.io/api v0.22.3/go.mod h1:azgiXFiXqiWyLCfI62/eYBOu19rj2LKmIhFPP4+33fs=
k8s.io/apiextensions-apiserver v0.22.2 h1:zK7qI8Ery7j2CaN23UCFaC1hj7dMiI87n01+nKuewd4=
k8s.io/apiextensions-apiserver v0.22.2/go.mod h1:2E0Ve/isxNl7tWLSUDgi6+cmwHi5fQRdwGVCxbC+KFA=
k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk=
k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk=
k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI=
k8s.io/cli-runtime v0.22.2 h1:fsd9rFk9FSaVq4SUq1fM27c8CFGsYZUJ/3BkgmjYWuY=
k8s.io/cli-runtime v0.22.2/go.mod h1:tkm2YeORFpbgQHEK/igqttvPTRIHFRz5kATlw53zlMI=
Expand All @@ -1005,16 +1007,19 @@ k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllun
k8s.io/component-helpers v0.22.2/go.mod h1:+N61JAR9aKYSWbnLA88YcFr9K/6ISYvRNybX7QW7Rs8=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/klog/v2 v2.10.0 h1:R2HDMDJsHVTHA2n4RjwbeYXdOcBymXdX/JRb1v0VGhE=
k8s.io/klog/v2 v2.10.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM=
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
k8s.io/kube-openapi v0.0.0-20211109043139-026bd182f079 h1:Qvr4c6wr4iBZbZQY/IwkcJH04hpdzUt2zdJw4D7P/Ng=
k8s.io/kube-openapi v0.0.0-20211109043139-026bd182f079/go.mod h1:X90lRFlqk35/w9FG4WIvZqMPfG3WrZGzdlSaL6uh7rc=
k8s.io/kubectl v0.22.2 h1:KMyYNZoBshaL3XKx04X07DtpoD4vMrdkfiN/G2Qx/PU=
k8s.io/kubectl v0.22.2/go.mod h1:BApg2j0edxLArCOfO0ievI27EeTQqBDMNU9VQH734iQ=
k8s.io/metrics v0.22.2/go.mod h1:GUcsBtpsqQD1tKFS/2wCKu4ZBowwRncLOJH1rgWs3uw=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e h1:ldQh+neBabomh7+89dTpiFAB8tGdfVmuIzAHbvtl+9I=
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
Expand All @@ -1032,8 +1037,10 @@ sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqw
sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go=
sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM=
sigs.k8s.io/kustomize/kyaml v0.12.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E=
sigs.k8s.io/kustomize/kyaml v0.12.1-0.20211012224254-55ac9ca88db9 h1:YsD7ModmQptMeuSZW/ZOeV2/LLQaOYNUA3sx3yZQTa0=
sigs.k8s.io/kustomize/kyaml v0.12.1-0.20211012224254-55ac9ca88db9/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E=
sigs.k8s.io/kustomize/kyaml v0.13.1-0.20211122190718-01420768c8ef h1:+S4oQAuqVk4Nmy28fALpv93AgW0UKQWjmqUwSNmIWpE=
sigs.k8s.io/kustomize/kyaml v0.13.1-0.20211122190718-01420768c8ef/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E=
sigs.k8s.io/kustomize/kyaml v0.13.1-0.20211203194734-cd2c6a1ad117 h1:4ePwpEnROoPqjaY6WC98EiRpYrmJjDHV6KA7PGDmpdQ=
sigs.k8s.io/kustomize/kyaml v0.13.1-0.20211203194734-cd2c6a1ad117/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno=
sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmdrender/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func adjustRelPath(hctx *hydrationContext) error {
if err = r.PipeE(yaml.SetAnnotation(kioutil.PathAnnotation, newPath)); err != nil {
return err
}
if err = r.PipeE(yaml.SetAnnotation(kioutil.LegacyPathAnnotation, newPath)); err != nil {
if err = r.PipeE(yaml.SetAnnotation(kioutil.LegacyPathAnnotation, newPath)); err != nil { // nolint:staticcheck
return err
}
if err = pkg.RemovePkgPathAnnotation(r); err != nil {
Expand Down
81 changes: 24 additions & 57 deletions internal/fnruntime/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,29 +224,47 @@ func parseStructuredResult(yml *yaml.RNode, fnResult *fnresult.Result) error {
return err
}

return parseNameAndNamespace(yml, fnResult)
return migrateLegacyResult(yml, fnResult)
}

// parseNameAndNamespace populates name and namespace in fnResult.Result if a
// migrateLegacyResult populates name and namespace in fnResult.Result if a
// function (e.g. using kyaml Go SDKs) gives results in a schema
// that puts a resourceRef's name and namespace under a metadata field
// TODO: fix upstream (https://github.com/GoogleContainerTools/kpt/issues/2091)
func parseNameAndNamespace(yml *yaml.RNode, fnResult *fnresult.Result) error {
func migrateLegacyResult(yml *yaml.RNode, fnResult *fnresult.Result) error {
items, err := yml.Elements()
if err != nil {
return err
}

for i := range items {
if err := populateResourceRef(items[i], &fnResult.Results[i]); err != nil {
if err = populateResourceRef(items[i], fnResult.Results[i]); err != nil {
return err
}
if err = populateProposedValue(items[i], fnResult.Results[i]); err != nil {
return err
}
}

return nil
}

func populateResourceRef(item *yaml.RNode, resultItem *framework.ResultItem) error {
func populateProposedValue(item *yaml.RNode, resultItem *framework.Result) error {
sv, err := item.Pipe(yaml.Lookup("field", "suggestedValue"))
if err != nil {
return err
}
if sv == nil {
return nil
}
if resultItem.Field == nil {
resultItem.Field = &framework.Field{}
}
resultItem.Field.ProposedValue = sv
return nil
}

func populateResourceRef(item *yaml.RNode, resultItem *framework.Result) error {
r, err := item.Pipe(yaml.Lookup("resourceRef", "metadata"))
if err != nil {
return err
Expand Down Expand Up @@ -282,7 +300,7 @@ func printFnResult(ctx context.Context, fnResult *fnresult.Result, opt *printer.
// function returned structured results
var lines []string
for _, item := range fnResult.Results {
lines = append(lines, resultToString(item))
lines = append(lines, item.String())
}
ri := &multiLineFormatter{
Title: "Results",
Expand Down Expand Up @@ -402,57 +420,6 @@ func (ri *multiLineFormatter) String() string {
return b.String()
}

// resultToString converts given structured result item to string format.
func resultToString(result framework.ResultItem) string {
// TODO: Go SDK should implement Stringer method
// for framework.ResultItem. This is a temporary
// wrapper that will eventually be moved to Go SDK.

defaultSeverity := "info"

s := strings.Builder{}

severity := defaultSeverity

if string(result.Severity) != "" {
severity = string(result.Severity)
}
s.WriteString(fmt.Sprintf("[%s] %s", strings.ToUpper(severity), result.Message))

resourceID := resourceRefToString(result.ResourceRef)
if resourceID != "" {
// if an object is involved
s.WriteString(fmt.Sprintf(" in object %q", resourceID))
}

if result.File.Path != "" {
s.WriteString(fmt.Sprintf(" in file %q", result.File.Path))
}

if result.Field.Path != "" {
s.WriteString(fmt.Sprintf(" in field %q", result.Field.Path))
}

return s.String()
}

func resourceRefToString(ref yaml.ResourceIdentifier) string {
s := strings.Builder{}
if ref.APIVersion != "" {
s.WriteString(fmt.Sprintf("%s/", ref.APIVersion))
}
if ref.Kind != "" {
s.WriteString(fmt.Sprintf("%s/", ref.Kind))
}
if ref.Namespace != "" {
s.WriteString(fmt.Sprintf("%s/", ref.Namespace))
}
if ref.Name != "" {
s.WriteString(ref.Name)
}
return s.String()
}

func newFnConfig(f *kptfilev1.Function, pkgPath types.UniquePath) (*yaml.RNode, error) {
const op errors.Op = "fn.readConfig"
var fn errors.Fn = errors.Fn(f.Image)
Expand Down
2 changes: 1 addition & 1 deletion internal/fnruntime/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ file:
yml, err := yaml.Parse(tc.input)
assert.NoError(t, err)

result := &framework.ResultItem{}
result := &framework.Result{}
err = yaml.Unmarshal([]byte(tc.input), result)
assert.NoError(t, err)
assert.NoError(t, populateResourceRef(yml, result))
Expand Down
2 changes: 1 addition & 1 deletion internal/util/cmdutil/cmdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func WriteToOutput(r io.Reader, w io.Writer, outDir string) error {
outputs = []kio.Writer{&kio.ByteWriter{
Writer: w,
ClearAnnotations: []string{kioutil.IndexAnnotation, kioutil.PathAnnotation,
kioutil.LegacyIndexAnnotation, kioutil.LegacyPathAnnotation}},
kioutil.LegacyIndexAnnotation, kioutil.LegacyPathAnnotation}}, // nolint:staticcheck
}
}

Expand Down
16 changes: 8 additions & 8 deletions internal/util/cmdutil/cmdutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestWriteFnOutput(t *testing.T) {
name: "wrapped output to stdout",
dest: "stdout",
writer: bytes.Buffer{},
content: `apiVersion: config.kubernetes.io/v1alpha1
content: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand All @@ -58,7 +58,7 @@ items:
internal.config.kubernetes.io/index: '0'
internal.config.kubernetes.io/path: 'svc.yaml'
`,
expectedStdout: `apiVersion: config.kubernetes.io/v1alpha1
expectedStdout: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand All @@ -81,7 +81,7 @@ items:
name: "unwrapped output to stdout",
dest: "unwrap",
writer: bytes.Buffer{},
content: `apiVersion: config.kubernetes.io/v1alpha1
content: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand Down Expand Up @@ -113,7 +113,7 @@ metadata:
{
name: "output to another directory",
dest: "foo/bar",
content: `apiVersion: config.kubernetes.io/v1alpha1
content: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand Down Expand Up @@ -152,7 +152,7 @@ metadata:
name: "wrapped output to stdout by default if input is from stdin",
fromStdin: true,
writer: bytes.Buffer{},
content: `apiVersion: config.kubernetes.io/v1alpha1
content: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand All @@ -170,7 +170,7 @@ items:
internal.config.kubernetes.io/index: '0'
internal.config.kubernetes.io/path: 'svc.yaml'
`,
expectedStdout: `apiVersion: config.kubernetes.io/v1alpha1
expectedStdout: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand All @@ -194,7 +194,7 @@ items:
fromStdin: true,
dest: "unwrap",
writer: bytes.Buffer{},
content: `apiVersion: config.kubernetes.io/v1alpha1
content: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand Down Expand Up @@ -227,7 +227,7 @@ metadata:
name: "output to directory for input from stdin",
fromStdin: true,
dest: "foo/bar",
content: `apiVersion: config.kubernetes.io/v1alpha1
content: `apiVersion: config.kubernetes.io/v1
kind: ResourceList
items:
- apiVersion: apps/v1
Expand Down
3 changes: 2 additions & 1 deletion internal/util/merge/merge3.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ func (*resourceHandler) equals(r1, r2 *yaml.RNode) (bool, error) {

func stripKyamlAnnos(n *yaml.RNode) error {
for _, a := range []string{mergeSourceAnnotation, kioutil.PathAnnotation, kioutil.IndexAnnotation,
kioutil.LegacyPathAnnotation, kioutil.LegacyIndexAnnotation, attribution.CNRMMetricsAnnotation} {
kioutil.LegacyPathAnnotation, kioutil.LegacyIndexAnnotation, // nolint:staticcheck
kioutil.InternalAnnotationsMigrationResourceIDAnnotation, attribution.CNRMMetricsAnnotation} {
err := n.PipeE(yaml.ClearAnnotation(a))
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/fnresult/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Result struct {
// ExitCode is the exit code from running the function
ExitCode int `yaml:"exitCode"`
// Results is the list of results for the function
Results []framework.ResultItem `yaml:"results,omitempty"`
Results framework.Results `yaml:"results,omitempty"`
}

const (
Expand Down
Loading

0 comments on commit ac17e15

Please sign in to comment.