Wednesday, April 13, 2022

Jolokia + Hawtio to monitor JVM

https://github.com/hawtio/hawtio 

Git squash/rebase

You may got code conflict when a PR created, In the case you can rebase the branch:

git checkout feature/RealSense

Delete local master in case it is messed up:

git branch -D master

git checkout master

 git pull

 Check in feature branch

git checkout feature/RealSense

git push

Rebase local master 

git rebase master

To abort rebase 

git rebase --abort

Squash the multiple commits (55 limit, if you have more than 55, you can split them) into 1 commit in branch feature/RealSense

git rebase -i HEAD~2

During above process, if you choose to git rebase --skip, you will find differences between your branch and the consolidation branch.


Create a new branch feature/RealSense-squash from current branch  feature/RealSense, run below command, there should not be any difference:

git diff feature/RealSense..eature/RealSense-squash

Once you confirm no difference, you can push to remote organ:

git push --force

Rebase local master then push to origin with force 

git rebase master

git rebase --continue

git push --force

The code conflicts should be cleaned up now. 

kubectl notes

 

Set default namespace

 kubectl config set-context $(kubectl config current-context) --namespace=kube-system

Tuesday, April 5, 2022

Terraform: An argument or block definition is required here.

 

spec {
template {
spec {
hostAliases [
{
ip = "10.170.0.12"
hostnames = ["db2.dev.valuex.com","foo.dev.valuex.com"]
}
]
}
}
}


Error message:


│ On ../modules/mongo/cluster/main.tf line 171: An argument or block definition is required here. To set an argument, use the equals sign "=" to introduce

│ the argument value.


Correction:



spec {
template {
spec {
hostAliases = [
{
ip = "10.170.0.12"
hostnames = ["db2.dev.valuex.com","foo.dev.valuex.com"]
}
]
}
}
}