Skip to content

Commit

Permalink
chore(ci): Helm CRDs refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Aug 7, 2024
1 parent 5893e60 commit 1da5ce6
Show file tree
Hide file tree
Showing 12 changed files with 38,398 additions and 38,516 deletions.
13 changes: 6 additions & 7 deletions e2e/install/helm/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ import (
)

func TestHelmInstallation(t *testing.T) {
containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
g.Expect(ok).To(BeTrue())

WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
g.Expect(ok).To(BeTrue())
// Let's make sure no CRD is yet available in the cluster
// as we must make the Helm procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil())
// as we must make the procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should be previously installed for this test")
operatorID := "helm-ck"
os.Setenv("CAMEL_K_TEST_MAKE_DIR", "../../../")
ExpectExecSucceed(t, g,
Expand All @@ -66,14 +65,14 @@ func TestHelmInstallation(t *testing.T) {
)

g.Eventually(OperatorPod(t, ctx, ns)).ShouldNot(BeNil())
// Check if restricted security context has been applyed
// Check if restricted security context has been applied
operatorPod := OperatorPod(t, ctx, ns)()
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.RunAsNonRoot).To(Equal(kubernetes.DefaultOperatorSecurityContext().RunAsNonRoot))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.Capabilities).To(Equal(kubernetes.DefaultOperatorSecurityContext().Capabilities))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.SeccompProfile).To(Equal(kubernetes.DefaultOperatorSecurityContext().SeccompProfile))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.AllowPrivilegeEscalation).To(Equal(kubernetes.DefaultOperatorSecurityContext().AllowPrivilegeEscalation))

//Test a simple route
// Test a simple route
t.Run("simple route", func(t *testing.T) {
name := RandomizedSuffixName("yaml")
g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/yaml.yaml", "--name", name).Execute()).To(Succeed())
Expand Down
38,387 changes: 38,387 additions & 0 deletions helm/camel-k/crds/camel-k-crds.yaml

Large diffs are not rendered by default.

2,075 changes: 0 additions & 2,075 deletions helm/camel-k/crds/crd-build.yaml

This file was deleted.

544 changes: 0 additions & 544 deletions helm/camel-k/crds/crd-camel-catalog.yaml

This file was deleted.

572 changes: 0 additions & 572 deletions helm/camel-k/crds/crd-integration-kit.yaml

This file was deleted.

4,241 changes: 0 additions & 4,241 deletions helm/camel-k/crds/crd-integration-platform.yaml

This file was deleted.

3,995 changes: 0 additions & 3,995 deletions helm/camel-k/crds/crd-integration-profile.yaml

This file was deleted.

8,318 changes: 0 additions & 8,318 deletions helm/camel-k/crds/crd-integration.yaml

This file was deleted.

8,923 changes: 0 additions & 8,923 deletions helm/camel-k/crds/crd-kamelet-binding.yaml

This file was deleted.

1,386 changes: 0 additions & 1,386 deletions helm/camel-k/crds/crd-kamelet.yaml

This file was deleted.

8,453 changes: 0 additions & 8,453 deletions helm/camel-k/crds/crd-pipe.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions script/gen_crd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ rm -rf ./config
# to root
cd ../../../

# Importing helm CRDs
cat ./script/headers/yaml.txt > ./helm/camel-k/crds/camel-k-crds.yaml
kustomize build ./pkg/resources/config/crd/. >> ./helm/camel-k/crds/camel-k-crds.yaml

deploy_crd_file() {
source=$1

Expand All @@ -55,8 +59,7 @@ deploy_crd() {
name=$1
plural=$2

deploy_crd_file ./pkg/resources/config/crd/bases/camel.apache.org_"$plural".yaml \
./helm/camel-k/crds/crd-"$name".yaml
deploy_crd_file ./pkg/resources/config/crd/bases/camel.apache.org_"$plural".yaml
}

deploy_crd build builds
Expand Down

0 comments on commit 1da5ce6

Please sign in to comment.