我正在尝试使用minikube和kitematic在我的本地机器上测试kubernetes.但是,kubernetes无法在我的本地存储库(ImagePullBackOff)中提取图像.
我尝试解决这个问题:使用Minikube时无法从私人仓库中提取泊坞窗图像
但我没有/etc/init.d/docker,我认为这是因为运动学?(我在OS X上)
编辑:
我安装了https://github.com/docker/docker-registry,和
docker tag local-image-build localhost:5000/local-image-build
docker push localhost:5000/local-image-build
Run Code Online (Sandbox Code Playgroud)
我的kubernetes yaml包含:
spec:
containers:
- name: backend-nginx
image: localhost:5000/local-image-build:latest
imagePullPolicy: Always
Run Code Online (Sandbox Code Playgroud)
但它仍然没有工作......日志:
Error syncing pod, skipping: failed to "StartContainer"
for "backend-nginx" with ErrImagePull: "Error while pulling image:
Get http://127.0.0.1:5000/v1/repositories/local-image-build/images:
dial tcp 127.0.0.1:5000: getsockopt: connection refused
Run Code Online (Sandbox Code Playgroud)
编辑2:
我不知道我是否走上了好路,但我发现了这个:
http://kubernetes.io/docs/user-guide/images/
但我不知道我的DOCKER_USER是什么......
kubectl create secret docker-registry myregistrykey --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL
Run Code Online (Sandbox Code Playgroud)
编辑3
现在我上了我的吊舱:
Failed to pull image "local-image-build:latest": Error: image library/local-image-build not found
Error syncing pod, skipping: …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Android的数据绑定.
我不能再建立我的项目了.我收到了这个错误:
"错误:(13,46)错误:包ch.company.project.databinding不存在"
我在这里gradle:
和
这里的gradle输出:
我正在使用firebase崩溃报告来破坏我的iphone项目.
但是我收到的日志不可读:
Exception name: EXC_BREAKPOINT / EXC_ARM_BREAKPOINT
TPC_swift
4295841940 + 284820
TPC_swift
4295841344 + 284224
TPC_swift
4296852240 + 1295120
libdispatch.dylib
_dispatch_call_block_and_release + 5304
libdispatch.dylib
_dispatch_client_callout + 5240
libdispatch.dylib
_dispatch_main_queue_callback_4CF + 27520
CoreFoundation
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 920908
CoreFoundation
__CFRunLoopRun + 912308
9
CoreFoundation
CFRunLoopRunSpecific + 35916
GraphicsServices
GSEventRunModal + 49284
UIKit
UIApplicationMain + 516228
TPC_swift
4295904544 + 347424
libdyld.dylib
start + 10420
Run Code Online (Sandbox Code Playgroud)
这是firebase或apple错误的问题?
在我的项目的构建阶段,我有这个脚本:
# Replace this path with the path to the key you just downloaded
Run Code Online (Sandbox Code Playgroud)
JSON_FILE =/*****/TPC_Swift/TPC_swift/TPC_swift /项目 - *****JSON …
我通过Cocoa Pods导入了facebook sdk,在这里描述https://developers.facebook.com/docs/swift/login
但奇怪的是,当我在我的设备上使用它时,我得到:
没有suche模块FacebookLogin
在模拟器上它正在工作....
import UIKit
import FacebookLogin
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let fbLoginButton = LoginButton(readPermissions: [ .publicProfile ])
fbLoginButton.center = view.center
view.addSubview(fbLoginButton)
}
}
Run Code Online (Sandbox Code Playgroud)
我的pod文件:
platform :ios, '8.0'
use_frameworks!
target 'myapp' do
pod 'SwiftEventBus', :tag => '2.2.0', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
pod 'PhoneNumberKit', '~> 1.2'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare' …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的机器(Ubuntu)上的 docker 上执行 jenkins。
我必须访问我公司的 git repo。但在詹金斯,我得到这个错误:
无法解析主机:gogs.mycompany.com
我认为这是一个 DNS 错误,所以我尝试像这样启动我的 docker(使用 --dns 和 --dns-search)
sudo docker run -p 8080:8080 -p 50000:50000 -v /home/xero/jenkins:/var/jenkins_home --name=myproject-jenkins2 --dns=127.0.1.1 --dns-search=mycompany.lan jenkins
这是我的 /etc/resolv.conf :
名称服务器 127.0.1.1
搜索 mycompany.lan
我做错了什么?
我正在尝试在 jenkins 构建中使用 docker-compose。但我得到:
docker-compose: not found
Run Code Online (Sandbox Code Playgroud)
我必须如何安装 docker-compose ?这是一个插件,还是我必须修改 jenkins 的 docker 镜像?
我使用詹金斯:1.642.4
我想用 Android 提供的一些代码验证电子邮件。
这是我要模拟的代码:
if(!Patterns.EMAIL_ADDRESS.matcher(email).matches())
throw new InvalidPhoneException(phone);
Run Code Online (Sandbox Code Playgroud)
在我的测试文件中:
@RunWith(PowerMockRunner.class)
@PrepareForTest({ Patterns.class })
public class UserTest {
@Before
public void mockValidator() {
mockStatic(Patterns.class);
when(Patterns.EMAIL_ADDRESS.matcher(any(String.class)).matches()).thenReturn(true);
}
Run Code Online (Sandbox Code Playgroud)
启动测试时出现此错误:
java.lang.NullPointerException
at ch.mycompany.myapp.model.UserTest.mockValidator(UserTest.java:59)
Run Code Online (Sandbox Code Playgroud)
编辑 1:
我试过 :
mockStatic(Patterns.class);
Field field = PowerMockito.field(Patterns.class, "EMAIL_ADDRESS");
field.set(Patterns.class, mock(Pattern.class));
// prepare matcher
Matcher matcher = mock(Matcher.class);
when(matcher.matches())
.thenReturn(true);
// final mock
when(Patterns.EMAIL_ADDRESS.matcher(any(String.class)))
.thenReturn(matcher);
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时,我的代码 (Patterns.EMAIL_ADDRESS.matcher(email).matches()) 总是返回 false。这令人困惑。
我正在尝试使用RSPEC测试我的API控制器。控制器中的动作有一个我想存根/模拟的服务。但是我得到了错误:
失败/错误:期望(Api :: V1 :: PaymentsController)。接收(:init_alias).and_return(svc)Api :: V1 :: PaymentsController未实现:init_alias
这是我的测试:
let(:alias_svc) { instance_double(AliasService) }
describe 'POST /payment/card' do
it 'returns urls (return, success, fail)' do
expect(Api::V1::PaymentsController).to receive(:init_alias).and_return(alias_svc)
expect(alias_svc).to receive(:insert)
post '/payment/card'
end
end
Run Code Online (Sandbox Code Playgroud)
和控制器:
module Api
module V1
class PaymentsController < ApiController
before_action :init_alias, only: [:register_card]
# POST /payment/card
def register_card
@url = @svc.insert current_user
end
private
def init_alias
@svc = AliasService.new
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
编辑:
我试图删除第一行(expect(Api :: V1 :: PaymentsController).to receive(:init_alias).and_return(alias_svc))但我得到了
失败/错误:期望(svc).to接收(:insert)(InstanceDouble(AliasService)(匿名))。insert(*(任何参数))预期:收到任何参数的次数为1:收到任何参数的次数为0
我的代码正在运行,但收到警告:
警告:从 React Final Form v3.3.0 开始,props.mutators 已被弃用,并将在 React Final Form 的下一个主要版本中删除。使用: props.form.mutators 代替。检查您的 ReactFinalForm 渲染道具。
以这个例子:
https://codesandbox.io/s/kx8qv67nk5
return <Form
onSubmit={() => console.log('ok')}
mutators={{
...arrayMutators
}}
initialValues={ {customers: [{firstName: 'a', lastName: 'b'}]} }
render={({
handleSubmit,
mutators: { push, pop }, // injected from final-form-arrays above
pristine,
reset,
submitting,
values
}) => {
return (
<form onSubmit={handleSubmit}>
<div className="buttons">
<button
type="button"
onClick={() => push('customers', undefined)}>
Add Customer
</button>
</div>
<FieldArray name="customers">
{({ fields }) =>
fields.map((name, index) => (
<div key={name}> …Run Code Online (Sandbox Code Playgroud) 我正在使用当前用户地理位置(通过地理位置 API)开发一个网站
有没有办法在 cypress (chrome) 上模拟用户地理位置(gps 位置)?我没有找到任何相关内容
docker ×3
android ×2
ios ×2
jenkins ×2
cypress ×1
data-binding ×1
dns ×1
facebook ×1
final-form ×1
firebase ×1
git ×1
kitematic ×1
kubernetes ×1
mocking ×1
mockito ×1
powermockito ×1
reactjs ×1
rspec ×1
rspec-rails ×1
ruby ×1
swift ×1
unit-testing ×1