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 ae2a0599e7c9e912c89b4a851177b0c1b6f1eb31 Author: nferraro <ni.ferr...@gmail.com> AuthorDate: Fri Sep 7 08:31:48 2018 +0200 Renaming binaries and adding code generation --- .gitignore | 2 +- build/Makefile | 5 ++- cmd/{camel-k => camel-k-operator}/main.go | 0 config/config.yaml | 2 +- deploy/operator.yaml | 12 +++--- pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go | 46 ++++++++++++++++++++++- pkg/build/local/local_builder_integration_test.go | 1 + tmp/build/Dockerfile | 6 +-- tmp/build/build.sh | 2 +- tmp/codegen/boilerplate.go.txt | 15 ++++++++ 10 files changed, 77 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 1b5f6d1..4456437 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Binary files -/operator +/camel-k-operator /kamel # We do not stage vendor directory diff --git a/build/Makefile b/build/Makefile index 7be3aed..cd0711f 100644 --- a/build/Makefile +++ b/build/Makefile @@ -3,11 +3,14 @@ VERSION := $(shell ./build/get_version.sh) build: build-operator build-kamel build-operator: - go build -o operator ./cmd/camel-k/*.go + go build -o camel-k-operator ./cmd/camel-k-operator/*.go build-kamel: go build -o kamel ./cmd/kamel/*.go +codegen: + ./tmp/codegen/update-generated.sh + images: operator-sdk build docker.io/apache/camel-k:$(VERSION) diff --git a/cmd/camel-k/main.go b/cmd/camel-k-operator/main.go similarity index 100% rename from cmd/camel-k/main.go rename to cmd/camel-k-operator/main.go diff --git a/config/config.yaml b/config/config.yaml index 45de913..71ecb89 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,3 +1,3 @@ apiVersion: camel.apache.org/v1alpha1 kind: Integration -projectName: camel-k +projectName: camel-k-operator diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 9d0fc83..863b21c 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -1,25 +1,25 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: camel-k + name: camel-k-operator spec: replicas: 1 selector: matchLabels: - name: camel-k + name: camel-k-operator template: metadata: labels: - name: camel-k + name: camel-k-operator spec: containers: - - name: camel-k + - name: camel-k-operator image: docker.io/apache/camel-k:0.0.1-SNAPSHOT ports: - containerPort: 60000 name: metrics command: - - camel-k + - camel-k-operator imagePullPolicy: Always env: - name: WATCH_NAMESPACE @@ -27,4 +27,4 @@ spec: fieldRef: fieldPath: metadata.namespace - name: OPERATOR_NAME - value: "camel-k" + value: "camel-k-operator" diff --git a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go index 8b2935d..213f57a 100644 --- a/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/camel/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,22 @@ // +build !ignore_autogenerated +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + // Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 @@ -13,7 +30,7 @@ func (in *Integration) DeepCopyInto(out *Integration) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status return } @@ -72,6 +89,12 @@ func (in *IntegrationList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IntegrationSpec) DeepCopyInto(out *IntegrationSpec) { *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Source.DeepCopyInto(&out.Source) return } @@ -100,3 +123,24 @@ func (in *IntegrationStatus) DeepCopy() *IntegrationStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SourceSpec) DeepCopyInto(out *SourceSpec) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceSpec. +func (in *SourceSpec) DeepCopy() *SourceSpec { + if in == nil { + return nil + } + out := new(SourceSpec) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/build/local/local_builder_integration_test.go b/pkg/build/local/local_builder_integration_test.go index ff14663..8403c6c 100644 --- a/pkg/build/local/local_builder_integration_test.go +++ b/pkg/build/local/local_builder_integration_test.go @@ -24,6 +24,7 @@ import ( "context" "github.com/stretchr/testify/assert" build "github.com/apache/camel-k/pkg/build/api" + "github.com/apache/camel-k/pkg/util/test" ) func TestBuild(t *testing.T) { diff --git a/tmp/build/Dockerfile b/tmp/build/Dockerfile index 09b528e..519d9b7 100644 --- a/tmp/build/Dockerfile +++ b/tmp/build/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.6 -RUN adduser -D camel-k -USER camel-k +RUN adduser -D camel-k-operator +USER camel-k-operator -ADD tmp/_output/bin/camel-k /usr/local/bin/camel-k +ADD tmp/_output/bin/camel-k-operator /usr/local/bin/camel-k-operator diff --git a/tmp/build/build.sh b/tmp/build/build.sh index 6755c89..4b3d433 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" +PROJECT_NAME="camel-k-operator" REPO_PATH="github.com/apache/camel-k" BUILD_PATH="${REPO_PATH}/cmd/${PROJECT_NAME}" echo "building "${PROJECT_NAME}"..." diff --git a/tmp/codegen/boilerplate.go.txt b/tmp/codegen/boilerplate.go.txt index 8b13789..c61bcc7 100644 --- a/tmp/codegen/boilerplate.go.txt +++ b/tmp/codegen/boilerplate.go.txt @@ -1 +1,16 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/