Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extensions field to Framework CRD #237

Merged
merged 1 commit into from
Mar 22, 2022
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 ci/limits.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"github.com/theketchio/ketch/cmd/ketch/output": 68.3,
"github.com/theketchio/ketch/cmd/manager": 0,
"github.com/theketchio/ketch/codeprofile/unit_test_coverage": 0,
"github.com/theketchio/ketch/internal/api/v1beta1": 33.2,
"github.com/theketchio/ketch/internal/api/v1beta1": 33.0,
"github.com/theketchio/ketch/internal/api/v1beta1/mocks": 0,
"github.com/theketchio/ketch/internal/build": 92.3,
"github.com/theketchio/ketch/internal/chart": 67.0,
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/theketch.io_apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,13 @@ spec:
- value
type: object
type: array
extensions:
description: Extensions can be used by third-parties to keep additional
information.
items:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
framework:
description: Framework is a name of a Framework used to run the application.
minLength: 1
Expand Down Expand Up @@ -2573,6 +2580,13 @@ spec:
- type
type: object
type: array
extensionsStatuses:
description: ExtensionsStatuses can be used by third-parties to keep
additional information.
items:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
framework:
description: 'ObjectReference contains enough information to let you
inspect or modify the referred object. --- New uses of this type
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/theketch.io_frameworks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ spec:
properties:
appQuotaLimit:
type: integer
extensions:
description: Extensions can be used by third-parties to keep additional
information.
items:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
ingressController:
description: IngressControllerSpec contains configuration for an ingress
controller.
Expand Down Expand Up @@ -91,6 +98,13 @@ spec:
items:
type: string
type: array
extensionsStatuses:
description: ExtensionsStatuses can be used by third-parties to keep
additional information.
items:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
jobs:
items:
type: string
Expand Down
16 changes: 12 additions & 4 deletions internal/api/v1beta1/app_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"time"

"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"

v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -153,11 +154,13 @@ const (

// AppStatus represents information about the status of an application.
type AppStatus struct {

// Conditions of App resource.
Conditions []Condition `json:"conditions,omitempty"`

Framework *v1.ObjectReference `json:"framework,omitempty"`
Conditions []Condition `json:"conditions,omitempty"`
Framework *v1.ObjectReference `json:"framework,omitempty"`
// ExtensionsStatuses can be used by third-parties to keep additional information.
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
ExtensionsStatuses []runtime.RawExtension `json:"extensionsStatuses,omitempty"`
}

// CanarySpec represents configuration for a canary deployment.
Expand Down Expand Up @@ -236,6 +239,11 @@ type AppSpec struct {

// SecurityContext specifies security settings for a pod/app, which get applied to all containers.
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`

// Extensions can be used by third-parties to keep additional information.
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extensions []runtime.RawExtension `json:"extensions,omitempty"`
}

// MetadataItem represent a request to add label/annotations to processes
Expand Down
10 changes: 10 additions & 0 deletions internal/api/v1beta1/framework_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1beta1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -58,6 +59,11 @@ type FrameworkSpec struct {
AppQuotaLimit *int `json:"appQuotaLimit"`

IngressController IngressControllerSpec `json:"ingressController,omitempty"`

// Extensions can be used by third-parties to keep additional information.
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extensions []runtime.RawExtension `json:"extensions,omitempty"`
}

type FrameworkPhase string
Expand Down Expand Up @@ -96,6 +102,10 @@ type FrameworkStatus struct {
Namespace *v1.ObjectReference `json:"namespace,omitempty"`
Apps []string `json:"apps,omitempty"`
Jobs []string `json:"jobs,omitempty"`
// ExtensionsStatuses can be used by third-parties to keep additional information.
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
ExtensionsStatuses []runtime.RawExtension `json:"extensionsStatuses,omitempty"`
}

func (p *Framework) HasApp(name string) bool {
Expand Down