Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
q15971095971 committed Jun 28, 2024
2 parents 020ccb1 + 68bf296 commit 9f711e4
Show file tree
Hide file tree
Showing 32 changed files with 418 additions and 245 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pr-lint
on: [pull_request]
jobs:
PR-format-check:
runs-on: ubuntu-latest
steps:
- name: Check PR naming convention
run: |
title="${{ github.event.pull_request.title }}"
pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*"
if [[ ! $title =~ $pattern ]]; then
echo "PR title does not match naming convention. Example: 'feat: 添加新功能'.\
You can refer to this address for details:\
https://github.com/TencentBlueKing/bk-bcs/blob/master/docs/specification/commit-spec.md"
exit 1
fi
60 changes: 60 additions & 0 deletions bcs-ops/env/offline-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,63 @@ bcs-ops:
- hub.bktencent.com/alpine/helm:3.7.2
- hub.bktencent.com/registry.k8s.io/ingress-nginx/controller:v1.3.1
- hub.bktencent.com/registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.3.0

- version: "1.27.15"
bin-tools:
k8s: "1.27.15"
cni-plugins: "1.3.0"
crictl: "1.24.2"
containerd: "1.6.21"
runc: "1.1.8"
jq: "1.6"
yq: "4.30.6"

images:
- hub.bktencent.com/registry.k8s.io/kube-apiserver:v1.27.15
- hub.bktencent.com/registry.k8s.io/kube-controller-manager:v1.27.15
- hub.bktencent.com/registry.k8s.io/kube-scheduler:v1.27.15
- hub.bktencent.com/registry.k8s.io/kube-proxy:v1.27.15
- hub.bktencent.com/registry.k8s.io/pause:3.9
- hub.bktencent.com/registry.k8s.io/etcd:3.5.12-0
- hub.bktencent.com/registry.k8s.io/coredns:v1.10.1
- hub.bktencent.com/library/hello-world:latest
- hub.bktencent.com/flannel/flannel-cni-plugin:v1.1.2
- hub.bktencent.com/flannel/flannel:v0.22.0
- hub.bktencent.com/k8s.gcr.io/sig-storage/local-volume-provisioner:v2.4.0
- hub.bktencent.com/registry.k8s.io/metrics-server/metrics-server:v0.6.3
- hub.bktencent.com/registry.k8s.io/multus-cni:snapshot
- hub.bktencent.com/registry.k8s.io/kube-vip:v0.5.12
- hub.bktencent.com/blueking/bcs-apiserver-proxy:v1.29.0-alpha.130-tencent
- hub.bktencent.com/alpine/helm:3.7.2
- hub.bktencent.com/registry.k8s.io/ingress-nginx/controller:v1.3.1
- hub.bktencent.com/registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.3.0

- version: "1.28.11"
bin-tools:
k8s: "1.28.11"
cni-plugins: "1.3.0"
crictl: "1.24.2"
containerd: "1.6.21"
runc: "1.1.8"
jq: "1.6"
yq: "4.30.6"

images:
- hub.bktencent.com/registry.k8s.io/kube-apiserver:v1.28.11
- hub.bktencent.com/registry.k8s.io/kube-controller-manager:v1.28.11
- hub.bktencent.com/registry.k8s.io/kube-scheduler:v1.28.11
- hub.bktencent.com/registry.k8s.io/kube-proxy:v1.28.11
- hub.bktencent.com/registry.k8s.io/pause:3.9
- hub.bktencent.com/registry.k8s.io/etcd:3.5.12-0
- hub.bktencent.com/registry.k8s.io/coredns:v1.10.1
- hub.bktencent.com/library/hello-world:latest
- hub.bktencent.com/flannel/flannel-cni-plugin:v1.1.2
- hub.bktencent.com/flannel/flannel:v0.22.0
- hub.bktencent.com/k8s.gcr.io/sig-storage/local-volume-provisioner:v2.4.0
- hub.bktencent.com/registry.k8s.io/metrics-server/metrics-server:v0.6.3
- hub.bktencent.com/registry.k8s.io/multus-cni:snapshot
- hub.bktencent.com/registry.k8s.io/kube-vip:v0.5.12
- hub.bktencent.com/blueking/bcs-apiserver-proxy:v1.29.0-alpha.130-tencent
- hub.bktencent.com/alpine/helm:3.7.2
- hub.bktencent.com/registry.k8s.io/ingress-nginx/controller:v1.3.1
- hub.bktencent.com/registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.3.0
14 changes: 14 additions & 0 deletions bcs-ops/k8s/install_k8s_tools
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ name=Kubernetes
baseurl=${repo_url}
enabled=1
gpgcheck=0
[kubernetes-v1.27]
name=Kubernetes
baseurl=https://mirrors.tencent.com/kubernetes_new/core%3a/stable%3a/v1.27%3a/build/rpm/
enabled=1
gpgcheck=0
[kubernetes-v1.28]
name=Kubernetes
baseurl=https://mirrors.tencent.com/kubernetes_new/core%3a/stable%3a/v1.28%3a/build/rpm/
enabled=1
gpgcheck=0
EOF
yum install -y -q yum-utils
yum-config-manager --add-repo "$ROOT_DIR/kubernetes.repo"
Expand Down Expand Up @@ -218,6 +230,8 @@ main() {
utils::log "INFO" "check kubectl status"
if kubectl version --client --short; then
utils::log "OK" "kubelet install success"
elif kubectl version --client ; then
utils::log "OK" "kubelet install success"
else
utils::log "ERROR" "Did kubectl get installed?"
fi
Expand Down
5 changes: 4 additions & 1 deletion bcs-ops/k8s/render_kubeadm
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,12 @@ main() {
1.2[2-4].*)
kubeadm_tag="v1beta3"
;;
1.2[7-8].*)
kubeadm_tag="v1beta3"
;;
*)
utils::log "FATAL" \
"Only support 1.2[0-4].x, here is :${K8S_VER}"
"Only support 1.2[0-8].x, here is :${K8S_VER}"
;;
esac

Expand Down
2 changes: 1 addition & 1 deletion bcs-ops/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ set +x

## 安装示例

目前仅支持 k8s `1.20.15` (默认), `1.23.17` `1.24.15` 版本。
目前仅支持 k8s `1.20.15` (默认), `1.23.17` , `1.24.15` , `1.27.15`, `1.28.11`版本。

### 集群创建与节点添加

Expand Down
4 changes: 2 additions & 2 deletions bcs-ops/system/config_envfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ EOF
check_env() {
trap "utils::on_ERR;" ERR
# match k8s_ver
if ! [[ $K8S_VER =~ ^1\.2[0-4] ]]; then
if ! [[ $K8S_VER =~ ^1\.2[0-8] ]]; then
utils::log "ERROR" \
"Only support K8S_VER 1.2[0-4].x, here is :${K8S_VER}"
"Only support K8S_VER 1.2[0-8].x, here is :${K8S_VER}"
fi

# match cri and k8s_ver
Expand Down
2 changes: 2 additions & 0 deletions bcs-services/bcs-bscp/ui/src/i18n/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ export default {
新建配置模板套餐: 'New configuration template package',
'压缩包正在解压,请稍后': 'The compressed package is being decompressed, please wait',
'确认恢复该配置项?': 'Confirm to restore the configuration item?',
'文件下载中,请稍后': 'File download in progress, please wait',
'配置文件绝对路径/创建人/修改人': 'Configuration file absolute path/creator/modifier',

// 分组管理
新增分组: 'New group',
Expand Down
2 changes: 2 additions & 0 deletions bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export default {
已存在配置模板套餐: '已存在配置模板套餐',
新建配置模板套餐: '新建配置模板套餐',
'压缩包正在解压,请稍后': '压缩包正在解压,请稍后',
'配置文件绝对路径/创建人/修改人': '配置文件绝对路径/创建人/修改人',

// 分组管理
新增分组: '新增分组',
Expand Down Expand Up @@ -590,6 +591,7 @@ export default {
批量移出套餐: '批量移出套餐',
从其他空间导入: '从其他空间导入',
'确认恢复该配置项?': '确认恢复该配置项?',
'文件下载中,请稍后': '文件下载中,请稍后',

// 脚本管理
全部脚本: '全部脚本',
Expand Down
2 changes: 1 addition & 1 deletion bcs-services/bcs-bscp/ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ auth().then(() => {
.use(i18n)
.use(router)
.use(bkui, {
locale: getCookie('blueking_language') === 'zh-cn' ? zhCn : en,
locale: getCookie('blueking_language') === 'en' ? en : zhCn,
})
.mount('#app');
});
Expand Down
6 changes: 3 additions & 3 deletions bcs-services/bcs-bscp/ui/src/store/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ export default defineStore('service', () => {
user_group: 'root',
});

// 批量上传的ids
const batchUploadIds = ref<number[]>([]);
// 置顶的ids
const topIds = ref<number[]>([]);

return {
appData,
permCheckLoading,
hasEditServicePerm,
checkPermBeforeOperate,
lastCreatePermission,
batchUploadIds,
topIds,
isFileType,
};
});
6 changes: 3 additions & 3 deletions bcs-services/bcs-bscp/ui/src/store/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default defineStore('template', () => {
const versionListPageShouldOpenEdit = ref(false);
// 配置页面是否需要打开查看版本面板
const versionListPageShouldOpenView = ref(false);
// 批量上传配置的ids
const batchUploadIds = ref<number[]>([]);
// 置顶id
const topIds = ref<number[]>([]);

return {
templateSpaceList,
Expand All @@ -35,6 +35,6 @@ export default defineStore('template', () => {
needRefreshMenuFlag,
versionListPageShouldOpenEdit,
versionListPageShouldOpenView,
batchUploadIds,
topIds,
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@
};
const handleClickSearch = () => {
console.log(1);
// 处理有条件处于编辑状时 点击查询框 编辑态条件未保存
// 新增态 处理枚举型点击搜索框取消枚举
if (editConditionItem.value || isShowSearchInput.value) {
Expand Down Expand Up @@ -836,7 +835,6 @@
};
const handleChildSelectorClickOutside = () => {
console.log('click outside');
if (editConditionItem.value) {
// 编辑态 取消编辑
editConditionItem.value!.isEdit = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
};
const handleDrillDown = (data: any) => {
console.log(data);
isDrillDown.value = true;
drillDownData.value = data.name;
pieData.value = data.children;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@
// 判断是否需要对比上线版本
const handlePublishOrOpenDiff = () => {
console.log(groups.value, releasedGroups.value);
if (diffableVersionList.value.length) {
baseVersionId.value = diffableVersionList.value[0].id;
isDiffSliderShow.value = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<SearchInput
v-model="searchStr"
class="config-search-input"
:placeholder="t('配置文件名/创建人/修改人')"
:placeholder="t('配置文件绝对路径/创建人/修改人')"
@search="getListData" />
<bk-loading class="loading-wrapper" :loading="loading">
<div v-for="group in tableGroupsData" :key="group.id" class="config-group">
Expand All @@ -17,7 +17,9 @@
:class="['config-item', { disabled: config.file_state === 'DELETE' }]"
:key="config.id"
@click="handleConfigClick(config, group.id)">
<div class="config-name">{{ config.name }}</div>
<bk-overflow-title class="config-name" type="tips">
{{ config.path + config.name }}
</bk-overflow-title>
<div class="config-type">{{ getConfigTypeName(config.file_type) }}</div>
</div>
<TableEmpty v-if="group.configs.length === 0" :is-search-empty="isSearchEmpty" @clear="clearSearch" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
<bk-input
v-model="localVal.fileAP"
:placeholder="t('请输入配置文件的绝对路径')"
:disabled="!editable"
:disabled="isEdit"
@input="change" />
</bk-form-item>
<bk-form-item :label="t('配置文件描述')" property="memo">
<bk-input
v-model="localVal.memo"
type="textarea"
:maxlength="200"
:disabled="!editable"
:placeholder="t('请输入')"
:resize="true"
@input="change" />
</bk-form-item>
<bk-form-item :label="t('配置文件格式')">
<bk-radio-group v-model="localVal.file_type" :required="true" @change="change">
<bk-radio v-for="typeItem in CONFIG_FILE_TYPE" :key="typeItem.id" :label="typeItem.id" :disabled="!editable">{{
<bk-radio v-for="typeItem in CONFIG_FILE_TYPE" :key="typeItem.id" :label="typeItem.id" :disabled="isEdit">{{
typeItem.name
}}</bk-radio>
</bk-radio-group>
Expand All @@ -37,7 +36,6 @@
v-model="privilegeInputVal"
type="number"
:placeholder="t('请输入三位权限数字')"
:disabled="!editable"
@blur="handlePrivilegeInputBlur" />
<template #content>
<div>{{ t('只能输入三位 0~7 数字') }}</div>
Expand All @@ -46,13 +44,8 @@
</div>
</template>
</bk-popover>
<bk-popover
ext-cls="privilege-select-popover"
theme="light"
trigger="click"
placement="bottom"
:disabled="!editable">
<div :class="['perm-panel-trigger', { disabled: !editable }]">
<bk-popover ext-cls="privilege-select-popover" theme="light" trigger="click" placement="bottom">
<div :class="['perm-panel-trigger']">
<i class="bk-bscp-icon icon-configuration-line"></i>
</div>
<template #content>
Expand All @@ -78,10 +71,10 @@
</div>
</bk-form-item>
<bk-form-item :label="t('用户')" property="user" :required="true">
<bk-input v-model="localVal.user" :placeholder="t('请输入')" :disabled="!editable" @input="change"></bk-input>
<bk-input v-model="localVal.user" :placeholder="t('请输入')" @input="change"></bk-input>
</bk-form-item>
<bk-form-item :label="t('用户组')" :placeholder="t('请输入')" property="user_group" :required="true">
<bk-input v-model="localVal.user_group" :disabled="!editable" @input="change"></bk-input>
<bk-input v-model="localVal.user_group" @input="change"></bk-input>
</bk-form-item>
</div>
<bk-form-item v-if="isTpl" class="fixed-width-form" property="revision_name" :label="t('form_版本号')" required>
Expand All @@ -94,7 +87,6 @@
theme="button"
:tip="t('文件大小{size}M以内', { size: props.fileSizeLimit })"
:size="props.fileSizeLimit"
:disabled="!editable"
:multiple="false"
:files="fileList"
:custom-request="handleFileUpload">
Expand Down Expand Up @@ -124,7 +116,7 @@
</template>
<ConfigContentEditor
:content="stringContent"
:editable="editable"
:editable="true"
:variables="props.variables"
:size-limit="props.fileSizeLimit"
@change="handleStringContentChange" />
Expand Down Expand Up @@ -164,7 +156,7 @@
const props = withDefaults(
defineProps<{
config: IConfigEditParams;
editable: boolean;
isEdit: boolean;
content: string | IFileConfigContentSummary;
variables?: IVariableEditParams[];
bkBizId: string;
Expand All @@ -174,7 +166,7 @@
isTpl?: boolean; // 是否未模板配置文件,非模板配置文件和模板配置文件的上传、下载接口参数有差异
}>(),
{
editable: true,
isEdit: false,
fileSizeLimit: 100,
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
batchAddConfigList,
} from '../../../../../../../../../api/config';
import { IConfigVersion, IConfigImportItem } from '../../../../../../../../../../types/config';
import { storeToRefs } from 'pinia';
import { Message } from 'bkui-vue';
import createSamplePkg from '../../../../../../../../../utils/sample-file-pkg';
import ImportFromTemplate from './import-from-templates.vue';
Expand All @@ -142,7 +141,7 @@
const { t } = useI18n();
const { batchUploadIds } = storeToRefs(useServiceStore());
const serviceStore = useServiceStore();
const props = defineProps<{
show: boolean;
Expand Down Expand Up @@ -266,7 +265,9 @@
variables: allVariables,
};
const res = await batchAddConfigList(props.bkBizId, props.appId, query);
batchUploadIds.value = res.ids;
serviceStore.$patch((state) => {
state.topIds = res.ids;
});
}
emits('update:show', false);
setTimeout(() => {
Expand Down
Loading

0 comments on commit 9f711e4

Please sign in to comment.