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

Remove Function CRD from porchconfig and Repo #119

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

efiacor
Copy link
Collaborator

@efiacor efiacor commented Oct 4, 2024

Function CRD is removed as it is unused.
Clean up RepoSpec function references.
Test clean up.

Further removal of the porch api Function attrs to follow.
#465

@@ -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"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a backward incompatible change? What happens in cases when a repository is pushed in with a RepositoryContent: Package ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I can revert. Or is there a cleaner alternative?
What is the k8s procedure for deprecation of an api attribute?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't the "Content" field just be ignored?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the OpenAPI spec in the CRD, it will be just ignored. Would be good to check manually at least.

Copy link
Collaborator

@kispaljr kispaljr Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested a potential change below that keeps the Content field the following way:

  • if it is not specified explicitly its value is considered to be "Package", as before
  • if it is specified with any value other than "Package", the creation of the Repository object will be rejected with a human readable error message stating that the field is deprecated.

Please note that make generate must be run after this change, since it also effects the CRD yamls.

Please note that I haven't tested the change below, I typed it directly into the GH comment box, so it most probably has typos.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@JamesMcDermott
Copy link
Contributor

/approve

@nagygergo
Copy link
Contributor

@nagygergo nagygergo mentioned this pull request Oct 10, 2024
@efiacor
Copy link
Collaborator Author

efiacor commented Oct 11, 2024

I think you missed https://github.com/nephio-project/porch/blob/main/api/porch/v1alpha1/types.go#L573

This is more part 1 of 2. Initial removal is from the porchconfig and Function Repo concept.
The Function CR in the api will require a little more care as I think it has some dependencies deeper in the code.

@nagygergo
Copy link
Contributor

Oh, ok.

/approve

Copy link
Contributor

nephio-prow bot commented Oct 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: efiacor, JamesMcDermott, nagygergo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@radoslawc
Copy link
Collaborator

/lgtm

@liamfallon
Copy link
Member

/test presubmit-nephio-go-test

2 similar comments
@liamfallon
Copy link
Member

/test presubmit-nephio-go-test

@liamfallon
Copy link
Member

/test presubmit-nephio-go-test

@liamfallon
Copy link
Member

test presubmit-nephio-go-test

@@ -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"`
Copy link
Collaborator

@kispaljr kispaljr Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested a potential change below that keeps the Content field the following way:

  • if it is not specified explicitly its value is considered to be "Package", as before
  • if it is specified with any value other than "Package", the creation of the Repository object will be rejected with a human readable error message stating that the field is deprecated.

Please note that make generate must be run after this change, since it also effects the CRD yamls.

Please note that I haven't tested the change below, I typed it directly into the GH comment box, so it most probably has typos.

@nephio-prow nephio-prow bot removed the lgtm label Nov 5, 2024
@kispaljr
Copy link
Collaborator

kispaljr commented Nov 5, 2024

/lgtm

@nephio-prow nephio-prow bot added the lgtm label Nov 5, 2024
@nephio-prow nephio-prow bot merged commit b1d6599 into nephio-project:main Nov 5, 2024
5 checks passed
@efiacor efiacor deleted the remove_function branch November 5, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants