Skip to content

Commit

Permalink
RHIROS-1341 fix sorting for workload type (#140)
Browse files Browse the repository at this point in the history
* Remove make local-upload-data and update get-recommendations
  • Loading branch information
srdeotarse authored Nov 2, 2023
1 parent 02f1395 commit f44fa63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ endif
.PHONY: golangci-lint
GOLANGCILINT := $(LOCALBIN)/golangci-lint
GOLANGCI_URL := https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
start_date := 1970-01-01

golangci-lint: $(LOCALBIN)
ifeq (,$(wildcard $(GOLANGCILINT)))
@ echo "📥 Downloading golangci-lint"
Expand Down Expand Up @@ -105,22 +107,16 @@ else
@ echo "Env not defined"
endif

local-upload-data:
curl -vvvv -F "upload=@$(file);type=application/application/vnd.redhat.hccm.tar+tgz" \
-H "x-rh-identity: ${b64_identity}" \
-H "x-rh-request_id: testtesttest" \
http://localhost:${INGRESS_PORT}/api/ingress/v1/upload

upload-msg-to-rosocp:
echo ${ros_ocp_msg} | docker-compose -f scripts/docker-compose.yml exec -T kafka kafka-console-producer --topic hccm.ros.events --broker-list localhost:29092


get-recommendations:
ifdef env
$(eval APIPOD=$(shell oc get pods -o custom-columns=POD:.metadata.name --no-headers -n ${env} | grep ros-ocp-backend-api))
oc exec ${APIPOD} -c ros-ocp-backend-api -n ${env} -- /bin/bash -c 'curl -s -H "X-Rh-Identity: ${b64_identity}" -H "x-rh-request_id: testtesttest" http://localhost:8000/api/cost-management/v1/recommendations/openshift' | python -m json.tool
oc exec ${APIPOD} -c ros-ocp-backend-api -n ${env} -- /bin/bash -c 'curl -s -H "X-Rh-Identity: ${b64_identity}" -H "x-rh-request_id: testtesttest" http://localhost:8000/api/cost-management/v1/recommendations/openshift?start_date=${start_date}' | python -m json.tool
else
curl -s -H "x-rh-identity: ${b64_identity}" \
-H "x-rh-request_id: testtesttest" \
http://localhost:8000/api/cost-management/v1/recommendations/openshift | python -m json.tool
http://localhost:8000/api/cost-management/v1/recommendations/openshift?start_date=${start_date} | python -m json.tool
endif
2 changes: 1 addition & 1 deletion migrations/000003_create_workloads_table.up.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TYPE workloadtype AS ENUM ('deployment', 'deploymentconfig', 'replicaset', 'replicationcontroller', 'statefulset', 'daemonset');
CREATE TYPE workloadtype AS ENUM ('daemonset', 'deployment', 'deploymentconfig', 'replicaset', 'replicationcontroller', 'statefulset');

CREATE TABLE IF NOT EXISTS workloads(
id BIGSERIAL PRIMARY KEY,
Expand Down

0 comments on commit f44fa63

Please sign in to comment.