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

adds example using simple-app and downwardAPI #870

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Conversation

joe-kimmel-vmw
Copy link
Contributor

No description provided.

env:
#@overlay/match by="name"
- name: HELLO_MSG
value: #@ "hello from {} namespace, deployed by kapp-controller v{}, hosted on kubernetes v{}".format(data.values.ns, data.values.kcV, data.values.k8sV)
Copy link
Contributor

Choose a reason for hiding this comment

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

question: I was looking at code/docs of the develop branch to figure out if the downward API's versions are:

  • prefixed with v
  • always formatted as semver
    But I couldn't find the answer, or I have not spend enough time on.

However, deployed by kapp-controller v{}, hosted on kubernetes v{} suggests that the versions won't be v-prefixed. Can you show the complete templated HELLO_MSG?

The reason I am asking is the under development proposal for @ytt:semver. Kapp-controller's downward API is a great use-case to consider, because the consumers of it could potentially benefit from semver operations in their ytt templates.

Copy link
Contributor Author

@joe-kimmel-vmw joe-kimmel-vmw Sep 13, 2022

Choose a reason for hiding this comment

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

that's a good idea - like you said, i put those 'v's in as hints but i should just show the result. :)

fwiw we did just merge a relatively easy-to-read unit test that shows the "v-less" nature of the version string:
https://github.com/vmware-tanzu/carvel-kapp-controller/pull/862/files#diff-67acaba412143ef942322b7b42729c6db75c89a1890b90fe0bc4801be8f71ab4R32

goal of the above little change was in fact to guarantee that consumers of this data as a string should always have a pretty vanilla "major.minor.patch" format without any of the decorative suffixes that creep in. So i think we're aligned in general. --- though looking at the example output, i guess that change was just for the kubernetes version

Copy link
Contributor

Choose a reason for hiding this comment

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

So i think we're aligned in general

yay!

@cppforlife cppforlife merged commit 723ecde into develop Sep 14, 2022
@cppforlife cppforlife deleted the downapiexample2 branch September 14, 2022 17:29
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.

4 participants