Skip to content

Conversation

justinsb
Copy link
Member

Normally they are the same, but for CI builds they are different,
and kopsbase.Version is the consistent one to use for CI builds.

@k8s-ci-robot k8s-ci-robot requested a review from hakman October 11, 2025 12:26
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 11, 2025
@k8s-ci-robot k8s-ci-robot added area/api size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 11, 2025
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 11, 2025
@justinsb
Copy link
Member Author

/wip

I'm not 100% sure this is right (though I think it is), and it is currently failing tests

@k8s-ci-robot k8s-ci-robot added area/addons size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 12, 2025
@justinsb
Copy link
Member Author

The + also causes problems in our label values - they have strict rules also!

@justinsb
Copy link
Member Author

Looks like etcd is failing to start, but only in some tests... not sure I understand what's going on so let's see if it is consisten

/retest

@justinsb justinsb force-pushed the one_version branch 2 times, most recently from 3c84277 to 23bf6ae Compare October 12, 2025 20:49
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 12, 2025
@justinsb justinsb force-pushed the one_version branch 4 times, most recently from 7b76d82 to a7429c6 Compare October 12, 2025 21:45
@justinsb justinsb force-pushed the one_version branch 2 times, most recently from 3a1e73b to d99f13d Compare October 12, 2025 23:24
@justinsb
Copy link
Member Author

/retest

A bunch of pod pending timeouts, and looks like KUBE_BUILD_CONTAINER_NAME_BASE is hitting a bunch of kube projects

@hakman
Copy link
Member

hakman commented Oct 13, 2025

/test all

@justinsb
Copy link
Member Author

Shall we discuss tomorrow in office hours? It was a little tricky to get all the pieces lined up, but I think it's right :-)

@hakman
Copy link
Member

hakman commented Oct 16, 2025

Shall we discuss tomorrow in office hours? It was a little tricky to get all the pieces lined up, but I think it's right :-)

Sure, sounds good. Cya tomorrow!

@justinsb
Copy link
Member Author

So #17636 is now passing, so I think this has the positive signal we were waiting for.

We also need to do a few more things to get CI builds to pass (e.g. configure the version into container builds), but #17636 includes those fixes.

@hakman hakman requested review from ameukam and rifelpet and removed request for johngmyers October 19, 2025 10:18
func ImageTag() string {
tag := Version
// We replace + with - so that we can use the tag in docker image tags
return strings.ReplaceAll(tag, "+", "-")
Copy link
Member

Choose a reason for hiding this comment

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

Do we want + replaced by - or by _ as in the comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

So along the way I think I changed my mind a few times, I can't remember if it was because I actually found somewhere where - was valid and _ was not, but in any case I was not consistent.

I have now fixed this to be - consistently, including in the comments (thanks!). We could try _ if we think that is clearer ... I think in practice it only affects CI builds so it should be easy to switch.

Copy link
Member

Choose a reason for hiding this comment

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

I'm good with this, thanks! 👍

dest["KopsFeatureEnabled"] = tf.kopsFeatureEnabled
dest["KopsVersion"] = func() string { return kopsroot.KOPS_RELEASE_VERSION }
dest["KopsVersion"] = func() string { return kopsroot.Version }
dest["ImageTag"] = func() string { return kopsroot.ImageTag() }
Copy link
Member

@hakman hakman Oct 19, 2025

Choose a reason for hiding this comment

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

nit: ImageTag may be too generic. Maybe KopsVersionImageTag would be more explicit, same as KopsVersionForLabel.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call - done!

dest["KopsVersionForLabel"] = func() string {
// Labels follow strict rules: a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character
// By convention we use a v prefix here
return "v" + strings.ReplaceAll(kopsroot.Version, "+", "-")
Copy link
Member

Choose a reason for hiding this comment

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

nit: Same as above, do we want + replaced by - or by _?

Copy link
Member Author

Choose a reason for hiding this comment

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

We want consistency, I think. I went with - but happy to try _ if you think it's better.

@hakman
Copy link
Member

hakman commented Oct 19, 2025

This is a significant improvement to versioning and I like the direction. Feel free to /approve and merge if the comments are not relevant.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 19, 2025
justinsb and others added 2 commits October 20, 2025 01:57
Normally they are the same, but for CI builds they are different,
and kopsbase.Version is the consistent one to use for CI builds.

We also need to be careful not to conflate the version with
the docker image tag; image tags cannot contain '+' characters,
but our CI versions do.  We replace '+' with '_' for image tags.

Co-authored-by: Ciprian Hacman <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 20, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 20, 2025
@k8s-ci-robot k8s-ci-robot merged commit 2c07ce6 into kubernetes:master Oct 20, 2025
27 of 28 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.35 milestone Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/addons area/api cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants