Bug 1252822

Summary: [origin_devexp_555]When push to origin-gitserver there is always a error tip info
Product: OKD Reporter: DeShuai Ma <dma>
Component: BuildAssignee: Cesar Wong <cewong>
Status: CLOSED CURRENTRELEASE QA Contact: Wenjing Zheng <wzheng>
Severity: low Docs Contact:
Priority: medium    
Version: 3.xCC: bparees, haowang, libra-bugs, xiuwang
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 13:53:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description DeShuai Ma 2015-08-12 09:57:14 UTC
Description of problem:
When push to origin-gitserver, the push can be succeed, but there is alway a error tip info. "remote: Error in configuration: default cluster has no server defined"

Version-Release number of selected component (if applicable):
openshift v1.0.4-184-gc5f08bc-dirty
kubernetes v1.1.0-alpha.0-1155-gb73c53c

How reproducible:
Always

Steps to Reproduce:
1.Configure gitserver without auth, set both "REQUIRE_SERVER_AUTH" and "REQUIRE_GIT_AUTH" to empty.
$ cat examples/gitserver/gitserver.yaml
---skip---
- name: REQUIRE_SERVER_AUTH
- name: REQUIRE_GIT_AUTH

2.Deploy the private gitserver
$ oc create -f gitserver.yaml -n dma1

3.Clone the repo from private gitserver and make some change push to gitserver
$ git clone http://172.30.10.11:8080/ruby-sample-build.git
$ cd ruby-sample-build
$ echo "hello" > b.txt
$ git add b.txt
$ git commit -anmq
$ git push

Actual results:
3.There is a error tip info "remote: Error in configuration: default cluster has no server defined".
[fedora@ip-10-154-3-36 ruby-sample-build]$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 3, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 302 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: detect: found language openshift/ruby for ruby-sample-build
remote: Error in configuration: default cluster has no server defined
To http://172.30.10.11:8080/ruby-sample-build.git
   65b3d6b..a8372b2  master -> master

Expected results:
3.Should no error tip

Additional info:

Comment 1 Clayton Coleman 2015-08-21 02:51:57 UTC
Ok, we need to set a KUBECONFIG for the local environment (KUBECONFIG='-') so that it picks up the right variables.

Comment 2 Cesar Wong 2016-04-28 13:51:51 UTC
The gitserver service account should now be able to invoke new-app or start a new build as long as it is assigned the 'edit' role. Please see doc at:
https://github.com/openshift/origin/tree/master/examples/gitserver

Comment 3 XiuJuan Wang 2016-04-29 03:16:26 UTC
No error when the push code to gitserver with openshift/origin-gitserver (d4413378d01d).

Total 267 (delta 88), reused 267 (delta 88)
remote: --> Found Docker image 7666c51 (2 weeks old) from Docker Hub for "centos/ruby-22-centos7"
remote: 
remote:     Ruby 2.2 
remote:     -------- 
remote:     Platform for building and running Ruby 2.2 applications
remote: 
remote:     Tags: builder, ruby, ruby22
remote: 
remote:     * An image stream will be created as "ruby-22-centos7:latest" that will track the source image
remote:     * A Docker build using source code from http://git:8080/ruby-hello-world.git will be created
remote:       * The resulting image will be pushed to image stream "ruby-hello-world:latest"
remote:       * Every time "ruby-22-centos7:latest" changes a new build will be triggered
remote:     * This image will be deployed in deployment config "ruby-hello-world"
remote:     * Port 8080 will be load balanced by service "ruby-hello-world"
remote:       * Other containers can access this service through the hostname "ruby-hello-world"
remote: 
remote: --> Creating resources with label app=ruby-hello-world ...
remote:     imagestream "ruby-22-centos7" created
remote:     imagestream "ruby-hello-world" created
remote:     buildconfig "ruby-hello-world" created
remote:     deploymentconfig "ruby-hello-world" created
remote:     service "ruby-hello-world" created
remote: --> Success
remote:     Build scheduled, use 'oc logs -f bc/ruby-hello-world' to track its progress.
remote:     Run 'oc status' to view your app.
To http://git-xiuwang.0428-og3.qe.rhcloud.com/ruby-hello-world.git
 * [new branch]      master -> master


$ git push openshift master 
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 253 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: build: started on build configuration 'ruby-hello-world'
To http://git-xiuwang.0428-og3.qe.rhcloud.com/ruby-hello-world.git
   e79d887..6d24ed5  master -> master