我在多租户节点应用程序中工作,我知道在Kubernetes中创建一个新的命名空间可以运行kubectl命令,如下所示:
kubectl create namespace <namespace name>
当新客户注册新帐户时,如何从节点微服务创建新的命名空间?
是否有一些kubectl API来从外部应用程序发出请求?
用户必须从应用程序注销,销毁在kubernetes中创建的pod吗?
我无法使用导入,因为我总是会遇到以下错误:
(function (exports, require, module, __filename, __dirname) { import { expect } from 'chai';
SyntaxError: Unexpected token import
Run Code Online (Sandbox Code Playgroud)
在我的文件中,index.test.ts我有这个:
import { expect } from 'chai';
describe('Hello function', () => {
it('should return hello world', () => {
const result = hello();
expect(result).to.equal('Hello World!');
});
});
Run Code Online (Sandbox Code Playgroud)
在我package.json有这个:
"scripts": {
"test": "mocha --reporter spec --compilers test/**/*.test.js",
Run Code Online (Sandbox Code Playgroud)
},
我的tsconfig.json:
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"lib": [
"dom",
"es2015"
],
"outDir": "dist",
"strict": false
}
} …Run Code Online (Sandbox Code Playgroud) 我将 WSO2is 5.7.0 与我的 Angular 6 应用程序一起使用,我尝试从我的应用程序进行 api 调用,但出现 cors 错误:Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
我已经激活了oauth和authenticationendpoint中启用的cors,我WEB-INF/web.xml用以下几行编辑了两个web应用程序的de:
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud)
在authenticationendpoint中,我将cors库从oauth复制到lib文件夹中的authenticationendpoint webapps,并使用以下行编辑pom.xml文件:
<dependency>
<groupId>com.thetransactioncompany.wso2</groupId>
<artifactId>cors-filter</artifactId>
<version>1.7.0.wso2v1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
之后,重新启动服务,我也遇到了同样的问题Cross-Origin Request Blocked
在我的角度应用程序服务中,我提出如下请求:
const httpHeaders = {
headers: new HttpHeaders()
.set('Content-Type', 'application/x-www-form-urlencoded')
.set('Access-Control-Allow-Origin', '*')
};
this.http.post<any>(`http://localhost:9443/commonauth`, payload, httpHeaders)
Run Code Online (Sandbox Code Playgroud)
我认为有必要启用 tomcat 的 cors 支持,但我不知道该怎么做,除了启用 cors 之外,我还有什么其他选择?
我的资料来源:
https://docs.wso2.com/display/IS570/Invoking+an+Endpoint+from+a+Different+Domain
https://hasanthipurnima.blogspot.com/2016/05/applying-cors-filter-to-wso2-identity.html