You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2018/11/05 13:27:40 UTC
[camel-k] 01/02: Fix compatibility with operator sdk 0.0.7
This is an automated email from the ASF dual-hosted git repository.
nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit e91566873b6b6429ef7c97df77977b80baad090d
Author: nferraro <ni...@gmail.com>
AuthorDate: Fri Nov 2 11:46:34 2018 +0100
Fix compatibility with operator sdk 0.0.7
---
.gitignore | 2 +-
build/Makefile | 4 ++--
build/travis_build.sh | 2 +-
cmd/{camel-k-operator/camel_k_operator.go => camel-k/main.go} | 0
cmd/kamel/{kamel.go => main.go} | 0
config/config.yaml | 2 +-
deploy/operator-deployment-kubernetes.yaml | 4 ++--
deploy/operator-deployment-openshift.yaml | 4 ++--
deploy/resources.go | 8 ++++----
docs/developers.adoc | 8 ++++----
tmp/build/Dockerfile | 6 +++---
tmp/build/build.sh | 2 +-
12 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/.gitignore b/.gitignore
index 10611df..871a20b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
# Binary files
-/camel-k-operator
+/camel-k
/kamel
# Released Packages
diff --git a/build/Makefile b/build/Makefile
index f087869..bfd12c1 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -3,7 +3,7 @@ build: build-runtime build-operator build-kamel build-compile-integration-tests
build-go: build-embed-resources build-operator build-kamel
build-operator: build-embed-resources
- go build -o camel-k-operator ./cmd/camel-k-operator/*.go
+ go build -o camel-k ./cmd/camel-k/*.go
build-kamel:
go build -o kamel ./cmd/kamel/*.go
@@ -42,7 +42,7 @@ generate:
clean:
./mvnw clean -f ./runtime/pom.xml
go clean
- rm -f camel-k-operator
+ rm -f camel-k
rm -f kamel
rm -rf tmp/_maven_output
diff --git a/build/travis_build.sh b/build/travis_build.sh
index 83e5d12..e7897b4 100755
--- a/build/travis_build.sh
+++ b/build/travis_build.sh
@@ -56,7 +56,7 @@ echo "Adding maven artifacts to the image context"
echo "Copying binary file to docker dir"
mkdir -p ./tmp/_output/bin
-cp ./camel-k-operator ./tmp/_output/bin/
+cp ./camel-k ./tmp/_output/bin/
echo "Building the images"
export IMAGE=docker.io/apache/camel-k:$(./build/get_version.sh)
diff --git a/cmd/camel-k-operator/camel_k_operator.go b/cmd/camel-k/main.go
similarity index 100%
rename from cmd/camel-k-operator/camel_k_operator.go
rename to cmd/camel-k/main.go
diff --git a/cmd/kamel/kamel.go b/cmd/kamel/main.go
similarity index 100%
rename from cmd/kamel/kamel.go
rename to cmd/kamel/main.go
diff --git a/config/config.yaml b/config/config.yaml
index 71ecb89..45de913 100644
--- a/config/config.yaml
+++ b/config/config.yaml
@@ -1,3 +1,3 @@
apiVersion: camel.apache.org/v1alpha1
kind: Integration
-projectName: camel-k-operator
+projectName: camel-k
diff --git a/deploy/operator-deployment-kubernetes.yaml b/deploy/operator-deployment-kubernetes.yaml
index 608f596..c41f155 100644
--- a/deploy/operator-deployment-kubernetes.yaml
+++ b/deploy/operator-deployment-kubernetes.yaml
@@ -24,7 +24,7 @@ spec:
- containerPort: 60000
name: metrics
command:
- - camel-k-operator
+ - camel-k
imagePullPolicy: IfNotPresent
env:
- name: WATCH_NAMESPACE
@@ -32,7 +32,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: OPERATOR_NAME
- value: "camel-k-operator"
+ value: "camel-k"
volumeMounts:
- mountPath: /workspace
name: camel-k-builder
diff --git a/deploy/operator-deployment-openshift.yaml b/deploy/operator-deployment-openshift.yaml
index 58cea8a..da0a901 100644
--- a/deploy/operator-deployment-openshift.yaml
+++ b/deploy/operator-deployment-openshift.yaml
@@ -24,7 +24,7 @@ spec:
- containerPort: 60000
name: metrics
command:
- - camel-k-operator
+ - camel-k
imagePullPolicy: IfNotPresent
env:
- name: WATCH_NAMESPACE
@@ -32,4 +32,4 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: OPERATOR_NAME
- value: "camel-k-operator"
+ value: "camel-k"
diff --git a/deploy/resources.go b/deploy/resources.go
index a00e23c..f370a58 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -2234,7 +2234,7 @@ spec:
- containerPort: 60000
name: metrics
command:
- - camel-k-operator
+ - camel-k
imagePullPolicy: IfNotPresent
env:
- name: WATCH_NAMESPACE
@@ -2242,7 +2242,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: OPERATOR_NAME
- value: "camel-k-operator"
+ value: "camel-k"
volumeMounts:
- mountPath: /workspace
name: camel-k-builder
@@ -2280,7 +2280,7 @@ spec:
- containerPort: 60000
name: metrics
command:
- - camel-k-operator
+ - camel-k
imagePullPolicy: IfNotPresent
env:
- name: WATCH_NAMESPACE
@@ -2288,7 +2288,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: OPERATOR_NAME
- value: "camel-k-operator"
+ value: "camel-k"
`
Resources["operator-role-binding.yaml"] =
diff --git a/docs/developers.adoc b/docs/developers.adoc
index ee329bd..edb0407 100644
--- a/docs/developers.adoc
+++ b/docs/developers.adoc
@@ -39,7 +39,7 @@ This is a high level overview of the project structure:
[options="header"]
|=======================
| Path | Content
-| link:/cmd[/cmd] | Contains the entry points (the *main* functions) for the **camel-k-operator** binary and the **kamel** client tool.
+| link:/cmd[/cmd] | Contains the entry points (the *main* functions) for the **camel-k** binary and the **kamel** client tool.
| link:/build[/build] | Contains scripts used during make operations for building the project.
| link:/deploy[/deploy] | Contains Kubernetes resource files that are used by the **kamel** client during installation. The `/deploy/resources.go` file is kept in sync with the content of the directory (`make build-embed-resources`), so that resources can be used from within the go code.
| link:/docs[/docs] | Contains this documentation.
@@ -148,7 +148,7 @@ Sometimes it's useful to debug the code from the IDE when troubleshooting.
.**Debugging the `kamel` binary**
-It should be straightforward: just execute the link:/cmd/kamel/kamel.go[/cmd/kamel/kamel.go] file from the IDE (e.g. Goland) in debug mode.
+It should be straightforward: just execute the link:/cmd/kamel/main.go[/cmd/kamel/main.go] file from the IDE (e.g. Goland) in debug mode.
.**Debugging the operator**
@@ -163,13 +163,13 @@ oc scale deployment/camel-k-operator --replicas 0
You can scale it back to 1 when you're done and you have updated the operator image.
-You can setup the IDE (e.g. Goland) to execute the link:/cmd/camel-k-operator/camel_k_operator.go[/cmd/camel-k-operator/camel_k_operator.go] file in debug mode.
+You can setup the IDE (e.g. Goland) to execute the link:/cmd/camel-k/main.go[/cmd/camel-k/main.go] file in debug mode.
When configuring the IDE task, make sure to add all required environment variables in the *IDE task configuration screen*:
* Set the `KUBERNETES_CONFIG` environment variable to point to your Kubernetes configuration file (usually `<homedir>/.kube/config`).
* Set the `WATCH_NAMESPACE` environment variable to a Kubernetes namespace you have access to.
-* Set the `OPERATOR_NAME` environment variable to `camel-k-operator`.
+* Set the `OPERATOR_NAME` environment variable to `camel-k`.
After you setup the IDE task, you can run and debug the operator process.
diff --git a/tmp/build/Dockerfile b/tmp/build/Dockerfile
index cbd151d..f0952d4 100644
--- a/tmp/build/Dockerfile
+++ b/tmp/build/Dockerfile
@@ -1,11 +1,11 @@
FROM fabric8/s2i-java:2.3
-#RUN adduser -D camel-k-operator
-#USER camel-k-operator
+#RUN adduser -D camel-k
+#USER camel-k
ADD tmp/_maven_output /tmp/artifacts/m2
-ADD tmp/_output/bin/camel-k-operator /usr/local/bin/camel-k-operator
+ADD tmp/_output/bin/camel-k /usr/local/bin/camel-k
USER 0
RUN chgrp -R 0 /tmp/artifacts/m2 \
diff --git a/tmp/build/build.sh b/tmp/build/build.sh
index 4b3d433..6755c89 100755
--- a/tmp/build/build.sh
+++ b/tmp/build/build.sh
@@ -11,7 +11,7 @@ fi
BIN_DIR="$(pwd)/tmp/_output/bin"
mkdir -p ${BIN_DIR}
-PROJECT_NAME="camel-k-operator"
+PROJECT_NAME="camel-k"
REPO_PATH="github.com/apache/camel-k"
BUILD_PATH="${REPO_PATH}/cmd/${PROJECT_NAME}"
echo "building "${PROJECT_NAME}"..."