diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 27d68825..27ddd8cf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -28,6 +28,12 @@ # Rodrigo Bassil (rodrigobassil) # Anand Raja Kesavamoorhty (anandrajak1) # Abhilash Muralidhara (abhi16394) +# Chiman Jain (chimanjain) +# Harish H (HarishH-DELL) +# Nitesh Rewatkar (nitesh3108) +# Rajendra Indukuri (rajendraindukuri) +# Shefali Malhotra (shefali-malhotra) +# Spandita Panigrahi (panigs7) # for all files: -* @gallacher @tdawe @alikdell @atye @hoppea2 @coulof @shaynafinocchiaro @sharmilarama @EvgenyUglov @bjiang27 @xuluna @PeresKereotubo @EmilyKatdell @KerryKovacevic @MaksimDell @jooseppi-luna @Sahiba-Gupta @jackieung-dell @rodrigobassil @anandrajak1 @abhi16394 +* @gallacher @tdawe @alikdell @atye @hoppea2 @coulof @shaynafinocchiaro @sharmilarama @EvgenyUglov @bjiang27 @xuluna @PeresKereotubo @EmilyKatdell @KerryKovacevic @MaksimDell @jooseppi-luna @Sahiba-Gupta @jackieung-dell @rodrigobassil @anandrajak1 @abhi16394 @chimanjain @shefali-malhotra @panigs7 @nitesh3108 @rajendraindukuri @HarishH-DELL diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 6d31066f..a0de5462 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run the formatter, linter, and vetter uses: dell/common-github-actions/go-code-formatter-linter-vetter@main with: @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run the forbidden words scan uses: dell/common-github-actions/code-sanitizer@main with: @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run Go Security uses: securego/gosec@master with: @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run malware scan uses: dell/common-github-actions/malware-scanner@main with: @@ -81,12 +81,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.21+ - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ^1.21 id: go - name: Checkout the code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Mockgen run: go get github.com/golang/mock/mockgen@v1.6.0 - name: Get dependencies diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 831352b6..1db92152 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -14,17 +14,17 @@ jobs: name: golangci-lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" cache: false - name: Checkout the code - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v4 - name: Vendor packages run: | go mod vendor - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest skip-cache: true diff --git a/Dockerfile b/Dockerfile index fb1dcdb5..71947209 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +ARG GOIMAGE ARG BASEIMAGE +# Stage to build the module +FROM $GOIMAGE as builder + +ARG APP + +WORKDIR /workspace +COPY . . +RUN go mod download + +RUN CGO_ENABLED=0 go build -o $APP ./cmd/$APP + FROM $BASEIMAGE as final LABEL vendor="Dell Inc." \ name="csm-authorization" \ @@ -23,6 +35,6 @@ LABEL vendor="Dell Inc." \ ARG APP WORKDIR /app -COPY $APP /app/command +COPY --from=builder /workspace/$APP /app/command ENTRYPOINT [ "/app/command" ] diff --git a/Makefile b/Makefile index ad148ae4..55e6c580 100644 --- a/Makefile +++ b/Makefile @@ -37,13 +37,7 @@ K3S_SELINUX_VERSION ?= 0.4-1 .PHONY: build build: -mkdir -p ./bin - cp Dockerfile ./bin/Dockerfile - CGO_ENABLED=0 go build -o ./bin ./cmd/proxy-server/ CGO_ENABLED=0 go build -o ./bin ./cmd/karavictl/ - CGO_ENABLED=0 go build -o ./bin ./cmd/sidecar-proxy/ - CGO_ENABLED=0 go build -o ./bin ./cmd/tenant-service/ - CGO_ENABLED=0 go build -o ./bin ./cmd/role-service/ - CGO_ENABLED=0 go build -o ./bin ./cmd/storage-service/ .PHONY: build-installer build-installer: @@ -86,11 +80,11 @@ redeploy: build builder .PHONY: builder builder: build download-csm-common $(eval include csm-common.mk) - $(BUILDER) build -t localhost/proxy-server:$(BUILDER_TAG) --build-arg APP=proxy-server --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) ./bin/. - $(BUILDER) build -t localhost/sidecar-proxy:$(SIDECAR_TAG) --build-arg APP=sidecar-proxy --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) ./bin/. - $(BUILDER) build -t localhost/tenant-service:$(BUILDER_TAG) --build-arg APP=tenant-service --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) ./bin/. - $(BUILDER) build -t localhost/role-service:$(BUILDER_TAG) --build-arg APP=role-service --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) ./bin/. - $(BUILDER) build -t localhost/storage-service:$(BUILDER_TAG) --build-arg APP=storage-service --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) ./bin/. + $(BUILDER) build -t localhost/proxy-server:$(BUILDER_TAG) --build-arg APP=proxy-server --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) . + $(BUILDER) build -t localhost/sidecar-proxy:$(SIDECAR_TAG) --build-arg APP=sidecar-proxy --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) . + $(BUILDER) build -t localhost/tenant-service:$(BUILDER_TAG) --build-arg APP=tenant-service --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) . + $(BUILDER) build -t localhost/role-service:$(BUILDER_TAG) --build-arg APP=role-service --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) . + $(BUILDER) build -t localhost/storage-service:$(BUILDER_TAG) --build-arg APP=storage-service --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) . .PHONY: protoc protoc: