Skip to content
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

migrate code from googleapis/nodejs-cloud-container #2860

Merged
merged 81 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
7e030f9
new generated code, updating version to 0.8.0
alexander-fenster Dec 13, 2017
b76c71c
Better readme and quickstart (#4)
alexander-fenster Dec 15, 2017
f8cef60
Upgrade repo-tools and regenerate scaffolding. (#19)
jmdobry Mar 16, 2018
8fdfa1d
v0.2.0 (#20)
callmehiphop May 1, 2018
3624d62
chore: lock files maintenance (#24)
alexander-fenster May 2, 2018
e69609a
chore: lock files maintenance (#26)
alexander-fenster May 8, 2018
96933e0
chore: lock files maintenance (#29)
alexander-fenster May 22, 2018
46439dd
chore: update sample lockfiles (#38)
JustinBeckwith Jun 25, 2018
fc1e121
chore(deps): update dependency @google-cloud/nodejs-repo-tools to v2.…
renovate[bot] Jun 27, 2018
d8a569f
chore(deps): lock file maintenance (#44)
renovate[bot] Jul 3, 2018
67490bd
chore(deps): lock file maintenance (#47)
renovate[bot] Jul 10, 2018
71965ba
fix: drop support for node.js 4.x and 9.x (#46)
JustinBeckwith Jul 10, 2018
6f3eeed
chore(deps): lock file maintenance (#48)
renovate[bot] Jul 10, 2018
1521be5
chore(deps): lock file maintenance (#49)
renovate[bot] Jul 10, 2018
1e8c226
chore(deps): lock file maintenance (#51)
renovate[bot] Jul 17, 2018
cff18f7
chore(deps): lock file maintenance (#54)
renovate[bot] Jul 24, 2018
6d8ca63
chore: require node 8 for samples (#56)
JustinBeckwith Jul 30, 2018
4225718
chore(deps): lock file maintenance (#57)
renovate[bot] Jul 31, 2018
2af8bf2
chore(deps): lock file maintenance (#61)
renovate[bot] Aug 7, 2018
eee6ae9
chore: ignore package-lock.json (#63)
JustinBeckwith Aug 7, 2018
bf3d276
Remove unused dependencies (#72)
JustinBeckwith Sep 5, 2018
90f1afe
chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 …
renovate[bot] Nov 10, 2018
feb5dfd
docs(samples): updated samples code to use async await (#122)
praveenqlogic Nov 22, 2018
34b0845
Release v0.3.0 (#141)
jkwlui Dec 11, 2018
a828aed
test: add sample tests (#143)
JustinBeckwith Dec 17, 2018
659bab4
chore(deps): update dependency mocha to v6
renovate[bot] Feb 19, 2019
f5d893c
Release v0.3.1 (#168)
JustinBeckwith Mar 12, 2019
0e085b8
refactor: use execSync for tests (#176)
JustinBeckwith Apr 4, 2019
2bdf71b
refactor: wrap execSync with encoding: utf-8 (#177)
jkwlui Apr 5, 2019
cb365bd
chore: release 1.0.0 (#193)
bcoe May 13, 2019
601afd5
refactor: use repo-metadata to generate readme (#196)
JustinBeckwith May 21, 2019
8471870
chore: release 1.1.0 (#204)
yoshi-automation Jun 5, 2019
0ae618e
chore: release 1.1.1 (#206)
yoshi-automation Jun 14, 2019
e6c1d5a
chore: release 1.1.2 (#209)
yoshi-automation Jun 21, 2019
d2f8659
chore: release 1.1.3 (#211)
yoshi-automation Jun 26, 2019
7f2f8e9
chore: release 1.1.4 (#222)
yoshi-automation Aug 28, 2019
9c8bc2d
chore: release 1.2.0 (#225)
yoshi-automation Sep 16, 2019
db18e23
chore: release 1.3.1 (#241)
release-please[bot] Oct 22, 2019
480662c
chore: release 1.4.0 (#248)
release-please[bot] Nov 15, 2019
c53593d
chore: update license headers
JustinBeckwith Nov 25, 2019
d0957e9
refactor: use explicit mocha imports
JustinBeckwith Dec 30, 2019
c26e681
chore(deps): update dependency mocha to v7 (#269)
renovate-bot Jan 6, 2020
5b951e8
chore: release 1.5.0
release-please[bot] Jan 6, 2020
d669f91
chore: release 1.6.0 (#274)
release-please[bot] Jan 28, 2020
fbcdd08
chore: release 1.6.1 (#278)
release-please[bot] Jan 28, 2020
a485fd3
chore: release 1.6.2 (#287)
release-please[bot] Feb 10, 2020
5d8852f
chore: release 1.7.0 (#296)
release-please[bot] Mar 12, 2020
6bd138f
chore: release 2.0.0 (#319)
release-please[bot] Jun 4, 2020
f9f807f
chore(deps): update dependency mocha to v8 (#349)
renovate-bot Jun 11, 2020
5b091e7
chore: release 2.1.0 (#348)
release-please[bot] Jun 16, 2020
2ebafbf
chore: release 2.1.1 (#359)
release-please[bot] Jul 10, 2020
a0f6fac
chore: release 2.1.2 (#399)
release-please[bot] Nov 11, 2020
7d35cfa
chore: release 2.2.0 (#402)
release-please[bot] Dec 2, 2020
d4a236c
chore: release 2.2.1 (#432)
release-please[bot] May 13, 2021
1cd4455
chore: release 2.2.2 (#442)
release-please[bot] May 25, 2021
0e5378b
chore: release 2.3.0 (#447)
release-please[bot] Jun 9, 2021
9e05878
chore: release 2.3.1 (#456)
release-please[bot] Jun 28, 2021
fc3dd4d
chore: release 2.3.2 (#461)
release-please[bot] Jun 30, 2021
19aa565
chore: release 2.4.0 (#465)
release-please[bot] Jul 9, 2021
b3e0e95
chore: release 2.4.1 (#467)
release-please[bot] Jul 12, 2021
3874c42
chore: release 2.4.2 (#469)
release-please[bot] Jul 16, 2021
7ac2803
chore: release 2.4.3 (#478)
release-please[bot] Aug 16, 2021
07d8f0d
chore: release 2.4.4 (#479)
release-please[bot] Aug 17, 2021
702a0d9
chore: release 2.5.0 (#481)
release-please[bot] Aug 23, 2021
886389b
docs(samples): add auto-generated Node samples (#488)
gcf-owl-bot[bot] Sep 24, 2021
a558ab2
chore: release 2.6.0 (#498)
release-please[bot] Dec 9, 2021
535ab10
docs(samples): add usage samples to show handling of LRO response Ope…
Shabirmean Feb 17, 2022
d2d4e2e
chore(main): release 3.0.0 (#511)
release-please[bot] Feb 26, 2022
109d6a8
chore(main): release 3.0.1 (#529)
release-please[bot] May 6, 2022
20378c8
build!: update library to use Node 12 (#539)
sofisl May 20, 2022
cca9031
chore(main): release 4.0.0 (#540)
release-please[bot] May 24, 2022
ad7e7e0
chore(main): release 4.0.1 (#542)
release-please[bot] Jun 20, 2022
7200b8a
chore(main): release 4.1.0 (#550)
release-please[bot] Jul 4, 2022
9b95420
chore(main): release 4.1.1 (#559)
release-please[bot] Aug 29, 2022
7b591e7
chore(main): release 4.1.2 (#565)
release-please[bot] Sep 8, 2022
a1c4e20
fix(deps): update dependency uuid to v9 (#564)
renovate-bot Sep 8, 2022
92fa86a
chore(main): release 4.1.3 (#566)
release-please[bot] Sep 14, 2022
5efe9ba
chore(main): release 4.2.0 (#569)
release-please[bot] Sep 26, 2022
eb83cc6
chore(main): release 4.3.0 (#579)
release-please[bot] Oct 17, 2022
4289171
chore(main): release 4.4.0 (#584)
release-please[bot] Nov 11, 2022
65a1503
testing: add github workflow for container snippet testing
grayside Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/container-snippets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: container-snippets
on:
push:
branches:
- main
paths:
- 'container/snippets/**'
pull_request:
paths:
- 'container/snippets/**'
pull_request_target:
types: [labeled]
paths:
- 'container/snippets/**'
schedule:
- cron: '0 0 * * 0'
jobs:
test:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: actions/checkout@v3.1.0
with:
ref: ${{github.event.pull_request.head.sha}}
- uses: 'google-github-actions/auth@v1.0.0'
with:
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com'
create_credentials_file: 'true'
access_token_lifetime: 600s
- uses: actions/setup-node@v3.5.1
with:
node-version: 16
- run: npm install
working-directory: container/snippets
- run: npm test
working-directory: container/snippets
env:
MOCHA_REPORTER_SUITENAME: container_snippets
MOCHA_REPORTER_OUTPUT: container_snippets_sponge_log.xml
MOCHA_REPORTER: xunit
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
try {
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: 'GoogleCloudPlatform',
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
} catch (e) {
if (!e.message.includes('Label does not exist')) {
throw e;
}
}
- if: ${{ github.event_name == 'schedule'}}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
chmod +x ./flakybot
./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
1 change: 1 addition & 0 deletions .github/workflows/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"composer/functions/composer-storage-trigger",
"container-analysis/snippets",
"containerengine/hello-world",
"container/snippets",
"datacatalog/cloud-client",
"datalabeling",
"datastore/functions",
Expand Down
24 changes: 24 additions & 0 deletions container/snippets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "nodejs-docs-samples-container",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
"node": ">=12.0.0"
},
"repository": "googleapis/nodejs-cloud-container",
"private": true,
"files": [
"*.js"
],
"scripts": {
"test": "mocha system-test --timeout 1000000"
},
"dependencies": {
"@google-cloud/container": "^4.4.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^8.0.0"
}
}
41 changes: 41 additions & 0 deletions container/snippets/quickstart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2017 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

// [START gke_list_cluster]
async function main() {
// [START container_quickstart]
ace-n marked this conversation as resolved.
Show resolved Hide resolved
const container = require('@google-cloud/container');

// Create the Cluster Manager Client
const client = new container.v1.ClusterManagerClient();

async function quickstart() {
const zone = 'us-central1-a';
const projectId = await client.getProjectId();
const request = {
projectId: projectId,
zone: zone,
};

const [response] = await client.listClusters(request);
console.log('Clusters: ', response);
}
quickstart();
// [END container_quickstart]
}

main().catch(console.error);
// [END gke_list_cluster]
Copy link
Contributor

Choose a reason for hiding this comment

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

This region tag seems unused

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The other region tag is used, I'm trying not to modify samples unless necessary to pass tests.

28 changes: 28 additions & 0 deletions container/snippets/system-test/quicktest.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2017 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

const {assert} = require('chai');
const {describe, it} = require('mocha');
const cp = require('child_process');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

describe('container samples - quickstart', () => {
it('should run the quickstart', async () => {
const stdout = execSync('node quickstart');
assert.match(stdout, /Clusters:/);
});
});