-
Notifications
You must be signed in to change notification settings - Fork 403
Add namespaced ui-api-acceptance tests #1132
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 namespaced ui-api-acceptance tests #1132
Conversation
3404666
to
c03ae14
Compare
11b4164
to
24a6194
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.
Please use everywhere full names for resources, e.g.: clusterServiceClass
, serviceClass
,
the same thing with brokers
@@ -40,11 +40,11 @@ type ClusterServiceClass struct { | |||
content map[string]interface{} | |||
} | |||
|
|||
type classesQueryResponse struct { | |||
type clusterClassesQueryResponse struct { |
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.
I'd use full name: clusterServiceClass & serviceClass everywhere
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.
Done
|
||
log.Printf("Broker %s still not ready. Waiting...\n", brokerName) | ||
arr := broker.Status.Conditions |
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.
I think this fragment can be extracted:
for _, v := range arr {
if v.Type == "Ready" {
return v.Status == "True", nil
}
}
log.Printf("%s %s still not ready. Waiting...\n", typeOfBroker, brokerName)
Because in brokers there is the same CommonServiceBrokerStatus
type.
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.
Done. I changed this function to:
func checkStatusOfBroker(conditions []v1beta1.ServiceBrokerCondition) bool {
for _, v := range conditions {
if v.Type == "Ready" {
return v.Status == "True"
}
}
return false
}
func waitForBroker(brokerName, typeOfBroker string, svcatCli *clientset.Clientset) error {
return waiter.WaitAtMost(func() (bool, error) {
var conditions []v1beta1.ServiceBrokerCondition
if typeOfBroker == tester.ClusterServiceBroker {
broker, err := svcatCli.ServicecatalogV1beta1().ClusterServiceBrokers().Get(brokerName, metav1.GetOptions{})
if err != nil || broker == nil {
return false, err
}
conditions = broker.Status.Conditions
} else {
broker, err := svcatCli.ServicecatalogV1beta1().ServiceBrokers(tester.DefaultNamespace).Get(brokerName, metav1.GetOptions{})
if err != nil || broker == nil {
return false, err
}
conditions = broker.Status.Conditions
}
if checkStatusOfBroker(conditions) {
return true, nil
}
log.Printf("%s %s still not ready. Waiting...\n", typeOfBroker, brokerName)
return false, nil
}, brokerReadyTimeout)
}
24a6194
to
8ed2fd5
Compare
21798cf
to
e68ae49
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
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.
Please edit ClusterRole to include servicebroker privilege.
2018/10/08 07:40:44 servicebrokers.servicecatalog.k8s.io "ups-broker" is forbidden: User "system:serviceaccount:kyma-system:test-core-core-ui-api-acceptance" cannot get servicebrokers.servicecatalog.k8s.io in the namespace "ui-api-acceptance"
e68ae49
to
8911ff7
Compare
8911ff7
to
c3d6860
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
require.NoError(t, err) | ||
|
||
expectedResource := broker() | ||
resourceDetailsQuery := ` |
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.
Fix indents.
c3d6860
to
d83ae76
Compare
d83ae76
to
2c38b5c
Compare
* exit script, if version is not set, do not continue installer
Description
Changes proposed in this pull request:
serviceBrokers
to ClusterRoleRelated issue(s)
See also #952