GoogleContainerTools / kpt-config-sync

Config Sync - used to sync Git, OCI and Helm charts to your clusters.
Apache License 2.0
229 stars 40 forks source link

Refactor parser.Options to use a normal mutex #1257

Closed karlkfi closed 3 weeks ago

karlkfi commented 3 weeks ago

Mutexes do not need a pointer when used as a field in a struct that is used with a pointer. Mutexes also don't need initialization when not a pointer. So this makes it a little easier to construct pointer.Options.

google-oss-prow[bot] commented 3 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nan-yu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/GoogleContainerTools/kpt-config-sync/blob/main/OWNERS)~~ [nan-yu] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
karlkfi commented 3 weeks ago

TestRoot_SourceReconcilerErrorsMetricValidation is flaky?

    --- FAIL: TestRoot_SourceReconcilerErrorsMetricValidation/single_reconciler_error_in_source_component (0.01s)
panic: runtime error: index out of range [3] with length 3 [recovered]
    panic: runtime error: index out of range [3] with length 3
goroutine 677 [running]:
testing.tRunner.func1.2({0x1dbe640, 0xc0014b5560})
    /usr/local/go/src/testing/testing.go:1545 +0x238
testing.tRunner.func1()
    /usr/local/go/src/testing/testing.go:1548 +0x397
panic({0x1dbe640?, 0xc0014b5560?})
    /usr/local/go/src/runtime/panic.go:914 +0x21f
kpt.dev/configsync/pkg/testing/testmetrics.diff({0xc0010f5a40, 0x6, 0x6}, {0xc0010bc930, 0x3, 0x3})
    /go/src/kpt.dev/configsync/pkg/testing/testmetrics/testexporter.go:63 +0xa90
kpt.dev/configsync/pkg/testing/testmetrics.(*TestExporter).ValidateMetrics(0xc0010bc9c0, 0x7a2170d4f5c0?, {0xc0010bc930, 0x3, 0x3})
    /go/src/kpt.dev/configsync/pkg/testing/testmetrics/testexporter.go:48 +0x1c5
kpt.dev/configsync/pkg/parse.TestRoot_SourceReconcilerErrorsMetricValidation.func1(0xc00109c680)
    /go/src/kpt.dev/configsync/pkg/parse/root_test.go:1045 +0x706
testing.tRunner(0xc00109c680, 0xc0011c38b0)
    /usr/local/go/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 676
    /usr/local/go/src/testing/testing.go:1648 +0x3ad
karlkfi commented 3 weeks ago

https://github.com/GoogleContainerTools/kpt-config-sync/pull/1260 may fix the panic but maybe not the flaky failure...

nan-yu commented 3 weeks ago

/lgtm

nan-yu commented 3 weeks ago

/retest