Skip to content

Commit 8bd26ee

Browse files
OlegErshovakafazovaaronschweignexus49
authored
Migration from open mfp (#6)
* feat: migrated dependencies from OpenMFP to Platform-mesh * fix: updated dockerfile for pulling private packages * updated imports * migrated the latest changes from fga-operator * fix: updated docker file * Apply suggestions from code review fixes Co-authored-by: Aaron Schweig <[email protected]> * ci: troubleshooting build * fix: streamline Dockerfile git configuration commands * fix: model generation does now respect resource scope * fix: streamline Dockerfile git configuration commands * ci: fixing build * fix: update Go version and correct environment variable naming in Taskfile * fix: update Go version in Dockerfile to 1.24.5 * fix: remove lint-ignore comment for logicalcluster import in initializer and store controller --------- Co-authored-by: Angel Kafazov <[email protected]> Co-authored-by: Aaron Schweig <[email protected]> Co-authored-by: Bastian Echterhölter <[email protected]> Co-authored-by: aaronschweig <[email protected]>
1 parent a089d19 commit 8bd26ee

File tree

56 files changed

+718
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+718
-325
lines changed

.github/workflows/pipeline.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
concurrency:
1414
group: ${{ github.ref }}
1515
cancel-in-progress: true
16-
uses: openmfp/gha/.github/workflows/pipeline-golang-app.yml@main
16+
uses: platform-mesh/.github/.github/workflows/pipeline-golang-app.yml@ci/with-token-arg
1717
secrets: inherit
1818
with:
19-
imageTagName: ghcr.io/openmfp/fga-operator
19+
imageTagName: ghcr.io/platform-mesh/security-operator
2020
useTask: true
2121
useLocalCoverageConfig: true
2222
coverageThresholdTotal: 90

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Default code owners
2-
* @openmfp/frame
2+
* @platform-mesh/frame
33
go.mod
44
go.sum

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
# Build the manager binary
2-
FROM docker.io/golang:1.24 AS builder
2+
FROM golang:1.24.5-bullseye AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

6+
### BEGIN GHE Configurations ###
7+
ENV GOPRIVATE="github.com/platform-mesh"
8+
ENV GOSUMDB=off
9+
10+
RUN git config --global credential.helper store
11+
RUN --mount=type=secret,id=org_token echo "https://gha:$(cat /run/secrets/org_token)@github.com" > /root/.git-credentials
612
WORKDIR /workspace
13+
714
# Copy the Go Modules manifests
815
COPY go.mod go.mod
916
COPY go.sum go.sum
1017
# cache deps before building and copying source so that we don't need to re-download as much
1118
# and so that source changes don't invalidate our downloaded layer
1219
RUN go mod download
13-
1420
# Copy the go source
1521
COPY cmd/ cmd/
1622
COPY api/ api/

PROJECT

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,27 @@
22
# This file is used to track the info used to scaffold your project
33
# and allow the plugins properly work.
44
# More info: https://book.kubebuilder.io/reference/project-config.html
5-
domain: openmfp.io
5+
domain: platform-mesh.io
66
layout:
77
- go.kubebuilder.io/v4
8-
projectName: fga-operator
9-
repo: github.com/openmfp/fga-operator
8+
plugins:
9+
helm.kubebuilder.io/v1-alpha: {}
10+
projectName: security-operator
11+
repo: github.com/platform-mesh/security-operator
1012
resources:
1113
- api:
1214
crdVersion: v1
1315
controller: true
14-
domain: openmfp.org
16+
domain: platform-mesh.io
1517
group: core
1618
kind: Store
17-
path: github.com/openmfp/fga-operator/api/v1alpha1
19+
path: github.com/platform-mesh/security-operator/api/v1alpha1
1820
version: v1alpha1
1921
- api:
2022
crdVersion: v1
21-
domain: openmfp.org
23+
domain: platform-mesh.io
2224
group: core
2325
kind: AuthorizationModel
24-
path: github.com/openmfp/fga-operator/api/v1alpha1
26+
path: github.com/platform-mesh/security-operator/api/v1alpha1
2527
version: v1alpha1
2628
version: "3"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# fga-operator
1+
# security-operator
22
// TODO(user): Add simple overview of use/purpose
33

44
## Description
@@ -16,7 +16,7 @@
1616
**Build and push your image to the location specified by `IMG`:**
1717

1818
```sh
19-
make docker-build docker-push IMG=<some-registry>/fga-operator:tag
19+
make docker-build docker-push IMG=<some-registry>/security-operator:tag
2020
```
2121

2222
**NOTE:** This image ought to be published in the personal registry you specified.
@@ -32,7 +32,7 @@ make install
3232
**Deploy the Manager to the cluster with the image specified by `IMG`:**
3333

3434
```sh
35-
make deploy IMG=<some-registry>/fga-operator:tag
35+
make deploy IMG=<some-registry>/security-operator:tag
3636
```
3737

3838
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
@@ -75,7 +75,7 @@ Following the options to release and provide this solution to the users.
7575
1. Build the installer for the image built and published in the registry:
7676

7777
```sh
78-
make build-installer IMG=<some-registry>/fga-operator:tag
78+
make build-installer IMG=<some-registry>/security-operator:tag
7979
```
8080

8181
**NOTE:** The makefile target mentioned above generates an 'install.yaml'
@@ -89,7 +89,7 @@ Users can just run 'kubectl apply -f <URL for YAML BUNDLE>' to install
8989
the project, i.e.:
9090

9191
```sh
92-
kubectl apply -f https://raw.githubusercontent.com/<org>/fga-operator/<tag or branch>/dist/install.yaml
92+
kubectl apply -f https://raw.githubusercontent.com/<org>/security-operator/<tag or branch>/dist/install.yaml
9393
```
9494

9595
### By providing a Helm Chart

Taskfile.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ vars:
88
CRD_DIRECTORY: config/crd/bases
99
KCP_APIGEN_VERSION: v0.21.0
1010
KCP_VERSION: 0.26.1
11+
GOLANGCI_LINT_VERSION: v1.64.8
1112
GOARCH:
1213
sh: go env GOARCH
1314
GOOS:
@@ -28,7 +29,7 @@ tasks:
2829
setup:golangci-lint:
2930
internal: true
3031
cmds:
31-
- test -s {{.LOCAL_BIN}}/golangci-lint || GOBIN=$(pwd)/{{.LOCAL_BIN}} go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
32+
- test -s {{.LOCAL_BIN}}/golangci-lint || GOBIN=$(pwd)/{{.LOCAL_BIN}} go install github.com/golangci/golangci-lint/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}}
3233
setup:docker-compose:
3334
internal: true
3435
cmds:
@@ -72,10 +73,14 @@ tasks:
7273
envtest:
7374
internal: true
7475
env:
76+
GOPRIVATE: github.com/platform-mesh
7577
KUBEBUILDER_ASSETS:
7678
sh: $(pwd)/{{.LOCAL_BIN}}/setup-envtest use {{.ENVTEST_K8S_VERSION}} --bin-dir $(pwd)/{{.LOCAL_BIN}} -p path
7779
GO111MODULE: on
80+
PLATFORM_MESH_TOKEN: ${PLATFORM_MESH_TOKEN}
7881
cmds:
82+
- echo "https://openmfp:[email protected]" >> $HOME/.git-credentials
83+
- git config --global url."https://${PLATFORM_MESH_TOKEN}@github.com/".insteadOf "https://github.com/"
7984
- go test -count=1 ./... {{.ADDITIONAL_COMMAND_ARGS}}
8085
test:
8186
deps: [setup:envtest]

api/v1alpha1/authorizationmodel_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package v1alpha1
22

33
import (
4-
"github.com/openmfp/golang-commons/controller/lifecycle"
4+
lifecycleapi "github.com/platform-mesh/golang-commons/controller/lifecycle/api"
55
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
66
)
77

@@ -46,7 +46,7 @@ func (in *AuthorizationModel) SetConditions(conditions []metav1.Condition) {
4646
in.Status.Conditions = conditions
4747
}
4848

49-
var _ lifecycle.RuntimeObjectConditions = &AuthorizationModel{}
49+
var _ lifecycleapi.RuntimeObjectConditions = &AuthorizationModel{}
5050

5151
// +kubebuilder:object:root=true
5252

api/v1alpha1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Package v1alpha1 contains API Schema definitions for the core v1alpha1 API group.
22
// +kubebuilder:object:generate=true
3-
// +groupName=fga.openmfp.org
3+
// +groupName=core.platform-mesh.io
44
package v1alpha1
55

66
import (
@@ -10,7 +10,7 @@ import (
1010

1111
var (
1212
// GroupVersion is group version used to register these objects.
13-
GroupVersion = schema.GroupVersion{Group: "fga.openmfp.org", Version: "v1alpha1"}
13+
GroupVersion = schema.GroupVersion{Group: "core.platform-mesh.io", Version: "v1alpha1"}
1414

1515
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
1616
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

api/v1alpha1/store_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package v1alpha1
33
import (
44
"fmt"
55

6-
"github.com/openmfp/golang-commons/controller/lifecycle"
6+
lifecycleapi "github.com/platform-mesh/golang-commons/controller/lifecycle/api"
77
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
88
)
99

1010
const (
11-
StoreRefLabelKey = "fga.openmfp.org/store-name"
11+
StoreRefLabelKey = "core.platform-mesh.io/store-name"
1212
)
1313

1414
type Tuple struct {
@@ -59,7 +59,7 @@ func (in *Store) SetConditions(conditions []metav1.Condition) {
5959
in.Status.Conditions = conditions
6060
}
6161

62-
var _ lifecycle.RuntimeObjectConditions = &Store{}
62+
var _ lifecycleapi.RuntimeObjectConditions = &Store{}
6363

6464
// +kubebuilder:object:root=true
6565

cmd/initializer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"sigs.k8s.io/controller-runtime/pkg/kcp"
1313
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
1414

15-
"github.com/openmfp/fga-operator/internal/controller"
15+
"github.com/platform-mesh/security-operator/internal/controller"
1616
)
1717

1818
var initializerCmd = &cobra.Command{
@@ -25,7 +25,7 @@ var initializerCmd = &cobra.Command{
2525
mgrOpts := ctrl.Options{
2626
Scheme: scheme,
2727
LeaderElection: defaultCfg.LeaderElection.Enabled,
28-
LeaderElectionID: "fga-operator-initializer.openmfp.org",
28+
LeaderElectionID: "security-operator-initializer.platform-mesh.io",
2929
HealthProbeBindAddress: defaultCfg.HealthProbeBindAddress,
3030
Metrics: server.Options{
3131
BindAddress: defaultCfg.Metrics.BindAddress,

0 commit comments

Comments
 (0)