Skip to content
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

Set ExpirationTimestamp for Service's cluster #102

Open
venkataanil opened this issue Dec 8, 2022 · 0 comments
Open

Set ExpirationTimestamp for Service's cluster #102

venkataanil opened this issue Dec 8, 2022 · 0 comments

Comments

@venkataanil
Copy link
Collaborator

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.

venkataanil added a commit to venkataanil/ocm-api-load that referenced this issue Dec 8, 2022
It sets expiration_timestamp for the clusters created by
clusters_mgmt endpoints. We need to work on fixing [1]
i.e setting expiration_timestamp for clusters created by
services (i.e service_mgmt endpoint). We will disable
testing service_mgmt endpoints in CI till this gets fixed.

[1] cloud-bulldozer#102
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

No branches or pull requests

1 participant