Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
- GIT_COMMIT=$(shell git rev-parse --short HEAD)
- GIT_STATE=$(shell if git diff --quiet; then echo clean; else echo dirty; fi)
- BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
- LDFLAGS=-s -w -X github.com/cloudoperators/greenhouse/pkg/version.GitBranch=$(GIT_BRANCH) -X github.com/cloudoperators/greenhouse/pkg/version.GitCommit=$(GIT_COMMIT) -X github.com/cloudoperators/greenhouse/pkg/version.GitState=$(GIT_STATE) -X github.com/cloudoperators/greenhouse/pkg/version.BuildDate=$(BUILD_DATE)
- LDFLAGS=-s -w -X github.com/cloudoperators/greenhouse/internal/version.GitBranch=$(GIT_BRANCH) -X github.com/cloudoperators/greenhouse/internal/version.GitCommit=$(GIT_COMMIT) -X github.com/cloudoperators/greenhouse/internal/version.GitState=$(GIT_STATE) -X github.com/cloudoperators/greenhouse/internal/version.BuildDate=$(BUILD_DATE)

builds:
- id: linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/config/ @cloudoperators/greenhouse-backend
/cmd/ @cloudoperators/greenhouse-backend
/hack/ @cloudoperators/greenhouse-backend
/pkg/ @cloudoperators/greenhouse-backend
/internal/ @cloudoperators/greenhouse-backend
/test/ @cloudoperators/greenhouse-backend
/ct.yaml @cloudoperators/greenhouse-backend
/Dockerfile @cloudoperators/greenhouse-backend
Expand Down
5 changes: 2 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ helm-charts:
core-apis:
- changed-files:
- any-glob-to-any-file:
- pkg/apis/**
- api/**
- config/crd/**

documentation:
Expand All @@ -19,8 +19,7 @@ idproxy:
- changed-files:
- any-glob-to-any-file:
- charts/idproxy/**
- pkg/idproxy/**
- pkg/dex/**
- internal/dex/**

ui:
- changed-files:
Expand Down
5 changes: 2 additions & 3 deletions .github/licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ header:
- '**/*.txt'
- '*Dockerfile*'
- 'Makefile'
- 'pkg/dex/web/**'
- 'pkg/apis/scheme_builder.go' # Belongs to the Kubernetes authors
- 'internal/dex/web/**'
- '**/zz_generated.deepcopy.go' # Generated by Kubebuilder
- 'charts/**/templates/*.yaml' # license headers on helm templates are causing issues
- '.mockery.yaml' # Mockery config file
- 'pkg/mocks/**' # Mockery generated files
- 'internal/mocks/**' # Mockery generated files
- 'config/flux/**' #Flux CD files
- 'config/manifest/**' #Flux CD files

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-greenhousectl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
# - '**'
# paths:
# - cmd/greenhousectl/**
# - pkg/cmd/**
# - internal/cmd/**

permissions:
contents: write # required to create a release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-changes-crd-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "pkg/apis/greenhouse/v1alpha1/**"
- "api/v1alpha1/**"

jobs:
generate-docs-types-specs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
pull_request:
paths:
- 'pkg/**'
- 'internal/**'
- 'e2e/**'
- 'cmd/**'
- 'Dockerfile*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'pkg/**'
- 'internal/**'
- 'e2e/**'
- 'cmd/**'
- 'Dockerfile*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
paths:
- cmd/**
- pkg/**
- internal/**
- website/**
- Dockerfile
- go.mod
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Unit tests"
on:
pull_request:
paths:
- 'pkg/**'
- 'internal/**'
- 'cmd/**'
- 'Dockerfile*'
- 'go.mod'
Expand Down Expand Up @@ -53,4 +53,4 @@ jobs:
go-version-file: 'go.mod'
token: ${{ secrets.GITHUB_TOKEN }}
- name: build
run: make build
run: make build
6 changes: 3 additions & 3 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
with-expecter: false
filename: "mock_{{.InterfaceName}}.go"
outpkg: mocks
dir: pkg/mocks
dir: internal/mocks
packages:
github.com/cloudoperators/greenhouse/pkg/lifecycle:
github.com/cloudoperators/greenhouse/internal/lifecycle:
interfaces:
Reconciler:
sigs.k8s.io/controller-runtime/pkg/client:
Expand All @@ -13,4 +13,4 @@ packages:
SubResourceWriter:
github.com/dexidp/dex/storage:
interfaces:
Storage:
Storage:
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ generate-all: generate generate-manifests generate-documentation ## Generate co
.PHONY: manifests
manifests: generate-manifests generate-documentation generate-types

## Generate manifests for CRD, RBAC, Webhook and helmify the files
## CRD manifests are generated in hack/crd/bases
## Patches for CRD conversion webhooks need to be created under hack/crd/patches
## filename should be in the format webhook.*<group>*.*<kind>*.yaml"
.PHONY: generate-manifests
generate-manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) crd paths="./pkg/apis/..." output:crd:artifacts:config=$(CRD_MANIFESTS_PATH)
$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./pkg/admission/..." paths="./pkg/controllers/..." output:artifacts:config=$(TEMPLATES_MANIFESTS_PATH)
$(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=hack/crd/bases
GOBIN=$(LOCALBIN) go run ./hack/generate.go --crd-dir="./hack/crd" --charts-crd-dir=$(CRD_MANIFESTS_PATH)
rm -rf hack/crd/bases

$(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./internal/webhook/..." paths="./internal/controller/..." output:artifacts:config=$(TEMPLATES_MANIFESTS_PATH)
hack/helmify $(TEMPLATES_MANIFESTS_PATH)
docker run --rm -v $(shell pwd):/github/workspace $(IMG_LICENSE_EYE) -c .github/licenserc.yaml header fix

Expand All @@ -71,16 +78,16 @@ generate-types: generate-open-api-spec## Generate typescript types from CRDs.

.PHONY: actiongenerate
actiongenerate: action-controllergen
$(CONTROLLER_GEN_ACTION) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/apis/..."
$(CONTROLLER_GEN_ACTION) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/dex/..."
$(CONTROLLER_GEN_ACTION) object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
$(CONTROLLER_GEN_ACTION) object:headerFile="hack/boilerplate.go.txt" paths="./internal/dex/..."

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/apis/..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/dex/..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./internal/dex/..."

# Default values
GEN_DOCS_API_DIR ?= "./pkg/apis/greenhouse/v1alpha1" ## -app-dir should be Canonical Path Format so absolute path doesn't work. That's why we don't use $(CURDIR) here.
GEN_DOCS_API_DIR ?= "./api/v1alpha1" ## -app-dir should be Canonical Path Format so absolute path doesn't work. That's why we don't use $(CURDIR) here.
GEN_DOCS_CONFIG ?= "$(CURDIR)/hack/docs-generator/config.json"
GEN_DOCS_TEMPLATE_DIR ?= "$(CURDIR)/hack/docs-generator/templates"
GEN_DOCS_OUT_FILE ?= "$(CURDIR)/docs/reference/api/index.html"
Expand Down Expand Up @@ -131,7 +138,7 @@ build-%: GIT_COMMIT = $(shell git rev-parse --short HEAD)
build-%: GIT_STATE = $(shell if git diff --quiet; then echo clean; else echo dirty; fi)
build-%: BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
build-%:
go build -ldflags "-s -w -X github.com/cloudoperators/greenhouse/pkg/version.GitBranch=$(GIT_BRANCH) -X github.com/cloudoperators/greenhouse/pkg/version.GitCommit=$(GIT_COMMIT) -X github.com/cloudoperators/greenhouse/pkg/version.GitState=$(GIT_STATE) -X github.com/cloudoperators/greenhouse/pkg/version.BuildDate=$(BUILD_DATE)" -o bin/$* ./cmd/$*/
go build -ldflags "-s -w -X github.com/cloudoperators/greenhouse/internal/version.GitBranch=$(GIT_BRANCH) -X github.com/cloudoperators/greenhouse/internal/version.GitCommit=$(GIT_COMMIT) -X github.com/cloudoperators/greenhouse/internal/version.GitState=$(GIT_STATE) -X github.com/cloudoperators/greenhouse/internal/version.BuildDate=$(BUILD_DATE)" -o bin/$* ./cmd/$*/

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
Expand Down
22 changes: 11 additions & 11 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: sap
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
multigroup: true
projectName: greenhouse
repo: github.com/cloudoperators/greenhouse
Expand All @@ -15,7 +15,7 @@ resources:
domain: sap
group: greenhouse
kind: Organization
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -28,7 +28,7 @@ resources:
domain: sap
group: greenhouse
kind: Team
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -41,7 +41,7 @@ resources:
domain: sap
group: greenhouse
kind: PluginDefinition
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -54,7 +54,7 @@ resources:
domain: sap
group: greenhouse
kind: Plugin
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -67,7 +67,7 @@ resources:
domain: sap
group: greenhouse
kind: Cluster
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -79,7 +79,7 @@ resources:
domain: sap
group: greenhouse
kind: TeamMembership
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -88,7 +88,7 @@ resources:
domain: sap
group: greenhouse
kind: TeamRole
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -100,7 +100,7 @@ resources:
domain: sap
group: greenhouse
kind: TeamRoleBinding
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -113,7 +113,7 @@ resources:
domain: sap
group: greenhouse
kind: PluginPreset
path: github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
Expand All @@ -125,6 +125,6 @@ resources:
domain: sap
group: greenhouse
kind: ClusterKubeconfig
path: github.com/cloudoperators/greenhouse/apis/greenhouse/v1alpha1
path: github.com/cloudoperators/greenhouse/api/v1alpha1
version: v1alpha1
version: "3"
2 changes: 1 addition & 1 deletion pkg/apis/greenhouse/doc.go β†’ api/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// SPDX-License-Identifier: Apache-2.0

// +groupName=greenhouse.sap
package greenhouse
package api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/cloudoperators/greenhouse/pkg/test"
"github.com/cloudoperators/greenhouse/internal/test"
)

func TestAPI(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

greenhousev1alpha1 "github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1"
greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1"
)

var _ = Describe("Test conditions util functions", func() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
// SPDX-License-Identifier: Apache-2.0

// Package v1alpha1 contains API Schema definitions for the greenhouse.sap v1alpha1 API group
// Package v1alpha1 contains API Schema definitions for the greenhouse v1alpha1 API group.
// +kubebuilder:object:generate=true
// +groupName=greenhouse.sap
package v1alpha1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"

"github.com/cloudoperators/greenhouse/pkg/apis"
apis "github.com/cloudoperators/greenhouse/api"
)

var (
// GroupVersion is group version used to register these objects
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: apis.GroupName, Version: "v1alpha1"}

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

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/cloudoperators/greenhouse/pkg/scim"
"github.com/cloudoperators/greenhouse/internal/scim"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

greenhouseapis "github.com/cloudoperators/greenhouse/pkg/apis"
greenhouseapis "github.com/cloudoperators/greenhouse/api"
)

// TeamRoleSpec defines the desired state of a TeamRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

greenhouseapis "github.com/cloudoperators/greenhouse/pkg/apis"
greenhouseapis "github.com/cloudoperators/greenhouse/api"
)

// TeamRoleBindingSpec defines the desired state of a TeamRoleBinding
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
. "github.com/onsi/gomega"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/cloudoperators/greenhouse/pkg/apis/greenhouse/v1alpha1"
"github.com/cloudoperators/greenhouse/pkg/test"
"github.com/cloudoperators/greenhouse/api/v1alpha1"
"github.com/cloudoperators/greenhouse/internal/test"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/well_known.go β†’ api/well_known.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
// SPDX-License-Identifier: Apache-2.0

package apis
package api

import (
corev1 "k8s.io/api/core/v1"
Expand Down
Loading
Loading