Skip to content
Draft
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
757 changes: 730 additions & 27 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ resolver = "2"
members = [
"fact",
"fact-api",
"fact-core",
"fact-ebpf",
"fact-operator",
]
default-members = ["fact"]

Expand Down Expand Up @@ -31,6 +33,7 @@ prometheus-client = { version = "0.25.0", default-features = false }
prost = "0.14.0"
prost-types = "0.14.0"
rand = { version = "0.10.1", default-features = false, features = ["thread_rng"] }
schemars = { version = "1" }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.142"
shlex = "2.0.1"
Expand Down
27 changes: 24 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ ARG FACT_VERSION
ARG CARGO_ARGS=""
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release $CARGO_ARGS && \
cp target/release/fact fact
cargo build --release $CARGO_ARGS --all && \
cp target/release/fact fact && \
cp target/release/fact-operator fact-operator

FROM ubi-micro-base
FROM ubi-micro-base AS fact

ARG FACT_VERSION
LABEL name="fact" \
Expand All @@ -65,3 +66,23 @@ COPY LICENSE-APACHE LICENSE-MIT LICENSE-GPL2 /licenses/
RUN update-crypto-policies --set DEFAULT:PQ

ENTRYPOINT ["fact"]

FROM ubi-micro-base AS fact-operator

ARG FACT_VERSION
LABEL name="fact-operator" \
vendor="StackRox" \
maintainer="support@stackrox.com" \
summary="File activity operator" \
description="This image supports an operator for deploying the file activity daemonset" \
io.stackrox.fact-operator.version="${FACT_VERSION}"

COPY --from=package_installer /out/ /

COPY --from=build /app/fact-operator /usr/local/bin

COPY LICENSE-APACHE LICENSE-MIT LICENSE-GPL2 /licenses/

RUN update-crypto-policies --set DEFAULT:PQ

ENTRYPOINT ["fact-operator"]
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,32 @@ version:
image-name:
@echo "$(FACT_IMAGE_NAME)"

operator-name:
@echo "$(FACT_OPERATOR_NAME)"

mock-server:
make -C mock-server

BUILD_TARGET ?= fact
IMAGE_NAME ?= $(FACT_IMAGE_NAME)

image:
$(DOCKER) build \
-f Containerfile \
--build-arg FACT_VERSION=$(FACT_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg CARGO_ARGS="$(CARGO_ARGS)" \
-t $(FACT_IMAGE_NAME) \
--target $(BUILD_TARGET) \
-t $(IMAGE_NAME) \
$(CURDIR)

image-otel: CARGO_ARGS = --features otel
image-otel: image

operator: BUILD_TARGET = fact-operator
operator: IMAGE_NAME = $(FACT_OPERATOR_NAME)
operator: image

licenses:THIRD_PARTY_LICENSES.html

THIRD_PARTY_LICENSES.html:Cargo.lock
Expand Down Expand Up @@ -58,4 +69,5 @@ format:
make -C fact-ebpf format
ruff format tests/

.PHONY: tag mock-server integration-tests image image-otel image-name licenses coverage lint clean
.PHONY: tag mock-server integration-tests image image-otel image-name
.PHONY: operator operator-name licenses coverage lint clean
2 changes: 2 additions & 0 deletions constants.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FACT_TAG ?= $(shell git describe --always --tags --abbrev=10 --dirty)
FACT_VERSION ?= $(FACT_TAG)
FACT_REGISTRY ?= quay.io/stackrox-io/fact
FACT_IMAGE_NAME ?= $(FACT_REGISTRY):$(FACT_TAG)
FACT_OPERATOR_REGISTRY ?= quay.io/stackrox-io/fact-operator
FACT_OPERATOR_NAME ?= $(FACT_OPERATOR_REGISTRY):$(FACT_TAG)

CLANG_FMT ?= $(shell which clang-format)

Expand Down
17 changes: 17 additions & 0 deletions fact-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "fact-core"
version = "0.1.0"
edition = "2024"
license.workspace = true

[dependencies]
anyhow = { workspace = true }
clap = { workspace = true }
log = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
yaml-rust2 = { workspace = true }

[build-dependencies]
anyhow = { workspace = true }
File renamed without changes.
Loading
Loading