-
Notifications
You must be signed in to change notification settings - Fork 215
OWLS 86406: WKO - scaling with webhook invoked from Prometheus not working #2106
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
Conversation
Merge latest from develop
|
Jenkins run on kind cluster for ItParameterizedDomain integration test as it's the only test that scales the cluster using WLDF and scalingAction.sh script: https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/3361/ |
russgold
left a comment
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.
General comment: now that we have the capability of writing unit tests for bash (see operator/src/test/sh/modelInImageTest.sh for an example), please consider adding unit tests for this changed functionality as well.
| -x509 \ | ||
| -days ${DAYS_VALID} \ | ||
| -out ${OP_CERT_PEM} \ | ||
| -subj "/C=US/ST=CALIFORNIA/L=REDWOOD CITY/O=WebLogic/OU=Development/CN=weblogic-operator" \ |
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.
Ha, ha... Austin, TX. (Don't bother making that change -- I just found it funny that you chose California)
|
@russgold, we probably need to have you give a brown-bag on the shell script unit-testing work that you did. This is a single script with (generally) a singular purpose and it is still fairly complex. It will likely be a significant effort to get it fully unit-tested and I'm not sure where we would start. |
|
I've created the following JIRA for creating unit test for scalingAction.sh using the shell script unit-testing framework Russ implemented. |
| --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \ | ||
| -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \ | ||
| -X GET \ | ||
| $kubernetes_master/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/domains.weblogic.oracle) |
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.
This URL path is wrong for K8s 1.16 and above as CRD's graduated from "v1beta1" to "v1". You could either determine the version of the k8s master or I have another idea. If you curl the "$kubernetes_master/apis" path, you get back a list of all API's supported by the server. This is equivalent to kubectl api-versions. The code could pick out the highest version of "weblogic.oracle" returned. For instance, on my system I get back "weblogic.oracle/v7" and "weblogic.oracle/v8".
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.
We need to test on k8s 1.16 -- it's likely that I'm wrong that this is broken now as 1.16 probably honors the "v1beta1" path. If so, that will be dropped in some k8s release -- I'll try and figure out which one.
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 found the answer... Your current code will work until k8s 1.22.
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.
"v1beta1" is still honored as I'm running 1.18.12:
bash-4.2$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.12", GitCommit:"7cd5e9086de8ae25d6a1514d0c87bac67ca4a481", GitTreeState:"clean", BuildDate:"2020-11-12T09:18:55Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.12", GitCommit:"7cd5e9086de8ae25d6a1514d0c87bac67ca4a481", GitTreeState:"clean", BuildDate:"2020-11-12T09:11:15Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
This PR contains the following changes: