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

patch-services test failing

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

Description

patch-services test failing with below error
2022/11/17 14:49:00 Fatal - Unable to create Service: %!(EXTRA *errors.Error=status is 502, identifier is '24', code is 'OCM-MS-24' and operation identifier is '2HgAq3EOffKnOrllJyqV5WrNrC3': Unable to create cluster : status is 400, identifier is '400', code is 'CLUSTERS-MGMT-400' and operation identifier is 'ded178cd-27d6-4ca1-83d3-e477a3603753': Could not find provided zone 'us-west-2' in the AWS Region: 'us-west-2')

Below fixes needed in https://github.com/cloud-bulldozer/ocm-api-load/blob/main/pkg/tests/handlers/services.go
1. Append 'a' to region while creating the cluster i.e
- Nodes(v1.NewClusterNodes().AvailabilityZones(ccsRegion)).
+ Nodes(v1.NewClusterNodes().AvailabilityZones(fmt.Sprintf("%sa", ccsRegion))).

2. Use ServiceID instead of ClusterID in patch path
- serviceIds[i] = clusterID
+ serviceIds[i] = serviceID

3. As we are creating 2 clusters for patching, we should append iterator number (i.e i ) in cluster name rather than 'idx', which is always 0 (to avoid creating duplicate cluster)
- Name(fmt.Sprintf("perf-%s-%d", id, idx)).
+ Name(fmt.Sprintf("perf-%s-%d", id, i)).

4. fakeClusterProps are overriden by rosaCreatorProps while passing it to cluster create method. So better merge fakeClusterProps inside rosaCreatorProps instead of passing "Properties" twice .
Cluster(v1.NewCluster().
Name(fmt.Sprintf("perf-%s-%d", id, idx)).
AWS(
v1.NewAWS().
AccessKeyID(ccsAccessKey).
SecretAccessKey(ccsSecretKey).
AccountID(ccsAccountID),
).
Nodes(v1.NewClusterNodes().AvailabilityZones(fmt.Sprintf("%sa", ccsRegion))).
Properties(fakeClusterProps).
Properties(rosaCreatorProps).
Region(v1.NewCloudRegion().ID(ccsRegion))).

5. Avoid passing service and cluster arguments for PATCH method as ocm-managed-services validations are not accepting them i.e only pass Parameters
body, err := v1.NewManagedService().
Parameters(v1.NewServiceParameter().ID("has-external-resources").Value("false")).
Build()

However after all these changes, patching is failing as patching is allowed only when service is in "waiting for addon" state. But our service is stuck in 'waiting for cluster' state as cluster is a fake-cluster and will be in always in "installing" state. We also can't patch cluster state as ocm validations won't allow it. We need to check with ocm team regarding this issue.

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.