-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add manifest bundle support #59
Conversation
746dfae
to
b2fbb39
Compare
test results: # make test-integration
CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go install -ldflags="" ./cmd/maestro
OCM_ENV=testing gotestsum --format short-verbose -- -p 1 -ldflags -s -v -timeout 1h \
./test/integration
I0307 09:30:50.606715 386039 framework.go:76] Initializing testing environment
I0307 09:30:50.887469 386039 framework.go:161] Using Mock OCM Authz Client
I0307 09:30:50.890513 386039 framework.go:199] Disabling Sentry error reporting
I0307 09:30:50.898980 386039 grpc_server.go:74] Serving gRPC service without TLS at 8090
I0307 09:30:50.899286 386039 api_server.go:151] Serving without TLS at 8000
PASS test/integration.TestConsumerGet (5.06s)
PASS test/integration.TestConsumerPost (0.23s)
PASS test/integration.TestConsumerPaging (0.35s)
PASS test/integration.TestControllerRacing (1.76s)
PASS test/integration.TestControllerReconcile (1.38s)
PASS test/integration.TestControllerSync (1.30s)
PASS test/integration.TestPulseServer (5.31s)
PASS test/integration.TestResourceGet (0.19s)
PASS test/integration.TestResourcePost (5.20s)
PASS test/integration.TestResourcePatch (0.35s)
PASS test/integration.TestResourcePaging (0.39s)
PASS test/integration.TestResourceListSearch (0.26s)
PASS test/integration.TestUpdateResourceWithRacingRequests (2.29s)
PASS test/integration.TestResourceFromGRPC (2.28s)
E0307 09:31:17.272039 386039 logger.go:129] Unable to get all maestro instances: pq: relation "server_instances" does not exist
E0307 09:31:17.273825 386039 logger.go:129] Unable to get all maestro instances: pq: relation "server_instances" does not exist
E0307 09:31:17.275218 386039 logger.go:129] Unable to get all maestro instances: pq: relation "server_instances" does not exist
E0307 09:31:17.276482 386039 logger.go:129] Unable to get all maestro instances: pq: relation "server_instances" does not exist
PASS test/integration
DONE 14 tests in 30.024s |
d43380b
to
5331ebc
Compare
}, | ||
}, | ||
|
||
for _, obj := range objs { |
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.
check/filter event type matching?
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.
do you mean single
or bundle
match?
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.
yes, you can get the event data type from the resync request event, then you can only response the type matched, right?
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.
thank! done.
pkg/api/resource_types.go
Outdated
resourceVersionInt := int64(0) | ||
resourceVersion, err := cloudeventstypes.ToString(evtExtensions[cetypes.ExtensionResourceVersion]) | ||
if err != nil { | ||
resourceVersionIntVal, err := cloudeventstypes.ToInteger(evtExtensions[cetypes.ExtensionResourceVersion]) |
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.
only use ToInteger
?
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.
right, we now ensure the resource version is integer.
Updated all the occurrences.
And cloud you also append the e2e test result? |
e2e test results: # make e2e-test
ginkgo --output-dir="/home/oasis/workspace/openshift-online-maestro/test/e2e/report" --json-report=report.json --junit-report=report.xml \
/home/oasis/workspace/openshift-online-maestro/test/e2e/pkg -- -consumer_id="34617c63-5f52-4ae0-8428-35daf6b9a45f" \
-api-server=https://127.0.0.1:30080 -kubeconfig=/home/oasis/workspace/openshift-online-maestro/test/e2e/.kubeconfig
Ginkgo detected a version mismatch between the Ginkgo CLI and the version of Ginkgo imported by your packages:
Ginkgo CLI Version:
2.6.0
Mismatched package versions found:
2.13.2 used by pkg
Ginkgo will continue to attempt to run but you may see errors (including flag
parsing errors) and should either update your go.mod or your version of the
Ginkgo CLI to match.
To install the matching version of the CLI run
go install github.com/onsi/ginkgo/v2/ginkgo
from a path that contains a go.mod file. Alternatively you can use
go run github.com/onsi/ginkgo/v2/ginkgo
from a path that contains a go.mod file to invoke the matching version of the
Ginkgo CLI.
If you are attempting to test multiple packages that each have a different
version of the Ginkgo library with a single Ginkgo CLI that is currently
unsupported.
Running Suite: End-to-End Test Suite - /home/oasis/workspace/openshift-online-maestro/test/e2e/pkg
============================================================================================
Random Seed: 1709873066
Will run 5 of 5 specs
•••••
Ran 5 of 5 Specs in 4.149 seconds
SUCCESS! -- 5 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
Ginkgo ran 1 suite in 8.021418251s
Test Suite Passed |
63012f9
to
949dbc6
Compare
/assign @qiujian16 @clyang82 |
949dbc6
to
efb0ae6
Compare
|
||
// DecodeStatus converts a CloudEvent JSONMap representation of a resource status | ||
// into resource status (map[string]interface{}). | ||
func DecodeStatus(status datatypes.JSONMap) (map[string]interface{}, error) { |
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.
So when we store in DB, we store a cloudEvent structure right?
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.
yes, we now store spec and status in cloudevent format in DB now. This function is used to decode cloudevent status to resource status in openapi format to restful client.
@@ -13,6 +13,7 @@ func addResources() *gormigrate.Migration { | |||
Source string `gorm:"index"` | |||
ConsumerID string `gorm:"index"` | |||
Version int `gorm:"not null"` | |||
Type string `gorm:"index"` |
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.
can we add some comments here? It is not clear to me what data structure is stored in DB.
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.
added comments.
@qiujian16 An example of resource status in DB:
|
Signed-off-by: morvencao <lcao@redhat.com>
Signed-off-by: morvencao <lcao@redhat.com>
Signed-off-by: morvencao <lcao@redhat.com>
Signed-off-by: morvencao <lcao@redhat.com>
Signed-off-by: morvencao <lcao@redhat.com>
Signed-off-by: morvencao <lcao@redhat.com>
dbe9316
to
18226fe
Compare
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.
LGTM
ref: https://issues.redhat.com/browse/OCM-6367