-
Notifications
You must be signed in to change notification settings - Fork 4
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
wip: ODS-xxxx expose dashboard 8080 and curl to it #52
Conversation
It runs...
|
static final Logger LOGGER = LoggerFactory.getLogger(DataScienceDashboardST.class); | ||
|
||
@Test | ||
void checkDataScienceProjects() throws IOException, InterruptedException { |
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.
@Tag("ODS-1860")
?
service.edit().editSpec().removeFromPorts(port1, port2).endSpec().build(); | ||
kubeClient.routes().resource(route).delete(); |
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.
LOGGER.debug("Making request {}", request); | ||
HttpClient httpClient = HttpClient.newHttpClient(); | ||
HttpResponse<Void> response = httpClient.send(request, HttpResponse.BodyHandlers.discarding()); | ||
LOGGER.debug("Got response {}", response); |
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.
Regarding the test scenario itself. Maybe run this curl directly in the container the service is fronting? Or put my own container that contains curl
there, and don't expose any routes...?
19fe509
to
d67ac1a
Compare
oc patch -n redhat-ods-applications service rhods-dashboard -p '{"spec": {"ports": [{"name": "8443-tcp", "protocol": "TCP", "port": 8443, "targetPort": 8443}]}}'
oc patch -n redhat-ods-applications service rhods-dashboard -p '{"spec": {"ports": [{"name": "8080-tcp", "protocol": "TCP", "port": 8080, "targetPort": 8080}]}}'
We can see the service conf with this command:
oc get -n redhat-ods-applications service rhods-dashboard -o json
oc apply -f rhods-dashboard-internal-route.yaml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: rhods-dashboard-internal
namespace: redhat-ods-applications
labels:
app: rhods-dashboard
app.kubernetes.io/part-of: rhods-dashboard
spec:
port:
targetPort: 8080-tcp
to:
kind: Service
name: rhods-dashboard
wildcardPolicy: None
curl --location --request GET 'http://rhods-dashboard-internal-redhat-ods-applications.apps.{cluster_name}.xxx.com/api/status' --header 'x-forwarded-access-token: asdfadsfasd'
Verify response status code is error 401, similar to this:
{"statusCode":401,"code":"401","error":"Unauthorized","message":"Failed to retrieve username: Error getting Oauth Info for user, Unauthorized"}
Note: in RHODS 1.18 and before, the response was error 500, provoking alert RHODS Dashboard Route Error to fire
{"statusCode":500,"code":"500","error":"Internal Server Error","message":"Failed to retrieve username: Error getting Oauth Info for user, undefined - HTTP request failed"}
oc delete route rhods-dashboard-internal -n redhat-ods-applications