Skip to content

Commit

Permalink
Remove Function CRD from porchconfig and Repo
Browse files Browse the repository at this point in the history
  • Loading branch information
efiacor committed Oct 4, 2024
1 parent a5b3b23 commit 55ce9bd
Show file tree
Hide file tree
Showing 20 changed files with 13 additions and 1,109 deletions.
121 changes: 0 additions & 121 deletions api/porchconfig/v1alpha1/config.porch.kpt.dev_functions.yaml

This file was deleted.

37 changes: 2 additions & 35 deletions api/porchconfig/v1alpha1/config.porch.kpt.dev_repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ spec:
- jsonPath: .spec.type
name: Type
type: string
- jsonPath: .spec.content
name: Content
type: string
- jsonPath: .spec.deployment
name: Deployment
type: boolean
Expand Down Expand Up @@ -59,10 +56,6 @@ spec:
Notes:
- deployment repository - in KRM API ConfigSync would be configured directly? (or via this API)
properties:
content:
description: Content stored in the repository (i.e. Function, Package
- the literal values correspond to the API resource names).
type: string
deployment:
description: The repository is a deployment repository; final packages
in this repository are deployment ready.
Expand Down Expand Up @@ -122,22 +115,9 @@ spec:
type: string
description: '`ConfigMap` specifies the function config (https://kpt.dev/reference/cli/fn/eval/).'
type: object
functionRef:
description: '`FunctionRef` specifies the function by reference
to a Function resource. Mutually exclusive with `Image`.'
properties:
name:
description: '`Name` is the name of the `Function` resource
referenced. The resource is expected to be within the
same namespace.'
type: string
required:
- name
type: object
image:
description: '`Image` specifies the function image, such as
`gcr.io/kpt-fn/gatekeeper:v0.2`. Use of `Image` is mutually
exclusive with `FunctionRef`.'
`gcr.io/kpt-fn/gatekeeper:v0.2`.'
type: string
type: object
type: array
Expand Down Expand Up @@ -262,22 +242,9 @@ spec:
type: string
description: '`ConfigMap` specifies the function config (https://kpt.dev/reference/cli/fn/eval/).'
type: object
functionRef:
description: '`FunctionRef` specifies the function by reference
to a Function resource. Mutually exclusive with `Image`.'
properties:
name:
description: '`Name` is the name of the `Function` resource
referenced. The resource is expected to be within the
same namespace.'
type: string
required:
- name
type: object
image:
description: '`Image` specifies the function image, such as
`gcr.io/kpt-fn/gatekeeper:v0.2`. Use of `Image` is mutually
exclusive with `FunctionRef`.'
`gcr.io/kpt-fn/gatekeeper:v0.2`.'
type: string
type: object
type: array
Expand Down
8 changes: 1 addition & 7 deletions api/porchconfig/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ var (
objects: []runtime.Object{&Repository{}, &RepositoryList{}},
}

TypeFunction = TypeInfo{
Kind: "Function",
Resource: GroupVersion.WithResource("functions"),
objects: []runtime.Object{&Function{}, &FunctionList{}},
}

AllKinds = []TypeInfo{TypeRepository, TypeFunction}
AllKinds = []TypeInfo{TypeRepository}
)

//+kubebuilder:object:generate=false
Expand Down
21 changes: 1 addition & 20 deletions api/porchconfig/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
//+kubebuilder:subresource:status
//+kubebuilder:resource:path=repositories,singular=repository
//+kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`
//+kubebuilder:printcolumn:name="Content",type=string,JSONPath=`.spec.content`
//+kubebuilder:printcolumn:name="Deployment",type=boolean,JSONPath=`.spec.deployment`
//+kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=='Ready')].status`
//+kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.spec['git','oci']['repo','registry']`
Expand All @@ -43,13 +42,6 @@ const (
RepositoryTypeOCI RepositoryType = "oci"
)

type RepositoryContent string

const (
RepositoryContentFunction RepositoryContent = "Function"
RepositoryContentPackage RepositoryContent = "Package"
)

// RepositorySpec defines the desired state of Repository
//
// Notes:
Expand All @@ -61,9 +53,6 @@ type RepositorySpec struct {
Deployment bool `json:"deployment,omitempty"`
// Type of the repository (i.e. git, OCI)
Type RepositoryType `json:"type,omitempty"`
// Content stored in the repository (i.e. Function, Package - the literal values correspond to the API resource names).
// TODO: support repository with mixed content?
Content RepositoryContent `json:"content,omitempty"`
// Git repository details. Required if `type` is `git`. Ignored if `type` is not `git`.
Git *GitRepository `json:"git,omitempty"`
// OCI repository details. Required if `type` is `oci`. Ignored if `type` is not `oci`.
Expand Down Expand Up @@ -138,20 +127,12 @@ type SecretRef struct {
}

type FunctionEval struct {
// `Image` specifies the function image, such as `gcr.io/kpt-fn/gatekeeper:v0.2`. Use of `Image` is mutually exclusive with `FunctionRef`.
// `Image` specifies the function image, such as `gcr.io/kpt-fn/gatekeeper:v0.2`.
Image string `json:"image,omitempty"`
// `FunctionRef` specifies the function by reference to a Function resource. Mutually exclusive with `Image`.
FunctionRef *FunctionRef `json:"functionRef,omitempty"`
// `ConfigMap` specifies the function config (https://kpt.dev/reference/cli/fn/eval/).
ConfigMap map[string]string `json:"configMap,omitempty"`
}

// `FunctionRef` is a reference to a `Function` resource.
type FunctionRef struct {
// `Name` is the name of the `Function` resource referenced. The resource is expected to be within the same namespace.
Name string `json:"name"`
}

const (
// Type of the Repository condition.
RepositoryReady = "Ready"
Expand Down
107 changes: 0 additions & 107 deletions api/porchconfig/v1alpha1/types_functions.go

This file was deleted.

Loading

0 comments on commit 55ce9bd

Please sign in to comment.