-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update pipeline cms according to pipeline cron which enable is t…
…rue (#1741) * fix: update pipeline cms according to pipeline cron which enable is true * fix: polish the code * fix: add etcd lock to ensure that compentsate is executed only once * fix: filter label first
- Loading branch information
1 parent
240b172
commit d85b150
Showing
14 changed files
with
248 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,12 @@ mysql: | |
username: "${MYSQL_USERNAME}" | ||
password: "${MYSQL_PASSWORD}" | ||
database: "${MYSQL_DATABASE}" | ||
etcd: | ||
endpoints: "${ETCD_ENDPOINTS:https://localhost:2379}" | ||
tls: | ||
cert_file: "${ETCD_CERT_FILE:/certs/etcd-client.pem}" | ||
cert_key_file: "${ETCD_CERT_KEY_FILE:/certs/etcd-client-key.pem}" | ||
ca_file: "${ETCD_CA_FILE:/certs/etcd-ca.pem}" | ||
|
||
# pipeline cms | ||
[email protected]: | ||
|
@@ -43,3 +49,5 @@ component-protocol.components.issue-manage.issueOperations: | |
component-protocol.components.issue-manage.issueTable: | ||
component-protocol.components.issue-manage.issueViewGroup: | ||
component-protocol.components.issue-manage.topHead: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// 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. | ||
|
||
package dop | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"bou.ke/monkey" | ||
"github.com/alecthomas/assert" | ||
|
||
"github.com/erda-project/erda/apistructs" | ||
"github.com/erda-project/erda/bundle" | ||
"github.com/erda-project/erda/modules/dop/endpoints" | ||
) | ||
|
||
func TestCompensatePipelineCms(t *testing.T) { | ||
ep := endpoints.New() | ||
var bdl *bundle.Bundle | ||
monkey.PatchInstanceMethod(reflect.TypeOf(bdl), "PageListPipelineCrons", | ||
func(*bundle.Bundle, apistructs.PipelineCronPagingRequest) (*apistructs.PipelineCronPagingResponseData, error) { | ||
return &apistructs.PipelineCronPagingResponseData{ | ||
Total: 3, | ||
Data: []*apistructs.PipelineCronDTO{ | ||
{ | ||
UserID: "1", | ||
OrgID: 1, | ||
}, | ||
{ | ||
UserID: "1", | ||
OrgID: 0, | ||
}, | ||
{ | ||
UserID: "", | ||
OrgID: 1, | ||
}, | ||
}, | ||
}, nil | ||
}) | ||
defer monkey.UnpatchAll() | ||
monkey.PatchInstanceMethod(reflect.TypeOf(bdl), "UpdatePipelineCron", | ||
func(*bundle.Bundle, apistructs.PipelineCronUpdateRequest) error { | ||
return nil | ||
}) | ||
monkey.PatchInstanceMethod(reflect.TypeOf(ep), "UpdateCmsNsConfigs", | ||
func(*endpoints.Endpoints, string, uint64) error { | ||
return nil | ||
}) | ||
err := compensatePipelineCms(ep) | ||
assert.NoError(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.