forked from vmware-tanzu/tanzu-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e test changes for cliplugins crd package
Adds an e2e test that performs plugin sync using crd package built from the package/cliplugin.cli.tanzu.vmware.com directory. The specific test requires an envvar CRD_PACKAGE_IMAGE to be set and pointing to a registry location that the test has push permissions on. Also adds build-crd-package.sh that will conditionally build and publish the CRD package if CRD_PACKAGE_IMAGE is set. Signed-off-by: Vui Lam <[email protected]>
- Loading branch information
Showing
11 changed files
with
3,024 additions
and
12 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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 VMware, Inc. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -e | ||
set -x | ||
|
||
if [ -z "$CRD_PACKAGE_IMAGE" ]; then | ||
echo "skip building of CRD package because CRD_PACKAGE_IMAGE is not set" | ||
exit 0 | ||
fi | ||
|
||
BASE_DIR=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd) | ||
PACKAGE_DIR=${BASE_DIR}/../../package/cliplugin.cli.tanzu.vmware.com | ||
BINDIR=${BASE_DIR}/../tools/bin | ||
|
||
KCTRL=${KCTRL:-$BINDIR/kctrl} | ||
YQ=${YQ:-$BINDIR/yq} | ||
|
||
pushd ${PACKAGE_DIR} | ||
|
||
$YQ e -i ".spec.template.spec.export[0].imgpkgBundle.image=\"${CRD_PACKAGE_IMAGE}\"" ./package-build.yml | ||
|
||
PATH=${BINDIR}:$PATH ${KCTRL} package release --yes | ||
|
||
popd | ||
|
File renamed without changes.
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
File renamed without changes.
2,676 changes: 2,676 additions & 0 deletions
2,676
package/cliplugin.cli.tanzu.vmware.com/test/kapp-controller.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
174 changes: 174 additions & 0 deletions
174
package/cliplugin.cli.tanzu.vmware.com/test/package-pi.yaml
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,174 @@ | ||
apiVersion: packaging.carvel.dev/v1alpha1 | ||
kind: PackageInstall | ||
metadata: | ||
annotations: | ||
kctrl.carvel.dev/local-fetch-0: . | ||
creationTimestamp: null | ||
name: cliplugin | ||
spec: | ||
packageRef: | ||
refName: cliplugin.cli.tanzu.vmware.com | ||
versionSelection: | ||
# XXX sufficient for now to pick up any version of package deployed during test | ||
constraints: "<1.0.0" | ||
serviceAccountName: tanzu-cliplugins-package-sa | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: tanzu-cliplugins-package-sa | ||
namespace: default | ||
annotations: | ||
kapp.k14s.io/change-group: "cliplugins-packageinstall/serviceaccount-0" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: tanzu-cliplugins-package-cluster-role | ||
annotations: | ||
kapp.k14s.io/change-group: "cliplugins-packageinstall/serviceaccount-0" | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- secrets | ||
- serviceaccounts | ||
- services | ||
- namespaces | ||
verbs: | ||
- create | ||
- update | ||
- get | ||
- list | ||
- delete | ||
- watch | ||
- patch | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- create | ||
- update | ||
- get | ||
- list | ||
- delete | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- create | ||
- update | ||
- get | ||
- list | ||
- delete | ||
- watch | ||
- apiGroups: | ||
- rbac.authorization.k8s.io | ||
resources: | ||
- clusterroles | ||
- clusterrolebindings | ||
verbs: | ||
- create | ||
- update | ||
- get | ||
- list | ||
- delete | ||
- apiGroups: | ||
- cli.tanzu.vmware.com | ||
resources: | ||
- cliplugins | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- delete | ||
- apiGroups: | ||
- cli.tanzu.vmware.com | ||
resources: | ||
- cliplugins/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- cli.tanzu.vmware.com | ||
resources: | ||
- cliplugins/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- data.packaging.carvel.dev | ||
resources: | ||
- packages | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- data.packaging.carvel.dev | ||
resources: | ||
- packages/status | ||
verbs: | ||
- get | ||
- list | ||
- apiGroups: | ||
- packaging.carvel.dev | ||
resources: | ||
- packageinstalls | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- patch | ||
- apiGroups: | ||
- packaging.carvel.dev | ||
resources: | ||
- packageinstalls/status | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "admissionregistration.k8s.io" | ||
resources: | ||
- mutatingwebhookconfigurations | ||
- validatingwebhookconfigurations | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- delete | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: tanzu-cliplugins-package-cluster-rolebinding | ||
annotations: | ||
kapp.k14s.io/change-group: "cliplugins-packageinstall/serviceaccount" | ||
kapp.k14s.io/change-rule.0: "upsert after upserting cliplugins-packageinstall/serviceaccount-0" | ||
kapp.k14s.io/change-rule.1: "delete before deleting cliplugins-packageinstall/serviceaccount-0" | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: tanzu-cliplugins-package-cluster-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: tanzu-cliplugins-package-sa | ||
namespace: default |
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
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
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
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
Oops, something went wrong.