我使用的是章鱼服务器。在管道中的某一点上,我运行一个lambda函数,将构建包推送到Octopus,然后尝试在Octopus中创建一个Release。
我正在使用。net Octopus SDK。
将包推送到Octopus可以顺利运行。
创建版本会抛出以下错误:
There was a problem with your request. - A channelId must be provided for a release when more than one exists for that project and no default channel has been specified.: OctopusValidationException
at Octopus.Client.OctopusClient.DispatchRequest[TResponseResource](OctopusRequest request, Boolean readResponse)
at Octopus.Client.OctopusClient.Create[TResource](String path, TResource resource, Object pathParameters) at Octopus.Client.Repositories.ReleaseRepository.Create(ReleaseResource release, Boolean ignoreChannelRules)
at MyProject.Function.CreateRelease(ILambdaContext context, S3Entity s3Event, IOctopusSpaceRepository repositoryForSpace) in /home/runner/work/CICD/CICD/src/MyProject/Function.cs:line 113
at MyProject.Function.FunctionHandler(S3Event evnt, ILambdaContext context) in /home/runner/work/CICD/CICD/src/MyProject/Function.cs:line 84
at lambda_method(Closure , Stream , Stream , LambdaContextInternal )
…运行后:
var release = new ReleaseResource(version, "MyProjectId");
repositoryForSpace.Releases.Create(release);
错误消息似乎不言自明,我可以通过在创建ReleaseResource
时显式引用通道来快速修复它,像这样:
var release = new ReleaseResource(version, "MyProjectId", "MyChannelId");
但是错误信息似乎是一个错误,因为
- 我只有一个通道,
- 这个通道被标记为
default
所以我认为,即使只有一个条件true
,我不会收到这个错误。然而,即使两个条件都满足了,我还是收到了。
任何想法吗?
听起来这可能是一个bug。你能不能发邮件给support@octopus.com告诉这个错误,你的八达通。客户端版本,和你的章鱼服务器版本?