我最近创建了一个新分支,我们称之为“branch1”,它基于另一个分支,我们称之为“master”。然后我对 branch1 做了一堆提交,现在我意识到前几次提交实际上是一个错误,但是在前几次之后的那些仍然是很好的提交!所以我在这里尝试做的基本上是删除前几次提交,以便它们之后的提交基本上基于 master ......如何做到这一点?
我目前正在将新的支付系统(Trustly)整合到我的网站中.这涉及向Trustlys服务器发送jsonstring.这段代码在本地完美运行,但在我的测试环境中,我发现了一个502错误的网关错误.什么是奇怪的是应用程序似乎打破了一个try
块,但下面的catch
块不会触发.考虑以下代码:
var postData = PrepJsonForTrustly(someSecretData);
try
{
_logger.Info("attempting Deposit to trustly"); //this shows up in my logs
var res = _client.Deposit(postData);
_logger.Info("TrustlyDeposit successful"); //this doesn't
return res;
}
catch (Exception ex)
{
_logger.Info("Failed Deposit to Trustly"); //and, oddly, neither does this!
throw ex;
}
Run Code Online (Sandbox Code Playgroud)
谷歌这个问题我找到了这个http://blog.wouldbetheologian.com/2014/07/502-bad-gateway-error-on-azure-websites.html
这似乎描述了大多数相同的symtoms,除了我的代码在localhost上完美运行,他描述的stackoverflowexception也会崩溃我的本地服务器.
什么想法可能导致这个?或者为什么我的拦截块没有开火?
我有一个排队的webjob使用queuetrigger执行任务:
public static void ProcessQueueMessage([QueueTrigger("queue")],Data data, TextWriter log)
{
//do stuff
}
Run Code Online (Sandbox Code Playgroud)
在同一个解决方案中有一个网站,我需要做的是简单地从一个网站控制器向队列中添加消息.我已经尝试直接引用该函数,但似乎这只是运行函数而不是排队消息,这是不可取的,因为它以一种扩展性很差的方式创建了一大堆线程.
如果值列表中有某个值,我有一个要部署的图表。我尝试了以下
{{if .Release.Namespace in .Values.Namespaces }}
<chart goes here>
{{ end }}
Run Code Online (Sandbox Code Playgroud)
其中使用的值文件包含以下内容
Namespaces:
-value1
-value2
Run Code Online (Sandbox Code Playgroud)
但我得到一个错误 function "in" not defined
搜索互连网时,我一直无法找到正确的语法来检查头盔列表中是否存在值。
我正在研究从中读取域的chrome扩展window.location.hostname
.现在,为了使此扩展能够正常工作,我需要能够将子域和其他URL变体分离到同一主机.例:
我需要以下所有url:s
www.google.com
accounts.google.com
photos.google.se
example.google.co.uk
https://google.com
Run Code Online (Sandbox Code Playgroud)
所有这些都需要解决,在这种情况下,"谷歌",以一种可靠的方式,并适用于任何网站有时古怪的子域配置.
这是我目前的方法,有点简化:
var url = window.location.hostname.split(".") //returns an array of strings
for(i=0;i<url.length;i++){
if(url[i].match(domainregex) //regex for identifying domains ".com",".se",".co.uk" etc
return url[i-1] //usually what I'm after is directly before the domain, thus i-1
}
Run Code Online (Sandbox Code Playgroud)
这种方法很麻烦,有时候证明不可靠......有没有更直接的方法呢?
我正在尝试从 helm 中的 yaml 循环创建多个 pod。如果我跑--debug --dry-run
输出符合我的期望,但是当我实际部署到集群时,只存在循环的最后一次迭代。
一些 yaml 给你:
{{ if .Values.componentTests }}
{{- range .Values.componentTests }}
apiVersion: v1
kind: Pod
metadata:
name: {{ . }}
labels:
app: {{ . }}
chart: {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
spec:
{{ toYaml $.Values.global.podSpec | indent 2 }}
restartPolicy: Never
containers:
- name: {{ . }}
ports:
- containerPort: 3000
image: 123456789012.dkr.ecr.eu-west-1.amazonaws.com/{{ . }}:latest
imagePullPolicy: Always
command: ["sleep"] …
Run Code Online (Sandbox Code Playgroud)