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 partial support for DownwardsAPI with kctrl package release #1580

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

100mik
Copy link
Contributor

@100mik 100mik commented Jun 18, 2024

What this PR does / why we need it:

This PR allows Packages using DownwardsAPI to obtain kubernetesAPIs or kubernetesVersion by feeding a false value.
However this value cannot be reliably used to introduce images in the template step for the time being. This does not block users who are not conditionally introducing images based on these parameters.
It mocks CoreV1 client calls made by GetServiceAccountToken

Which issue(s) this PR fixes:

Partially fixes #1523

Does this PR introduce a user-facing change?


Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:

We should document that using `kappControllerVersion` with DownwardAPI can lead to failures while releasing packages

@100mik 100mik requested a review from praveenrewar June 18, 2024 20:58
Signed-off-by: Soumik Majumder <soumikm@vmware.com>
var _ discovery.DiscoveryInterface = &MinDiscoveryClient{}

func (*MinDiscoveryClient) ServerVersion() (*version.Info, error) {
return &version.Info{Major: "1", Minor: "30.0-invalid", GitVersion: "1.30.0-invalid"}, nil
Copy link
Member

Choose a reason for hiding this comment

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

Can this cause a problem if the packages are expecting an older version? If the ytt template have a check or if the helm template only include a certain image if the k8s version is 1.28?

Copy link
Member

Choose a reason for hiding this comment

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

It also might be ok if we do not support this use case but it has to be documented somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we will be documenting it, the expectation right now is that folks are not swapping images because of versions, they would generally be passing it along as env values if the image is expected to behave differently.
We will definitely call out the values being used in the docs.

Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

LGTM

@100mik 100mik merged commit 4821a0d into carvel-dev:develop Jul 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cannot use downward API in PackageBuild
2 participants