Skip to content

Commit

Permalink
Add a version to kubectl vendored in Zarf (#1620)
Browse files Browse the repository at this point in the history
## Description

This adds a version to `zarf tools kubectl version` to prevent errors.
Currently this is a 0.0.0 version with the zarf version postpended -
this could be changed later, though the kubectl version in go.mod may be
difficult to keep in sync and it should be clear that this is kubectl
built into zarf, not normal kubectl.


![image](https://user-images.githubusercontent.com/3977569/232912615-7c0f2137-a309-4a73-b520-ccaf23252fa1.png)

## Related Issue

Fixes #1614 

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
  • Loading branch information
Racer159 committed Apr 19, 2023
1 parent d5624a6 commit 9ef3529
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ else
endif

CLI_VERSION := $(if $(shell git describe --tags),$(shell git describe --tags),"UnknownVersion")
BUILD_ARGS := -s -w -X 'github.com/defenseunicorns/zarf/src/config.CLIVersion=$(CLI_VERSION)'
GIT_SHA := $(if $(shell git rev-parse HEAD),$(shell git rev-parse HEAD),"")
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
BUILD_ARGS := -s -w -X 'github.com/defenseunicorns/zarf/src/config.CLIVersion=$(CLI_VERSION)' -X 'k8s.io/component-base/version.gitVersion=v0.0.0+zarf$(CLI_VERSION)' -X 'k8s.io/component-base/version.gitCommit=$(GIT_SHA)' -X 'k8s.io/component-base/version.buildDate=$(BUILD_DATE)'
.DEFAULT_GOAL := help

.PHONY: help
Expand Down

0 comments on commit 9ef3529

Please sign in to comment.