Skip to content

Commit

Permalink
fix static check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jintusebastian committed Jun 6, 2023
1 parent 0ebf6ba commit 44b4128
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
13 changes: 7 additions & 6 deletions broker/core/app-config/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ if (process.env.QUOTA_PASSWORD) {
}

_.each(process.env, (value, key) => {
if(key.substring(0,7) == "REGION_"){
let region_info=key.split('_');
if(region_info.at(-1)=="USERNAME")
config.quota.regions[region_info.slice(1,-1).join('-').toLowerCase()]['username']=process.env[key]
else
config.quota.regions[region_info.slice(1,-1).join('-').toLowerCase()]['password']=process.env[key]
if(key.substring(0,7) == 'REGION_') {
let region_info = key.split('_');
if(region_info.at(-1) == 'USERNAME') {
config.quota.regions[region_info.slice(1,-1).join('-').toLowerCase()].username = process.env[key];
} else {
config.quota.regions[region_info.slice(1,-1).join('-').toLowerCase()].password = process.env[key];
}
}
});

Expand Down
6 changes: 5 additions & 1 deletion broker/data-access-layer/eventmesh/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2017,
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["mocha", "prettier"],
Expand Down
2 changes: 1 addition & 1 deletion broker/data-access-layer/eventmesh/src/ApiServerClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class ApiServerClient {
apiVersion: CONST.APISERVER.NAMESPACE_API_VERSION,
metadata: {
name: name,
...!(_.isEmpty(config.apiserver.services_namespace_labels)) && {labels: _.get(config.apiserver, 'services_namespace_labels')}
...(!(_.isEmpty(config.apiserver.services_namespace_labels)) && { labels: _.get(config.apiserver, 'services_namespace_labels') })
}
};
const client = this._getApiClient('', CONST.APISERVER.NAMESPACE_API_VERSION);
Expand Down
1 change: 1 addition & 0 deletions broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@yarnpkg/parsers": "^2.3.0",
"babel-cli": "^6.9.0",
"babel-eslint": "10.1.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"chai": "^4.0.0",
"chai-http": "^2.0.1",
"coveralls": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions broker/test/init
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test_broker(){
mv ./coverage/coverage.json ./coverage/coverage-broker.json
babel-node ./node_modules/.bin/isparta cover --report cobertura _mocha -- $testHooks --opts $hooksOpts || exit 1;;

"test-coverall") babel-node ./node_modules/.bin/isparta cover _mocha -- $testBroker $app $core $dataAccessLayer --opts $brokerOpts || exit 1;
"test-coverall") babel-node --plugins transform-object-rest-spread ./node_modules/.bin/isparta cover _mocha -- $testBroker $app $core $dataAccessLayer --opts $brokerOpts || exit 1;
mkdir ./coverage/broker_report
mv ./coverage/lcov.info ./coverage/lcov_broker.info
mv -v ./coverage/coverage.json ./coverage/lcov-report/ ./coverage/broker_report
Expand Down Expand Up @@ -70,4 +70,4 @@ main(){
esac
}

main "${@:1}"
main "${@:1}"
6 changes: 5 additions & 1 deletion broker/tools/module-generator/files/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"parser": "babel-eslint",
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["mocha", "prettier"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@ import (

var c client.Client

var expectedRequest = ctrlrun.Request{NamespacedName: types.NamespacedName{Name: "1", Namespace: constants.InteroperatorNamespace}}

const timeout = time.Second * 5

// var expectedRequest = reconcile.Request{NamespacedName: "1"}

var clusterInstance = &resourcev1alpha1.SFCluster{
ObjectMeta: metav1.ObjectMeta{
Name: "2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/event"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

var c, c2 client.Client

var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Name: "foo", Namespace: constants.InteroperatorNamespace}}
var instanceKey = types.NamespacedName{Name: "instance-id", Namespace: "sf-instance-id"}
var serviceKey = types.NamespacedName{Name: "service-id", Namespace: constants.InteroperatorNamespace}
var planKey = types.NamespacedName{Name: "plan-id", Namespace: constants.InteroperatorNamespace}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

var c client.Client

var planKey = types.NamespacedName{Name: "foo", Namespace: constants.InteroperatorNamespace}
var expectedRequest = reconcile.Request{NamespacedName: planKey}

const timeout = time.Second * 5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

var c client.Client

var serviceKey = types.NamespacedName{Name: "service-id", Namespace: constants.InteroperatorNamespace}
var expectedRequest = reconcile.Request{NamespacedName: serviceKey}

const timeout = time.Second * 5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ var binding = &osbv1alpha1.SFServiceBinding{
var c client.Client

var bindingKey = types.NamespacedName{Name: "binding-id", Namespace: constants.InteroperatorNamespace}
var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Name: "binding-id", Namespace: constants.InteroperatorNamespace}}

const timeout = time.Second * 5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ var instance = &osbv1alpha1.SFServiceInstance{
}

var instanceKey = types.NamespacedName{Name: "instance-id", Namespace: constants.InteroperatorNamespace}
var expectedRequest = reconcile.Request{NamespacedName: instanceKey}

func setupInteroperatorConfig(g *gomega.GomegaWithT) {
data := make(map[string]string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

var c client.Client

var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Name: "foo", Namespace: constants.InteroperatorNamespace}}

const timeout = time.Second * 5

func TestReconcile(t *testing.T) {
Expand Down
5 changes: 5 additions & 0 deletions webhooks/pkg/webhooks/manager/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ var _ = Describe("Event", func() {
ar v1beta1.AdmissionReview
arDockerCreate v1beta1.AdmissionReview
)

dat, err := os.ReadFile("test_resources/admission_request.json")
if err != nil {
panic(err)
}

dockerCreateAr, err := os.ReadFile("test_resources/admission_request_docker_create.json")
if err != nil {
panic(err)
Expand Down

0 comments on commit 44b4128

Please sign in to comment.