Skip to content

Commit

Permalink
Merge pull request #119 from Nordix/remove_function
Browse files Browse the repository at this point in the history
Remove Function CRD from porchconfig and Repo
  • Loading branch information
nephio-prow[bot] authored Nov 5, 2024
2 parents 23058a1 + 12f7597 commit b1d6599
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 1,099 deletions.
121 changes: 0 additions & 121 deletions api/porchconfig/v1alpha1/config.porch.kpt.dev_functions.yaml

This file was deleted.

40 changes: 10 additions & 30 deletions api/porchconfig/v1alpha1/config.porch.kpt.dev_repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ spec:
- 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).
default: Package
description: |-
The Content field is deprecated, please do not specify it in new manifests.
For partial backward compatibility it is still recognized, but its only valid value is "Package", and if not specified its default value is also "Package".
type: string
x-kubernetes-validations:
- message: The 'content' field is deprecated, its only valid value
is 'Package'
rule: self == '' || self == 'Package'
deployment:
description: The repository is a deployment repository; final packages
in this repository are deployment ready.
Expand Down Expand Up @@ -122,22 +128,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 +255,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
20 changes: 7 additions & 13 deletions api/porchconfig/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const (
type RepositoryContent string

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

Expand All @@ -61,9 +60,12 @@ 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"`
// The Content field is deprecated, please do not specify it in new manifests.
// For partial backward compatibility it is still recognized, but its only valid value is "Package", and if not specified its default value is also "Package".
// +kubebuilder:validation:XValidation:message="The 'content' field is deprecated, its only valid value is 'Package'",rule="self == '' || self == 'Package'"
// +kubebuilder:default="Package"
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 +140,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 b1d6599

Please sign in to comment.