-
Notifications
You must be signed in to change notification settings - Fork 6
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
Set db-operator version on database CR during full reconcile #107
Conversation
I'm not sure if I should add more error handling when I split the image tag. What do you think? |
01ca735
to
9552244
Compare
I was thinking about something like that https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications It doesn't seem right to me that dbo will have to recieve data about itself from the k8s api. Fithermore, it doesn't have to be running in k8s |
Ah I didn't know that possibility existed. Not an issue, I will implement this. 🙂 Do you mean it could also run on Openshift or what did you have in mind? |
In general, it should be possible to run it as a bin pointing to k8s from outside |
9552244
to
87d9e23
Compare
Does this go in the right direction? |
Yep, it looks better to me, but I would put it to the status, not the spec |
5b13653
to
bfd5cb7
Compare
Fixed here and in the chart repository. If you want, you can test the image using this build target in the Makefile,. build: ## Build a container
$(CONTAINER_TOOL) build ${CONTAINER_TOOL_ARGS} -t ${IMAGE_TAG} . ${CONTAINER_TOOL_NAMESPACE_ARG} --build-arg="VERSION=v1.23.0" |
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 would replace version
to operatorVersion
Also I'm not sure if the common helper is a good place for storing the var, but I can't find a better one, so I'm alright with that
I renamed the variable but had issues running Are you fine with me updating the codebase and Github workflows to 1.22.1? After the controller-gen update the generated CRDs have a little different syntax for descriptions. |
Yep, why not. Let's upgrade |
bfd5cb7
to
142aff7
Compare
8146289
to
2f93bd6
Compare
2f93bd6
to
97db9cb
Compare
97db9cb
to
72ac8c9
Compare
I applied the necessary changes for the 1.22.1 update, renamed the variable to |
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.
Thanks, it looks good to me now
The change is rather simple. I retrieve the pod db-operator runs in and extract the version from the image tag. I had to add a new
POD_NAMESPACE
environment variable to the db-operator deployment manifest so I can fetch the pod from the cluster.