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

Third and final step of package repos API - Package Repository API for Helm #4807

Merged
merged 28 commits into from
Jun 2, 2022

Conversation

castelblanque
Copy link
Collaborator

Description of the change

Third and final step on top of the second PR #4796.

This adds the following implementations and tests:

  • GetPackageRepositoryDetail
  • GetPackageRepositorySummaries
  • UpdatePackageRepository
  • DeletePackageRepository

I had to change the original AppRepository CR definition for the field ResyncRequests from type uint to int.

Benefits

Package repository API is available for direct Helm plugin.

Possible drawbacks

I haven't seen any, but there might be misalignments in the AppRepository CRDs data if both the old and this new API are used together over the same CRD. Due to the management of secrets, etc.
However, this scenario could only happen during the transition time and should not happen in normal usage at all.

Applicable issues

Additional information

The reason for changing the data type in the original CRD was due to the k8s machinery DeepCopyJSONValue being unable to handle uint (see here).

Rafa Castelblanque added 26 commits May 13, 2022 16:04
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
…-extra

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
…ations

Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
@@ -26,7 +26,7 @@ type AppRepositorySpec struct {
Type string `json:"type"`
URL string `json:"url"`
Auth AppRepositoryAuth `json:"auth,omitempty"`
ResyncRequests uint `json:"resyncRequests"`
ResyncRequests int `json:"resyncRequests"`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mentioned changed to the type of the existing CRD's ResyncRequests.

log.V(4).Infof("+helm upgrade repo %s customDetails [%v]", repoRef.Identifier, customDetails)
}

helmRepo := &HelmRepository{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using this custom HelmRepository to avoid having 8 parameters in functions signatures :)

@castelblanque castelblanque marked this pull request as ready for review May 31, 2022 17:02
Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

Haven't tested it IRL, but looking forward to it while I'm implementing the corresponding changes in the UI.

Base automatically changed from 4662-addpackagerepoHelm-extra to main June 2, 2022 06:50
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
@netlify
Copy link

netlify bot commented Jun 2, 2022

Deploy Preview for kubeapps-dev canceled.

Name Link
🔨 Latest commit 5bc6901
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/6298708aeea5d50008b051e4

@castelblanque castelblanque merged commit cfd5a21 into main Jun 2, 2022
@castelblanque castelblanque deleted the 4662-helm-repo-operations branch June 2, 2022 08:59
@castelblanque castelblanque restored the 4662-helm-repo-operations branch June 2, 2022 10:53
@castelblanque castelblanque deleted the 4662-helm-repo-operations branch July 7, 2022 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Package Repository API for Helm plugin
3 participants