Skip to content

Commit

Permalink
Add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed May 11, 2024
1 parent 507bc39 commit 70ee6ee
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: compute.functionmesh.io/v1alpha1
kind: FunctionMesh
metadata:
name: functionmesh-generic-resources-sample
name: functionmesh-generic-sample
spec:
genericResources:
- apiVersion: "compute.functionmesh.io/v1alpha1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ manifests_file="${BASE_DIR}"/.ci/tests/integration/cases/functionmesh-with-gener

kubectl apply -f "${manifests_file}" > /dev/null 2>&1

verify_fm_result=$(ci::verify_function_mesh functionmesh-generic-resources-sample-java-function 2>&1)
verify_fm_result=$(ci::verify_function_mesh functionmesh-generic-sample-java-function 2>&1)
if [ $? -ne 0 ]; then
echo "$verify_fm_result"
kubectl delete -f "${manifests_file}" > /dev/null 2>&1 || true
exit 1
fi

verify_fm_result=$(ci::verify_function_mesh functionmesh-generic-resources-sample-golang-function 2>&1)
verify_fm_result=$(ci::verify_function_mesh functionmesh-generic-sample-golang-function 2>&1)
if [ $? -ne 0 ]; then
echo "$verify_fm_result"
kubectl delete -f "${manifests_file}" > /dev/null 2>&1 || true
exit 1
fi

verify_fm_result=$(ci::verify_function_mesh functionmesh-generic-resources-sample-python-function 2>&1)
verify_fm_result=$(ci::verify_function_mesh functionmesh-generic-sample-python-function 2>&1)
if [ $? -ne 0 ]; then
echo "$verify_fm_result"
kubectl delete -f "${manifests_file}" > /dev/null 2>&1 || true
Expand Down
2 changes: 2 additions & 0 deletions .ci/tests/integration/e2e_with_tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,5 @@ verify:
expected: expected.data.yaml
- query: timeout 5m bash .ci/tests/integration/cases/global-and-namespaced-config/verify.sh
expected: expected.data.yaml
- query: timeout 5m bash .ci/tests/integration/cases/functionmesh-generic-resources/verify.sh
expected: expected.data.yaml
2 changes: 1 addition & 1 deletion controllers/function_mesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (r *FunctionMeshReconciler) observeGenericResources(ctx context.Context, me
condition, ok := mesh.Status.GenericResourceConditions[resource.Name]
if !ok {
mesh.Status.GenericResourceConditions[resource.Name] = v1alpha1.ResourceCondition{
Condition: v1alpha1.SinkReady,
Condition: v1alpha1.GenericResourceReady,
Status: metav1.ConditionFalse,
Action: v1alpha1.Create,
ApiVersion: resource.APIVersion,
Expand Down
3 changes: 3 additions & 0 deletions controllers/functionmesh_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func (r *FunctionMeshReconciler) Reconcile(ctx context.Context, req ctrl.Request
if mesh.Status.SinkConditions == nil {
mesh.Status.SinkConditions = make(map[string]v1alpha1.ResourceCondition)
}
if mesh.Status.GenericResourceConditions == nil {
mesh.Status.GenericResourceConditions = make(map[string]v1alpha1.ResourceCondition)
}
if mesh.Status.Condition == nil {
mesh.Status.Condition = &v1alpha1.ResourceCondition{}
}
Expand Down
3 changes: 2 additions & 1 deletion controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
v1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -2058,7 +2059,7 @@ func CheckIfStatefulSetSpecIsEqual(spec *appsv1.StatefulSetSpec, desiredSpec *ap
container.ImagePullPolicy != desiredContainer.ImagePullPolicy ||
!reflect.DeepEqual(ports, desiredPorts) ||
!reflect.DeepEqual(containerEnvFrom, desiredContainerEnvFrom) ||
!reflect.DeepEqual(container.Resources, desiredContainer.Resources) {
!equality.Semantic.DeepEqual(container.Resources, desiredContainer.Resources) {
return false
}

Expand Down

0 comments on commit 70ee6ee

Please sign in to comment.