Skip to content

Instantly share code, notes, and snippets.

View lyarwood's full-sized avatar
🧑‍🌾

Lee Yarwood lyarwood

🧑‍🌾
View GitHub Profile
diff --git a/pkg/instancetype/instancetype.go b/pkg/instancetype/instancetype.go
index 641567acf..539c6bd3a 100644
--- a/pkg/instancetype/instancetype.go
+++ b/pkg/instancetype/instancetype.go
@@ -59,8 +59,31 @@ func GetRevisionName(vmName, resourceName string, resourceUID types.UID, resourc
return fmt.Sprintf("%s-%s-%s-%d", vmName, resourceName, resourceUID, resourceGeneration)
}
+// addTypeInformationToObject adds TypeMeta information to a runtime.Object based upon the loaded scheme.Scheme
+// inspired by: https://github.com/kubernetes/cli-runtime/blob/v0.19.2/pkg/printers/typesetter.go#L41
diff --git a/pkg/instancetype/instancetype.go b/pkg/instancetype/instancetype.go
index 641567acf..47e23a721 100644
--- a/pkg/instancetype/instancetype.go
+++ b/pkg/instancetype/instancetype.go
@@ -59,8 +59,31 @@ func GetRevisionName(vmName, resourceName string, resourceUID types.UID, resourc
return fmt.Sprintf("%s-%s-%s-%d", vmName, resourceName, resourceUID, resourceGeneration)
}
+// addTypeInformationToObject adds TypeMeta information to a runtime.Object based upon the loaded scheme.Scheme
+// inspired by: https://github.com/kubernetes/cli-runtime/blob/v0.19.2/pkg/printers/typesetter.go#L41
@lyarwood
lyarwood / patch.diff
Created July 7, 2022 14:35
Suggested changes to operator_test.go
# git diff HEAD~1
diff --git a/tests/operator_test.go b/tests/operator_test.go
index 8b4ded6af..c6eca91d9 100644
--- a/tests/operator_test.go
+++ b/tests/operator_test.go
@@ -1515,17 +1515,22 @@ spec:
By("Sanity Checking Deployments infrastructure is deleted")
sanityCheckDeploymentsDeleted()
- if updateOperator {
@lyarwood
lyarwood / unit.sh
Created January 17, 2022 12:06
bash functions to run recently changed unit and functional tests in openstack/nova
function _unit_staged(){
touched_tests=$(git diff --cached --name-only | grep tests\/unit)
tests=""
for test in $touched_tests; do t=$(echo $test | sed 's/\//\./g' | sed 's/\.py//g'); tests+=" ${t}"; done
tox -e py27 $tests
}
function _unit_last(){
touched_tests=$(git diff-tree --no-commit-id --name-only -r HEAD | grep tests\/unit)
tests=""

Keybase proof

I hereby claim:

  • I am lyarwood on github.
  • I am lyarwood (https://keybase.io/lyarwood) on keybase.
  • I have a public key whose fingerprint is A5D1 9385 88CB 7E5F BE64 6618 BCA6 6E33 F672 2D76

To claim this, I am signing this object:

@lyarwood
lyarwood / f21-upgrade.sh
Created January 15, 2015 15:19
Fedora 20 to 21 droplet upgrade commands
# dnf method of upgrading based on http://git.io/eWpjYw
dnf update -y
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-$(uname -i)
dnf update yum -y
dnf clean all
dnf --releasever=21 distro-sync
dnf remove firewalld-config-standard -y
dnf install system-release-server -y