Skip to content

Commit b9db947

Browse files
committed
1.2.0
1 parent 6682f24 commit b9db947

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

dist/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44495,24 +44495,28 @@ function configureKubectl() {
4449544495
const fingerprint = process.env.OCI_CLI_FINGERPRINT || '';
4449644496
const privateKey = process.env.OCI_CLI_KEY_CONTENT || '';
4449744497
const region = oci_common__WEBPACK_IMPORTED_MODULE_7__.Region.fromRegionId(process.env.OCI_CLI_REGION || '');
44498+
// Inputs
44499+
const clusterOCID = _actions_core__WEBPACK_IMPORTED_MODULE_3__.getInput('cluster', { required: true });
44500+
const enablePrivateEndpoint = _actions_core__WEBPACK_IMPORTED_MODULE_3__.getInput('enablePrivateEndpoint').toLowerCase() === 'true';
4449844501
const authProvider = new oci_common__WEBPACK_IMPORTED_MODULE_7__.SimpleAuthenticationDetailsProvider(tenancy, user, fingerprint, privateKey, null, region);
4449944502
const ceClient = new oci_containerengine__WEBPACK_IMPORTED_MODULE_6__.ContainerEngineClient({
4450044503
authenticationDetailsProvider: authProvider
4450144504
});
4450244505
const oke = (yield ceClient.getCluster({
44503-
clusterId: _actions_core__WEBPACK_IMPORTED_MODULE_3__.getInput('cluster', { required: true })
44506+
clusterId: clusterOCID
4450444507
})).cluster;
4450544508
if (oke &&
4450644509
oke.id &&
4450744510
oke.kubernetesVersion &&
44508-
((_a = oke.endpointConfig) === null || _a === void 0 ? void 0 : _a.isPublicIpEnabled)) {
44511+
(((_a = oke.endpointConfig) === null || _a === void 0 ? void 0 : _a.isPublicIpEnabled) || enablePrivateEndpoint)) {
4450944512
const kubectlPath = yield getKubectl(oke.kubernetesVersion);
4451044513
_actions_core__WEBPACK_IMPORTED_MODULE_3__.addPath(kubectlPath);
44514+
const clusterEndpoint = oci_containerengine__WEBPACK_IMPORTED_MODULE_6__.models.CreateClusterKubeconfigContentDetails.Endpoint;
4451144515
const kubeconfig = yield (0,oci_common__WEBPACK_IMPORTED_MODULE_7__.getStringFromResponseBody)((yield ceClient.createKubeconfig({
4451244516
clusterId: oke.id,
4451344517
createClusterKubeconfigContentDetails: {
4451444518
tokenVersion: '2.0.0',
44515-
endpoint: oci_containerengine__WEBPACK_IMPORTED_MODULE_6__.models.CreateClusterKubeconfigContentDetails.Endpoint.PublicEndpoint
44519+
endpoint: enablePrivateEndpoint ? clusterEndpoint.PrivateEndpoint : clusterEndpoint.PublicEndpoint
4451644520
}
4451744521
})).value);
4451844522
const kubeconfigPath = path__WEBPACK_IMPORTED_MODULE_2__.join(os__WEBPACK_IMPORTED_MODULE_1__.homedir(), '.kube');

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oracle-actions/configure-kubectl-oke",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"author": {
55
"name": "Oracle Cloud Infrastructure",
66
"email": "[email protected]"

0 commit comments

Comments
 (0)