THIS IS ONLY A TEST INSTANCE. DON'T DO IMPORTANT WORK HERE!

Unverified Commit 5c107c2e authored by Eugene Ivantsov's avatar Eugene Ivantsov Committed by GitHub
Browse files

Fix small errors. Update Dockerfile (#7)

parent a3e08da7
......@@ -9,16 +9,12 @@
# Red Hat, Inc. - initial API and implementation
#
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/devtools/go-toolset-1.10-rhel7
FROM registry.access.redhat.com/devtools/go-toolset-1.10-rhel7:1.10.3-15 as builder
ENV PATH=/opt/rh/go-toolset-1.10/root/usr/bin:$PATH \
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/devtools/go-toolset-rhel7
FROM registry.access.redhat.com/devtools/go-toolset-rhel7:1.11.5-3 as builder
ENV PATH=/opt/rh/go-toolset-1.11/root/usr/bin:$PATH \
GOPATH=/go/
USER root
# uncomment to run a local build
#RUN subscription-manager register --username me --password mypwd --auto-attach
#RUN subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-server-rhscl-7-rpms
ADD . /go/src/github.com/eclipse/che-operator
RUN cd /go/src/github.com/eclipse/che-operator && export MOCK_API=true && go test -v ./... && \
OOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /tmp/che-operator/che-operator \
......@@ -30,9 +26,7 @@ FROM registry.access.redhat.com/rhel7:7.6-202
ENV SUMMARY="Red Hat CodeReady Workspaces Operator container" \
DESCRIPTION="Red Hat CodeReady Workspaces Operator container" \
PRODNAME="codeready-workspaces" \
COMPNAME="operator-container" \
PATH=/opt/rh/go-toolset-1.10/root/usr/bin:$PATH \
GOPATH=/go/
COMPNAME="operator-container"
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
......
......@@ -70,16 +70,16 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
// register OpenShift routes in the scheme
if isOpenShift {
if err := routev1.AddToScheme(mgr.GetScheme()); err != nil {
logrus.Errorf("Failed to add OpenShift route to scheme: %", err)
logrus.Errorf("Failed to add OpenShift route to scheme: %s", err)
}
if err := oauth.AddToScheme(mgr.GetScheme()); err != nil {
logrus.Errorf("Failed to add oAuth to scheme: %", err)
logrus.Errorf("Failed to add oAuth to scheme: %s", err)
}
}
// register RBAC in the scheme
if err := rbac.AddToScheme(mgr.GetScheme()); err != nil {
logrus.Errorf("Failed to add RBAC to scheme: %", err)
logrus.Errorf("Failed to add RBAC to scheme: %s", err)
}
// Watch for changes to primary resource CheCluster
......@@ -213,7 +213,7 @@ func (r *ReconcileChe) Reconcile(request reconcile.Request) (reconcile.Result, e
if isOpenShift && selfSignedCert {
crt, err := k8sclient.GetDefaultRouterCert("openshift-ingress")
if err != nil {
logrus.Errorf("Default router tls secret not found. Self signed cert isn't added to CheCluster deployment")
logrus.Errorf("Default router tls secret not found. Self signed cert isn't added")
return reconcile.Result{}, err
} else {
secret := deploy.NewSecret(instance, "self-signed-certificate", crt)
......
......@@ -216,7 +216,7 @@ func (r *ReconcileChe) CreateService(cr *orgv1.CheCluster, name string, labels m
logrus.Infof("Creating a new object %s, name: %s", service.Kind, service.Name)
err = r.client.Create(context.TODO(), service)
if err != nil {
logrus.Errorf("Failed to create %s %s: %s", service.Kind, service.Name)
logrus.Errorf("Failed to create %s %s: %s", service.Kind, service.Name, err)
return err
}
return nil
......
......@@ -236,7 +236,7 @@ func (cl *k8s) GetDeploymentPod(name string, ns string) (podName string, err err
podList, _ := api.Pods(ns).List(listOptions)
podListItems := podList.Items
if len(podListItems) == 0 {
logrus.Errorf("Failed to find pod to exec into. List of pods: %s", podListItems)
logrus.Errorf("Failed to find pod to exec into. List of pods: %v", podListItems)
return "", err
}
// expecting only one pod to be there so, taking the first one
......
......@@ -206,7 +206,7 @@ func (r *ReconcileChe) ReconcileIdentityProvider(instance *orgv1.CheCluster) (de
oAuthClient := &oauth.OAuthClient{}
oAuthClientName := instance.Spec.Auth.OauthClientName
if err := r.client.Get(context.TODO(), types.NamespacedName{Name: oAuthClientName, Namespace: ""}, oAuthClient); err != nil {
logrus.Errorf("%s %s not found: %s", oAuthClient.Name, err)
logrus.Errorf("OAuthClient %s not found: %s", oAuthClient.Name, err)
}
if err := r.client.Delete(context.TODO(), oAuthClient); err != nil {
logrus.Errorf("Failed to delete %s %s: %s", oAuthClient.Kind, oAuthClient.Name, err)
......
......@@ -97,7 +97,6 @@ func GetClusterPublicHostname() (hostname string, err error) {
return "", err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
logrus.Errorf("An error occurred when getting API public hostname: %s", err)
......@@ -106,7 +105,7 @@ func GetClusterPublicHostname() (hostname string, err error) {
var jsonData map[string]interface{}
err = json.Unmarshal(body, &jsonData)
if err != nil {
logrus.Errorf("An error occurred when unmarshalling: %s")
logrus.Errorf("An error occurred when unmarshalling: %s", err)
return "", err
}
hostname = jsonData["issuer"].(string)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment