From b347a8e840bde801cb13c8a25af1f8f294e7e81a Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 18 Dec 2023 16:47:54 +0530 Subject: [PATCH 1/2] fix(nimbus): fix crd spec issue Signed-off-by: sahil --- .../bases/intent.security.nimbus.com_securityintents.yaml | 1 - pkg/api/v1/securityintent_types.go | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/crd/bases/intent.security.nimbus.com_securityintents.yaml b/config/crd/bases/intent.security.nimbus.com_securityintents.yaml index a40e688d..3cde3bdd 100644 --- a/config/crd/bases/intent.security.nimbus.com_securityintents.yaml +++ b/config/crd/bases/intent.security.nimbus.com_securityintents.yaml @@ -201,7 +201,6 @@ spec: type: string required: - action - - description - resource - type type: object diff --git a/pkg/api/v1/securityintent_types.go b/pkg/api/v1/securityintent_types.go index cbd58274..b0bc9f73 100644 --- a/pkg/api/v1/securityintent_types.go +++ b/pkg/api/v1/securityintent_types.go @@ -20,10 +20,10 @@ type SecurityIntentSpec struct { // Intent defines the security policy details type Intent struct { - Description string `json:"description"` // Define the description - Action string `json:"action"` // Define the action of the policy - Type string `json:"type"` // Defines the type of the policy - Resource []Resource `json:"resource"` // Define the resources to which the security policy applies + Description string `json:"description,omitempty"` // Define the description + Action string `json:"action"` // Define the action of the policy + Type string `json:"type"` // Defines the type of the policy + Resource []Resource `json:"resource"` // Define the resources to which the security policy applies } // Resource defines the resources that the security policy applies to From 5413554733ebcbb9e535b9e90700998cc58b247a Mon Sep 17 00:00:00 2001 From: sahil Date: Mon, 18 Dec 2023 16:58:41 +0530 Subject: [PATCH 2/2] fix(nimbus): fix dockerfile Signed-off-by: sahil --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c8255318..3b1e3ecf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ COPY pkg/controllers/ pkg/controllers/ # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details