Skip to content

Commit

Permalink
Attempting to fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Neo2308 <[email protected]>
  • Loading branch information
Neo2308 committed Oct 19, 2024
1 parent eb61051 commit 9c91b54
Showing 1 changed file with 36 additions and 37 deletions.
73 changes: 36 additions & 37 deletions hack/generate/samples/ansible/advanced_molecule.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,47 +78,46 @@ func ImplementAdvancedMolecule(sample sample.Sample, image string) {
}

func updateConfig(dir string) {
//TODO: This currently fails, unsure if we still need this, seems the role file already has this
//log.Info("adding customized roles")
// const cmRolesFragment = ` ##
// ## Base operator rules
// ##
// - apiGroups:
// - ""
// resources:
// - configmaps
// - namespaces
// verbs:
// - create
// - delete
// - get
// - list
// - patch
// - update
// - watch
// - apiGroups:
// - apps
// resources:
// - configmaps
// verbs:
// - create
// - delete
// - get
// - list
// - patch
// - update
// - watch
//#+kubebuilder:scaffold:rules`
//err := kbutil.ReplaceInFile(
// filepath.Join(dir, "config", "rbac", "role.yaml"),
// "#+kubebuilder:scaffold:rules",
// cmRolesFragment)
//pkg.CheckError("adding customized roles", err)
log.Info("adding customized roles")
const cmRolesFragment = ` ##
## Base operator rules
##
- apiGroups:
- ""
resources:
- configmaps
- namespaces
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- configmaps
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
# +kubebuilder:scaffold:rules`
err := kbutil.ReplaceInFile(
filepath.Join(dir, "config", "rbac", "role.yaml"),
"# +kubebuilder:scaffold:rules",
cmRolesFragment)
pkg.CheckError("adding customized roles", err)

log.Info("adding manager arg")
const ansibleVaultArg = `
- --ansible-args='--vault-password-file /opt/ansible/pwd.yml'`
err := kbutil.InsertCode(
err = kbutil.InsertCode(
filepath.Join(dir, "config", "manager", "manager.yaml"),
"- --leader-election-id=advanced-molecule-operator",
ansibleVaultArg)
Expand Down

0 comments on commit 9c91b54

Please sign in to comment.