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

[Release-1.5] Cherry-picks #836

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.23
id: go

- name: Config credentials
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-coexistence_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: 1.21
go-version: 1.23
id: go

- name: Setup dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli_core_e2e_sample-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.23
id: go

- name: go cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli_core_e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.23
id: go

- name: go cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli_core_unit_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.23
id: go

- name: go cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.23
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 3 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ issues:
- 'declaration of "(err|ctx)" shadows declaration at'
- "unnamedResult: consider giving a name to these results"
- "(Expect directory permissions to be 0750 or less|Expect (WriteFile|file) permissions to be 0600 or less)"
- 'dot-imports: should not use dot imports'
- 'unused-parameter:'

exclude-rules:
- path: _test\.go
Expand Down Expand Up @@ -149,4 +151,4 @@ run:
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.46.0 # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.63.3 # use the fixed version to not introduce new linters unexpectedly
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,33 @@ apt-package-in-docker: ## Build a debian package from within a container already
.PHONY: apt-package
apt-package: apt-package-only apt-package-repo ## Build a debian package to use with APT

.PHONY: rpm-package
rpm-package: ## Build an RPM package
.PHONY: rpm-package-only
rpm-package-only: ## Build an RPM package
@if [ "$$(command -v docker)" == "" ]; then \
echo "Docker required to build rpm package" ;\
exit 1 ;\
fi
docker run --rm -e VERSION=$(BUILD_VERSION) -e RPM_SIGNER=$(RPM_SIGNER) -e RPM_METADATA_BASE_URI=$(RPM_METADATA_BASE_URI) -v $(ROOT_DIR):$(ROOT_DIR) $(RPM_IMAGE) $(ROOT_DIR)/hack/rpm/build_package.sh
docker run --rm -e VERSION=$(BUILD_VERSION) -e RPM_PACKAGE_NAME=$(RPM_PACKAGE_NAME) -e RPM_SIGNER=$(RPM_SIGNER) -v $(ROOT_DIR):$(ROOT_DIR) $(RPM_IMAGE) $(ROOT_DIR)/hack/rpm/build_package.sh

.PHONY: rpm-package-repo
rpm-package-repo: ## Build an RPM package repository
@if [ "$$(command -v docker)" == "" ]; then \
echo "Docker required to build rpm package" ;\
exit 1 ;\
fi
docker run --rm -e VERSION=$(BUILD_VERSION) -e RPM_SIGNER=$(RPM_SIGNER) -e RPM_METADATA_BASE_URI=$(RPM_METADATA_BASE_URI) -v $(ROOT_DIR):$(ROOT_DIR) $(RPM_IMAGE) $(ROOT_DIR)/hack/rpm/build_package_repo.sh

.PHONY: rpm-package-in-docker
rpm-package-in-docker: ## Build an RPM package from within a container already
VERSION=$(BUILD_VERSION) $(ROOT_DIR)/hack/rpm/build_package.sh

.PHONY: rpm-package-repo-in-docker
rpm-package-repo-in-docker: ## Build an RPM package repository from within a container already
VERSION=$(BUILD_VERSION) $(ROOT_DIR)/hack/rpm/build_package_repo.sh

.PHONY: rpm-package
rpm-package: rpm-package-only rpm-package-repo ## Build an RPM package and repository to use with YUM/DNF

.PHONY: choco-package
choco-package: ## Build a Chocolatey package
@if [ "$$(command -v docker)" = "" ]; then \
Expand Down
6 changes: 3 additions & 3 deletions apis/cli/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 22 additions & 16 deletions apis/config/crd/bases/cli.tanzu.vmware.com_cliplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.17.0
name: cliplugins.cli.tanzu.vmware.com
spec:
group: cli.tanzu.vmware.com
Expand All @@ -21,14 +20,19 @@ spec:
description: CLIPlugin denotes a Tanzu cli plugin.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -78,16 +82,18 @@ spec:
description: Description is the plugin's description.
type: string
optional:
description: Optional specifies whether the plugin is mandatory or
optional If optional, the plugin will not get auto-downloaded as
part of `tanzu login` or `tanzu plugin sync` command To view the
list of plugin, user can use `tanzu plugin list` and to download
a specific plugin run, `tanzu plugin install <plugin-name>`
description: |-
Optional specifies whether the plugin is mandatory or optional
If optional, the plugin will not get auto-downloaded as part of
`tanzu login` or `tanzu plugin sync` command
To view the list of plugin, user can use `tanzu plugin list` and
to download a specific plugin run, `tanzu plugin install <plugin-name>`
type: boolean
recommendedVersion:
description: Recommended version that Tanzu CLI should use if available.
The value should be a valid semantic version as defined in https://semver.org/.
E.g., 2.0.1
description: |-
Recommended version that Tanzu CLI should use if available.
The value should be a valid semantic version as defined in
https://semver.org/. E.g., 2.0.1
type: string
target:
description: Target specifies the target of the plugin. Only needed
Expand Down
2 changes: 1 addition & 1 deletion cmd/plugin/builder/command/cli_compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func setGlobals(compileArgs *PluginCompileArgs) {

// Disable function inlining to reduce binary size
disableInlining := "-gcflags=all=-l"
if len(goflags) > 0 {
if goflags != "" {
// Append the user-defined goflags so they can override the default if needed
goflags = fmt.Sprintf("%s %s", disableInlining, goflags)
} else {
Expand Down
Loading
Loading