diff --git a/README.md b/README.md index 7177496..2759edf 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ It's recommended to build this project from source code. The code is extremely s If you run it in **k8s**, you need to **link a service account** to the pod in order to read the logs of other pods. -If you run it **locally**, you need to **specify the kubeconfig file path** in `pkg/k8s.go`. +If you run it **locally**, you need to **specify the kubeconfig file path** in `pkg/k8s.go`. In `pkg/model.go`, you can config the namespace **white list** for safety. It's a regular expression list. By default, it's `".*"`, which means **all namespaces are allowed.** @@ -48,20 +48,20 @@ limit set in the server, default is 100. > example client code ```typescript -const socket = new WebSocket("localhost:8080"); // 创建一个 Socket 实例 +const socket = new WebSocket("localhost:8080"); // 创建一个 Socket 实例 let data: any = { - "mode": "pod", - "namespace":"default", - "workload":"nginx-7db9fccd9f-4q9q2", - "tailLines":100 -} + mode: "pod", + namespace: "default", + workload: "nginx-7db9fccd9f-4q9q2", + tailLines: 100, +}; socket.onopen = function () { socket.send(JSON.stringify(data)); // 发送数据 -} +}; -// +// socket.onmessage = function (msg) { - console.log(msg) -} -``` \ No newline at end of file + console.log(msg); +}; +``` diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eae241f..19c8655 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,7 +13,7 @@ resources: pool: "Azure Pipelines" variables: - image-repo: 'bupt2018/log-transfer' + image-repo: "bupt2018/log-transfer" stages: - stage: BuildAndPush @@ -29,13 +29,8 @@ stages: - task: Docker@2 inputs: - containerRegistry: 'ACR' + containerRegistry: "ACR" repository: "$(image-repo)" - command: 'buildAndPush' - tags: '$(Build.BuildNumber)-$(SHORT_COMMIT)' - Dockerfile: '**/Dockerfile' - -# - script: | -# curl --location --request PUT --X PUT 'http://cd.bupt.site:30303/api/v1/deployments' --header 'Content-Type: application/json' --header 'key: kAmAbNuzrilmUjcrjsZtOoMcenqoKdQpVeOHVEvpGCBoqxoEQcHOgFIHLzEHJAUU' --header 'value: token-wanz-ws-log-transfer-container-0-3e1f9cc2' --data '{ "namespace":"wanz","deployment":"ws-log-transfer","container": "container-0","image": "registry.cn-beijing.aliyuncs.com/$(image-repo):$(Build.BuildNumber)-$(SHORT_COMMIT)"}' -# displayName: 'send curl' - + command: "buildAndPush" + tags: "$(Build.BuildNumber)-$(SHORT_COMMIT)" + Dockerfile: "**/Dockerfile"