Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issues with the given samples #3415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shabirmean
Copy link

  • Running go mod init without. a module name throws an error
  • The kubeObject.IsGVK function has three arguments group, version, kind string

- Running `go mod init` without. a module name throws an error
- The `kubeObject.IsGVK` function has three arguments `group, version, kind string`
@yuwenma
Copy link
Contributor

yuwenma commented Jul 25, 2022

Thank you @Shabirmean, one minor comment.

@Shabirmean
Copy link
Author

Thank you @Shabirmean, one minor comment.

Thank you for the quick review @yuwenma. Sorry, but I am not seeing any comments. Did you want me to look into something?

@@ -32,7 +32,7 @@ kpt pkg get https://github.com/GoogleContainerTools/kpt-functions-sdk.git/go/get
cd ${FUNCTION_NAME}

# Initialize the Go module
go mod init
go mod init kpt-fn/set-annotation
Copy link
Contributor

@yuwenma yuwenma Jul 25, 2022

Choose a reason for hiding this comment

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

May the "without. a module name throws an error" caused by missing ln 32?

Since we need to run go mod tidy, it's better to cd into the ${FUNCTION_NAME}. Otherwise we need to add ln 32 after go mod init ${FUNCTION_NAME}.

Copy link
Author

Choose a reason for hiding this comment

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

I've tried both ways:

  • First cd ${FUNCTION_NAME} and then do go mod init
  • First go mod init

In both cases I get the error

go: cannot determine module path for source directory /tmp/kpt/set-annotation (outside GOPATH, module path must be specified)

Example usage:
	'go mod init example.com/m' to initialize a v0 or v1 module
	'go mod init example.com/m/v2' to initialize a v2 module

Run 'go help mod init' for more information.

Sorry, I am quite new to Go and not completely sure if I am missing some specific setup in my environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants