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

Add Version to /healthz endpoint #1120

Closed
wants to merge 7 commits into from

Conversation

nitrocode
Copy link
Member

Closes #1119

server/server.go Outdated Show resolved Hide resolved
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, one more change to use snake_case.

Also I missed this but we talked about it being on /status not /healthz

server/server.go Outdated Show resolved Hide resolved
server/server_test.go Outdated Show resolved Hide resolved
nitrocode and others added 2 commits July 27, 2020 19:31
Co-authored-by: Luke Kysow <1034429+lkysow@users.noreply.github.com>
Co-authored-by: Luke Kysow <1034429+lkysow@users.noreply.github.com>
@nitrocode
Copy link
Member Author

Hm I'd like to put the changes in the StatusController and see this file but it doesn't have access to the Server. How would I go about moving these changes from the /healthz endpoint to the /status endpoint?

func (d *StatusController) Get(w http.ResponseWriter, r *http.Request) {

Sorry. I'm a bit of a golang noob.

@lkysow
Copy link
Member

lkysow commented Jul 28, 2020

No worries, so you'll need to add AtlantisVersion string as a field on the StatusController struct. Then pass it in in server/server.go where it's instantiated:

	statusController := &StatusController{
		Logger:  logger,
		Drainer: drainer,
		AtlantisVersion: config.AtlantisVersion,
	}

The in the status_controller it will be available on the struct pointer, e.g.

	data, err := json.MarshalIndent(&StatusResponse{
		ShuttingDown:  status.ShuttingDown,
		InProgressOps: status.InProgressOps,
		AtlantisVersion: d.AtlantisVersion,
	}, "", "  ")

@lkysow lkysow added the waiting-on-response Waiting for a response from the user label Aug 18, 2020
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 30, 2021
@github-actions github-actions bot closed this Feb 5, 2021
@nitrocode nitrocode deleted the patch-1 branch January 26, 2023 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-response Waiting for a response from the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return atlantis version when hitting /status
2 participants