Skip to content

Commit

Permalink
feat: introduce v1beta1 api type
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalgalaw committed Sep 16, 2024
1 parent 1060ecd commit 0aa007b
Show file tree
Hide file tree
Showing 66 changed files with 3,948 additions and 1,037 deletions.
72 changes: 72 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,76 @@ resources:
kind: GitHubCredentials
path: github.com/mercedes-benz/garm-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: Enterprise
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: Organization
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: Repository
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: Pool
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: Runner
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: Image
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: GitHubEndpoint
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: GitHubCredentials
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: mercedes-benz.com
group: garm-operator
kind: GarmServerConfig
path: github.com/mercedes-benz/garm-operator/api/v1beta1
version: v1beta1
version: "3"
9 changes: 3 additions & 6 deletions api/v1alpha1/enterprise_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
package v1alpha1

import (
"github.com/cloudbase/garm/params"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/mercedes-benz/garm-operator/pkg/util/conditions"
)

// EnterpriseSpec defines the desired state of Enterprise
type EnterpriseSpec struct {
CredentialsRef corev1.TypedLocalObjectReference `json:"credentialsRef"`
CredentialsName string `json:"credentialsName"`

// WebhookSecretRef represents a secret that should be used for the webhook
WebhookSecretRef SecretRef `json:"webhookSecretRef"`
PoolBalancerType params.PoolBalancerType `json:"poolBalancerType,omitempty"`
WebhookSecretRef SecretRef `json:"webhookSecretRef"`
}

// EnterpriseStatus defines the observed state of Enterprise
Expand Down Expand Up @@ -52,7 +49,7 @@ func (e *Enterprise) GetConditions() []metav1.Condition {
}

func (e *Enterprise) GetCredentialsName() string {
return e.Spec.CredentialsRef.Name
return e.Spec.CredentialsName
}

func (e *Enterprise) GetID() string {
Expand Down
9 changes: 3 additions & 6 deletions api/v1alpha1/organization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
package v1alpha1

import (
"github.com/cloudbase/garm/params"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/mercedes-benz/garm-operator/pkg/util/conditions"
)

// OrganizationSpec defines the desired state of Organization
type OrganizationSpec struct {
CredentialsRef corev1.TypedLocalObjectReference `json:"credentialsRef"`
CredentialsName string `json:"credentialsName"`

// WebhookSecretRef represents a secret that should be used for the webhook
WebhookSecretRef SecretRef `json:"webhookSecretRef"`
PoolBalancerType params.PoolBalancerType `json:"poolBalancerType,omitempty"`
WebhookSecretRef SecretRef `json:"webhookSecretRef"`
}

// OrganizationStatus defines the observed state of Organization
Expand Down Expand Up @@ -52,7 +49,7 @@ func (o *Organization) GetConditions() []metav1.Condition {
}

func (o *Organization) GetCredentialsName() string {
return o.Spec.CredentialsRef.Name
return o.Spec.CredentialsName
}

func (o *Organization) GetID() string {
Expand Down
11 changes: 4 additions & 7 deletions api/v1alpha1/repository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@
package v1alpha1

import (
"github.com/cloudbase/garm/params"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/mercedes-benz/garm-operator/pkg/util/conditions"
)

// RepositorySpec defines the desired state of Repository
type RepositorySpec struct {
CredentialsRef corev1.TypedLocalObjectReference `json:"credentialsRef"`
Owner string `json:"owner"`
CredentialsName string `json:"credentialsName"`
Owner string `json:"owner"`

// WebhookSecretRef represents a secret that should be used for the webhook
WebhookSecretRef SecretRef `json:"webhookSecretRef"`
PoolBalancerType params.PoolBalancerType `json:"poolBalancerType,omitempty"`
WebhookSecretRef SecretRef `json:"webhookSecretRef"`
}

// RepositoryStatus defines the observed state of Repository
Expand Down Expand Up @@ -53,7 +50,7 @@ func (r *Repository) GetConditions() []metav1.Condition {
}

func (r *Repository) GetCredentialsName() string {
return r.Spec.CredentialsRef.Name
return r.Spec.CredentialsName
}

func (r *Repository) GetID() string {
Expand Down
Loading

0 comments on commit 0aa007b

Please sign in to comment.