Skip to content

add affinity to domain resource spec #151

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

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

CarolynRountree
Copy link
Contributor

Fixes Jira #355

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 5, 2022

serverPod.affinity = _getAffinityForServerPod(100);

return Object.keys(serverPod).length > 0 ? serverPod : null;
Copy link
Member

@robertpatrick robertpatrick Aug 6, 2022

Choose a reason for hiding this comment

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

Why duplicate all the code from _getServerPod() just to add one line? Why not just do something like this?

function getServerPodForCluster(cluster) {
    const serverPod = _getServerPod(getJavaOptionsForCluster(cluster), getUserMemArgsForCluster(cluster), getKubernetesResourcesForCluster(cluster)) || {};
    
    const affinity = _getAffinityForServerPod(100);
    if (affinity) {
        serverPod.affinity = affinity;
    }     
    return Object.keys(serverPod).length > 0 ? serverPod : null;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Server Pod might be empty, and I did not know how to add const serverPod = {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved code per suggestions

@robertpatrick robertpatrick merged commit c62a005 into main Aug 8, 2022
@robertpatrick robertpatrick deleted the WKTUI-355-Add-affinity-to-spec branch August 8, 2022 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants