Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #921: Migration to v1 API #1160

Merged
merged 10 commits into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/pr-kind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#
# 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.
#

name: KinD Integration Tests PR

on:
pull_request:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Info
run: |
ls -lart
- name: Set Up Java
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Get KinD (Kubernetes in Docker)
uses: engineerd/setup-kind@v0.1.0
with:
version: v0.6.1
skipClusterCreation: "true"
- name: Start KinD Cluster with Internal Registry
run: |
CLUSTER_NAME="kind"
REGISTRY_CONTAINER_NAME='kind-registry'
REGISTRY_PORT='5000'
docker run -d -p "${REGISTRY_PORT}:5000" --restart=always --name "${REGISTRY_CONTAINER_NAME}" registry:2
REGISTRY_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress }}' "${REGISTRY_CONTAINER_NAME}")
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."${REGISTRY_IP}:${REGISTRY_PORT}"]
endpoint = ["http://${REGISTRY_IP}:${REGISTRY_PORT}"]
EOF
for node in $(kind get nodes --name ${CLUSTER_NAME}); do
docker exec "${node}" sh -c "echo $(docker inspect --format '{{.NetworkSettings.IPAddress }}' "${REGISTRY_CONTAINER_NAME}") registry >> /etc/hosts"
done
- name: Info
run: |
kubectl cluster-info
kubectl describe nodes
- name: Run IT
run: |
# Compute registry parameters
CAMEL_K_REGISTRY=$(docker inspect --format '{{.NetworkSettings.IPAddress }}' "kind-registry")
echo "Using registry ${CAMEL_K_REGISTRY}:5000"

echo "Build project"
make build-kamel
echo "Adding maven artifacts to the image context"
make PACKAGE_ARTIFACTS_STRATEGY=download package-artifacts
echo "Copying binary file to docker dir"
mkdir -p ./build/_output/bin
cp ./kamel ./build/_output/bin/
echo "Building the images"
export LOCAL_IMAGE=localhost:5000/apache/camel-k:$(make version)
export IMAGE=${CAMEL_K_REGISTRY}:5000/apache/camel-k:$(make version)
docker build -t "${LOCAL_IMAGE}" -f build/Dockerfile .
docker push ${LOCAL_IMAGE}
echo "installing camel k cluster resources"
./kamel install --cluster-setup

# Then run integration tests
export KAMEL_INSTALL_REGISTRY=${CAMEL_K_REGISTRY}:5000
export KAMEL_INSTALL_REGISTRY_INSECURE=true
export KAMEL_INSTALL_OPERATOR_IMAGE=${IMAGE}
export CAMEL_K_TEST_IMAGE_NAME=${CAMEL_K_REGISTRY}:5000/apache/camel-k
export CAMEL_K_TEST_IMAGE_VERSION=$(make version)
make test-integration
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ issues:
exclude-rules:
- path: pkg/client/clientset
linters:
- stylecheck
- golint
- deadcode
- lll
Expand All @@ -41,6 +42,7 @@ issues:
- unused
- path: pkg/client/informers
linters:
- stylecheck
- golint
- deadcode
- lll
Expand All @@ -49,6 +51,7 @@ issues:
- unused
- path: pkg/client/listers
linters:
- stylecheck
- golint
- deadcode
- lll
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ install:

env:
global:
- OPENSHIFT_VERSION=3.10.0
- OPENSHIFT_COMMIT=dd10d17
- OPENSHIFT_VERSION=3.11.0
- OPENSHIFT_COMMIT=0cbc58b
- MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

services:
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ kamel cmd --maven-settings=configmap:maven-settings/settings.xml
+
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
apiVersion: camel.apache.org/v1
kind: IntegrationPlatform
metadata:
labels:
Expand Down
141 changes: 6 additions & 135 deletions assets/json-schema/CamelCatalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@
"generation": {
"type": "integer"
},
"initializers": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Initializers"
},
"kind": {
"type": "string"
},
Expand Down Expand Up @@ -217,52 +213,7 @@
"additionalProperties": false,
"type": "object"
},
"Fields": {
"required": [
"Map"
],
"properties": {
"Map": {
"patternProperties": {
".*": {
"$ref": "#/definitions/Fields"
}
},
"type": "object"
}
},
"additionalProperties": false,
"type": "object"
},
"Initializer": {
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"Initializers": {
"required": [
"pending"
],
"properties": {
"pending": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Initializer"
},
"type": "array"
},
"result": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Status"
}
},
"FieldsV1": {
"additionalProperties": false,
"type": "object"
},
Expand All @@ -271,9 +222,12 @@
"apiVersion": {
"type": "string"
},
"fields": {
"fieldsType": {
"type": "string"
},
"fieldsV1": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Fields"
"$ref": "#/definitions/FieldsV1"
},
"manager": {
"type": "string"
Expand Down Expand Up @@ -340,89 +294,6 @@
"additionalProperties": false,
"type": "object"
},
"Status": {
"properties": {
"apiVersion": {
"type": "string"
},
"code": {
"type": "integer"
},
"continue": {
"type": "string"
},
"details": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/StatusDetails"
},
"kind": {
"type": "string"
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"remainingItemCount": {
"type": "integer"
},
"resourceVersion": {
"type": "string"
},
"selfLink": {
"type": "string"
},
"status": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"StatusCause": {
"properties": {
"field": {
"type": "string"
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"StatusDetails": {
"properties": {
"causes": {
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/StatusCause"
},
"type": "array"
},
"group": {
"type": "string"
},
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"retryAfterSeconds": {
"type": "integer"
},
"uid": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"Time": {
"additionalProperties": false,
"type": "object"
Expand Down
Loading