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 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