Skip to content

Conversation

@lennyphan
Copy link
Member

This PR contains the following changes:

  1. Changes to scalingAction.sh for creating temporary per request python scripts for processing JSON results from K8s API requests. These changes were for OFSS scaling.
  2. Support in scalingAction.sh to use 'jq' to parse JSON when running on oraclelinux:8-slim, since python is not included.
  3. Change to initialize-internal-operator-identity.sh to use openssl, instead of keytool, for generating private key and self-signed certificate for the operator's internal REST endpoint. curl clients running on oraclelinux:8-slim would fail verification of the keytool generated self-signed certificate.

@lennyphan
Copy link
Member Author

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/

Copy link
Contributor

@russgold russgold left a 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" \
Copy link
Member

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)

@rjeberhard
Copy link
Member

@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.

@lennyphan
Copy link
Member Author

lennyphan commented Dec 17, 2020

I've created the following JIRA for creating unit test for scalingAction.sh using the shell script unit-testing framework Russ implemented.

https://jira.****/jira/browse/OWLS-86589

@lennyphan lennyphan requested a review from tbarnes-us December 17, 2020 19:03
--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)
Copy link
Member

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".

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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"}

@rjeberhard rjeberhard merged commit 91b6dcb into develop Dec 17, 2020
@rjeberhard rjeberhard deleted the OWLS-86406 branch January 5, 2021 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants