-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move Inventory object to pkg/apis/actuation
- Replace custom TypeMeta & ObjectMeta with standard metav1 structs to allow Inventory to satisfy the metav1.Object, runtime.Object, and client.Object interfaces. This should make the Inventory API easier to use and easily convertable to an Unstructured object. BREAKING CHANGE: Move inventory.Inventory to actuation.Inventory (under pkg/apis/)
- Loading branch information
Showing
12 changed files
with
357 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Copyright YEAR The Kubernetes Authors. | ||
// SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,13 @@ install-addlicense: | |
install-lint: | ||
(which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/[email protected]) | ||
|
||
generate: install-stringer | ||
install-deepcopy-gen: | ||
(which $(GOPATH)/bin/deepcopy-gen || go install k8s.io/code-generator/cmd/[email protected]) | ||
|
||
generate-deepcopy: install-deepcopy-gen | ||
hack/run-in-gopath.sh deepcopy-gen --input-dirs ./pkg/apis/... -O zz_generated.deepcopy --go-header-file ./LICENSE_TEMPLATE_GO | ||
|
||
generate: install-stringer generate-deepcopy | ||
go generate ./... | ||
|
||
license: install-addlicense | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2021 The Kubernetes Authors. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -o errexit -o nounset -o pipefail -o posix | ||
|
||
PKG_PATH="sigs.k8s.io/cli-utils" | ||
|
||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" | ||
|
||
# Make a new temporary GOPATH directory | ||
export GOPATH=$(mktemp -d -t cli-utils-gopath.XXXXXXXXXX) | ||
# Clean up on exit (modcache has read-only files, so clean that first) | ||
trap "go clean -modcache && rm '${GOPATH}/src/${PKG_PATH}' && rm -rf '${GOPATH}'" EXIT | ||
|
||
# Make sure we can read, write, and delete | ||
chmod a+rw "${GOPATH}" | ||
|
||
# Use a temporary cache | ||
export GOCACHE="${GOPATH}/cache" | ||
|
||
# Create a symlink for the local repo in the GOPATH | ||
mkdir -p "${GOPATH}/src/${PKG_PATH}" | ||
rm -r "${GOPATH}/src/${PKG_PATH}" | ||
ln -s "${REPO_ROOT}" "${GOPATH}/src/${PKG_PATH}" | ||
|
||
# Make sure our own Go binaries are in PATH. | ||
export PATH="${GOPATH}/bin:${PATH}" | ||
|
||
# Set GOROOT so binaries that parse code can work properly. | ||
export GOROOT=$(go env GOROOT) | ||
|
||
# Unset GOBIN in case it already exists in the current session. | ||
unset GOBIN | ||
|
||
# enter the GOPATH before executing the command | ||
cd "${GOPATH}/src/${PKG_PATH}" | ||
|
||
# Run the user-provided command. | ||
"${@}" | ||
|
||
# exit the GOPATH before deleting it | ||
cd "${REPO_ROOT}" |
2 changes: 1 addition & 1 deletion
2
pkg/inventory/actuationstatus_string.go → pkg/apis/actuation/actuationstatus_string.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
pkg/inventory/actuationstrategy_string.go → ...pis/actuation/actuationstrategy_string.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright 2021 The Kubernetes Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Package actuation contains API Schema definitions for the | ||
// cli-utils.kubernetes.io API group. | ||
// +k8s:deepcopy-gen=package | ||
// +groupName=cli-utils.kubernetes.io | ||
package actuation // import "sigs.k8s.io/cli-utils/pkg/apis/actuation" |
2 changes: 1 addition & 1 deletion
2
pkg/inventory/reconcilestatus_string.go → pkg/apis/actuation/reconcilestatus_string.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.