Skip to content

Conversation

laxmikantbpandhare
Copy link
Member

modified the doc file and removed file after generation

@laxmikantbpandhare
Copy link
Member Author

I tried to remove the .placeholder from the code but /src/main/java is not creating directory. Instead, it is created java as a file. This is how our scaffolding works. For now, I added it in init command and removed when we are running create api command.

Screen Shot 2021-10-26 at 9 45 11 PM

Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the plugin to create a directory instead.

@jmrodri
Copy link
Member

jmrodri commented Oct 29, 2021

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 29, 2021
@jmrodri
Copy link
Member

jmrodri commented Oct 29, 2021

@laxmikantbpandhare Because the scaffolder is using the TemplateMixin to create the placeholder file, it only knows how to create a directory if there is a file. So we'll have to change the scaffolder to create the directory instead.

So I would do the following:

I think that's the gist of what needs to be done. Might need to update another test somewhere to verify that the directory does get scaffolded.

@laxmikantbpandhare
Copy link
Member Author

laxmikantbpandhare commented Oct 29, 2021

@laxmikantbpandhare Because the scaffolder is using the TemplateMixin to create the placeholder file, it only knows how to create a directory if there is a file. So we'll have to change the scaffolder to create the directory instead.

So I would do the following:

I think that's the gist of what needs to be done. Might need to update another test somewhere to verify that the directory does get scaffolded.

@jmrodri - thank you for your help. For test cases, I might need to add below line of code in test file as it is.

	path := filepath.Join("src", "main", "java")

	if err := os.MkdirAll(path, 0755); err != nil {
		return err
	}

Shall I proceed with it.

@laxmikantbpandhare laxmikantbpandhare removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 29, 2021
Copy link
Member

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 1, 2021
@jmrodri jmrodri merged commit d7db00c into operator-framework:main Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove .placeholder file generated after operator-sdk init command

2 participants