cloud-bulldozer / cloud-bulldozer/ocm-api-load

Set ExpirationTimestamp for Service's cluster

Open
#102 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1
Forks
8
PR merge metrics
No merged PRs in 30d

Description

We want to set service & it's cluster expiry in our test. We tried with "ExpiredAt" function v1.NewManagedService().Service("ocm-addon-test-operator").ExpiredAt(time.Now().Add(time.Hour)). i.e setting to expire after one hour of creation i.e
2022/12/08 11:51:23 Debug - Request method is POST
2022/12/08 11:51:23 Debug - Request URL is 'https://api.integration.openshift.com/api/service_mgmt/v1/services'
2022/12/08 11:51:23 Debug - Request body follows
2022/12/08 11:51:23 Debug - {
"kind": "ManagedService",
"expired_at": "2022-12-08T12:51:23Z",
...
...
But in http POST method's response , I could see it set to 36 hours after created_at timestamp i.e
"created_at": "2022-12-08T11:51:27Z",
"expired_at": "2022-12-09T23:51:23.964498103Z",

Looks like it is using cluster's expiration_timestamp https://gitlab.cee.redhat.com/service/ocm-managed-services/-/blob/main/pkg/services/managed_services.go#L280 though user has provided ExpiredAt

We tried v1.NewManagedService().Cluster(v1.NewCluster().ExpirationTimestamp( However this cluster builder ( https://github.com/openshift-online/ocm-sdk-go/blob/main/servicemgmt/v1/cluster_builder.go ) is not having ExpirationTimestamp method.

May be we should use cluster builder from github.com/openshift-online/ocm-sdk-go/**clustersmgmt**/v1 for cluster inside service instead of https://github.com/openshift-online/ocm-sdk-go/blob/main/**servicemgmt**/v1/cluster_builder.go

Also we need to check from which ocm-sdk-go release we have this ExpirationTimestamp() function.

We should avoid testing services in CI till it gets fixed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.