Skip to content

Conversation

@nakamasato
Copy link
Owner

@nakamasato nakamasato commented Aug 21, 2022

fail to run make test

Error1

make test
/Users/m.naka/repos/nakamasato/mysql-operator/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/Users/m.naka/repos/nakamasato/mysql-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
api/v1alpha1/groupversion_info.go
go vet ./...
# sigs.k8s.io/controller-runtime/pkg/log
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:67:16: cannot use NullLogger{} (value of type NullLogger) as type logr.Logger in argument to Log.Fulfill
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:82:31: cannot use NullLogger{} (value of type NullLogger) as type logr.Logger in argument to NewDelegatingLogger
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:86:24: cannot use Log (variable of type *DelegatingLogger) as type logr.Logger in variable declaration
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/log.go:88:16: assignment mismatch: 1 variable but logr.FromContext returns 2 values
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/null.go:30:21: cannot use NullLogger{} (value of type NullLogger) as type logr.Logger in variable declaration
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/null.go:49:9: cannot use log (variable of type NullLogger) as type logr.Logger in return statement
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:79:17: undefined: logr.WithCallDepth
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:163:9: cannot use res (variable of type *DelegatingLogger) as type logr.Logger in return statement
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:179:9: cannot use res (variable of type *DelegatingLogger) as type logr.Logger in return statement
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/deleg.go:195:9: cannot use res (variable of type *DelegatingLogger) as type logr.Logger in return statement
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/log/null.go:49:9: too many errors
# github.com/go-logr/zapr
../../../go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:138:9: cannot use &zapLogger{…} (value of type *zapLogger) as type logr.Logger in return statement
../../../go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:173:9: cannot use &zapLogger{…} (value of type *zapLogger) as type logr.Logger in return statement
../../../go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:185:21: cannot use &zapLogger{} (value of type *zapLogger) as type logr.Logger in variable declaration
../../../go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:186:12: undefined: logr.CallDepthLogger
# k8s.io/kubectl/pkg/util/openapi
../../../go/pkg/mod/k8s.io/[email protected]/pkg/util/openapi/openapi_getter.go:36:42: cannot use &CachedOpenAPIGetter{} (value of type *CachedOpenAPIGetter) as type discovery.OpenAPISchemaInterface in variable declaration:
        *CachedOpenAPIGetter does not implement discovery.OpenAPISchemaInterface (wrong type for OpenAPISchema method)
                have OpenAPISchema() (*"github.com/googleapis/gnostic/openapiv2".Document, error)
                want OpenAPISchema() (*"github.com/google/gnostic/openapiv2".Document, error)
../../../go/pkg/mod/k8s.io/[email protected]/pkg/util/openapi/openapi_getter.go:49:28: cannot use g.openAPIClient.OpenAPISchema() (value of type *"github.com/google/gnostic/openapiv2".Document) as type *"github.com/googleapis/gnostic/openapiv2".Document in assignment
../../../go/pkg/mod/k8s.io/[email protected]/pkg/util/openapi/openapi_getter.go:78:46: cannot use oapi (variable of type *"github.com/google/gnostic/openapiv2".Document) as type *"github.com/googleapis/gnostic/openapiv2".Document in argument to NewOpenAPIData
../../../go/pkg/mod/k8s.io/[email protected]/pkg/util/openapi/openapi.go:49:38: cannot use doc (variable of type *"github.com/googleapis/gnostic/openapiv2".Document) as type *"github.com/google/gnostic/openapiv2".Document in argument to proto.NewOpenAPIData
make: *** [vet] Error 2

Fixed by b5fa53c

Error2

make test  
/Users/m.naka/repos/nakamasato/mysql-operator/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/Users/m.naka/repos/nakamasato/mysql-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
KUBEBUILDER_ASSETS="/Users/m.naka/Library/Application Support/io.kubebuilder.envtest/k8s/1.24.2-darwin-arm64" /Users/m.naka/repos/nakamasato/mysql-operator/bin/ginkgo -cover -coverprofile cover.out -covermode=atomic -skipPackage=e2e ./...
Will skip:
  ./e2e
[1661084340] Controller Suite - 9/9 specs ••••••••
------------------------------
• Failure [1.347 seconds]
MySQLUser controller With MySQL with unnconnectable configuration With no MySQL found [It] Should have NotReady status with reason 'failed to fetch MySQL' 
/Users/m.naka/repos/nakamasato/mysql-operator/controllers/mysqluser_controller_test.go:327

  Timed out after 1.000s.
  Expected
      <string>: 
  to equal
      <string>: NotReady

  /Users/m.naka/repos/nakamasato/mysql-operator/controllers/mysqluser_controller_test.go:350
------------------------------
1.661084360114323e+09   INFO    controller-runtime.metrics     Metrics server is starting to listen     {"addr": ":8080"}
1.661084360114541e+09   INFO    Starting server {"path": "/metrics", "kind": "metrics", "addr": "[::]:8080"}
1.661084360114663e+09   INFO    Starting EventSource    {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser", "source": "kind source: *v1alpha1.MySQLUser"}
1.661084360114686e+09   INFO    Starting Controller     {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser"}
STEP: By creating a new MySQL
1.6610843602152991e+09  INFO    Starting workers        {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser", "worker count": 1}
STEP: By creating a new MySQLUser
1.6610843602286022e+09  INFO    [FetchMySQLUser] Found. {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser", "mySQLUser": {"name":"test-mysql-user","namespace":"default"}, "namespace": "default", "name": "test-mysql-user", "reconcileID": "73a7b3f2-afb3-4c54-bc4f-fe25b62b9398", "name": "test-mysql-user", "mysqlUser.Namespace": "default"}
1.661084360328842e+09   ERROR   [FetchMySQL] Failed     {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser", "mySQLUser": {"name":"test-mysql-user","namespace":"default"}, "namespace": "default", "name": "test-mysql-user", "reconcileID": "73a7b3f2-afb3-4c54-bc4f-fe25b62b9398", "error": "MySQL.mysql.nakamasato.com \"test-mysql\" not found"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        /Users/m.naka/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:121
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        /Users/m.naka/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:320
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /Users/m.naka/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /Users/m.naka/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:234
1.661084361335285e+09   INFO    Stopping and waiting for non leader election runnables
1.6610843613353631e+09  INFO    Stopping and waiting for leader election runnables
1.661084361335382e+09   INFO    Shutdown signal received, waiting for all workers to finish     {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser"}
1.661084361335407e+09   INFO    All workers finished    {"controller": "mysqluser", "controllerGroup": "mysql.nakamasato.com", "controllerKind": "MySQLUser"}
1.661084361335423e+09   INFO    Stopping and waiting for caches
1.661084361335524e+09   INFO    Stopping and waiting for webhooks
1.661084361335535e+09   INFO    Wait completed, proceeding to shutdown the manager



Summarizing 1 Failure:

[Fail] MySQLUser controller With MySQL with unnconnectable configuration With no MySQL found [It] Should have NotReady status with reason 'failed to fetch MySQL' 
/Users/m.naka/repos/nakamasato/mysql-operator/controllers/mysqluser_controller_test.go:350

Ran 9 of 9 Specs in 14.865 seconds
FAIL! -- 8 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestAPIs (14.87s)
FAIL

You're using deprecated Ginkgo functionality:
=============================================
Ginkgo 2.0 is under active development and will introduce several new features, improvements, and a small handful of breaking changes.
A release candidate for 2.0 is now available and 2.0 should GA in Fall 2021.  Please give the RC a try and send us feedback!
  - To learn more, view the migration guide at https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md
  - For instructions on using the Release Candidate visit https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#using-the-beta
  - To comment, chime in at https://github.com/onsi/ginkgo/issues/711

  You are using a custom reporter.  Support for custom reporters will likely be removed in V2.  Most users were using them to generate junit or teamcity reports and this functionality will be merged into the core reporter.  In addition, Ginkgo 2.0 will support emitting a JSON-formatted report that users can then manipulate to generate custom reports.

  If this change will be impactful to you please leave a comment on https://github.com/onsi/ginkgo/issues/711
  Learn more at: https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#removed-custom-reporters

To silence deprecations that can be silenced set the following environment variable:
  ACK_GINKGO_DEPRECATIONS=1.16.5

coverage: 80.5% of statements

Ginkgo ran 1 suite in 22.520759916s
Test Suite Failed

Ginkgo 2.0 is coming soon!
==========================
Ginkgo 2.0 is under active development and will introduce several new features, improvements, and a small handful of breaking changes.
A release candidate for 2.0 is now available and 2.0 should GA in Fall 2021.  Please give the RC a try and send us feedback!
  - To learn more, view the migration guide at https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md
  - For instructions on using the Release Candidate visit https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#using-the-beta
  - To comment, chime in at https://github.com/onsi/ginkgo/issues/711

To silence this notice, set the environment variable: ACK_GINKGO_RC=true
Alternatively you can: touch $HOME/.ack-ginkgo-rc
make: *** [test] Error 1

fixed by

golang-lint

  Running [/home/runner/golangci-lint-1.48.0-linux-amd64/golangci-lint run --out-format=github-actions --timeout=3m] in [] ...
  Error: Error return value of `(sigs.k8s.io/controller-runtime/pkg/client.StatusWriter).Update` is not checked (errcheck)
  Error: Error return value of `(sigs.k8s.io/controller-runtime/pkg/client.StatusWriter).Update` is not checked (errcheck)
  Error: Error return value of `(sigs.k8s.io/controller-runtime/pkg/client.StatusWriter).Update` is not checked (errcheck)

Fixed by 9012849

Other changes

@nakamasato nakamasato changed the title fix(deps): update kubernetes packages to v0.24.3 fix(deps): update controller-runtime to v0.12.3 Aug 21, 2022
@codecov
Copy link

codecov bot commented Aug 21, 2022

Codecov Report

Merging #129 (765d9f7) into main (656b80a) will decrease coverage by 1.77%.
The diff coverage is 66.43%.

@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
- Coverage   75.68%   73.92%   -1.77%     
==========================================
  Files           5        5              
  Lines         292      395     +103     
==========================================
+ Hits          221      292      +71     
- Misses         53       77      +24     
- Partials       18       26       +8     
Impacted Files Coverage Δ
controllers/test_utils.go 73.45% <64.70%> (-13.22%) ⬇️
controllers/mysqluser_controller.go 72.85% <66.66%> (+0.80%) ⬆️
controllers/mysql_controller.go 71.11% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nakamasato nakamasato force-pushed the upgrade-controller-runtime branch from 5ecec4a to 9012849 Compare August 21, 2022 12:40
@nakamasato nakamasato marked this pull request as ready for review August 24, 2022 12:18
@nakamasato nakamasato marked this pull request as draft August 24, 2022 12:19
@nakamasato nakamasato force-pushed the upgrade-controller-runtime branch 2 times, most recently from 06523ea to ddf79c5 Compare March 11, 2023 23:08
@nakamasato nakamasato force-pushed the upgrade-controller-runtime branch from 8d993a5 to 3fef452 Compare March 11, 2023 23:37
@nakamasato nakamasato marked this pull request as ready for review March 12, 2023 01:46
@nakamasato nakamasato merged commit 7e39913 into main Mar 12, 2023
@nakamasato nakamasato deleted the upgrade-controller-runtime branch March 12, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants