TempDirForObj creates a new temporary directory in the directory dir
in the format of 'Kind-Namespace-Name-*', and returns the
pathname of the new directory.
TempPathForObj creates a temporary file path in the format of
'<dir>/Kind-Namespace-Name-<random bytes><suffix>'.
If the given dir is empty, os.TempDir is used as a default.