)]}'
{"cmd/secret/get/errors.go":[{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":23,"context_line":"}"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"func (e ErrNoClusterName) Error() string {"},{"line_number":26,"context_line":"\treturn fmt.Sprintf(\"Cluster name must be provided\")"},{"line_number":27,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_e9d45022","line":26,"updated":"2020-07-15 02:53:01.000000000","message":"Why fmt.Sprintf() was used? String is not modified by any value.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":23,"context_line":"}"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"func (e ErrNoClusterName) Error() string {"},{"line_number":26,"context_line":"\treturn fmt.Sprintf(\"Cluster name must be provided\")"},{"line_number":27,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_4fd1d8cb","line":26,"in_reply_to":"bf51134e_e9d45022","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"}],"cmd/secret/get/get_cluster_kubeconfig.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"b6e897f78376a6c12aa9137ee045ea4c8f3e81d2","unresolved":false,"context_lines":[{"line_number":58,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":59,"context_line":"\t\t\t\treturn err"},{"line_number":60,"context_line":"\t\t\t}"},{"line_number":61,"context_line":"\t\t\tfmt.Fprintln(cmd.OutOrStdout(), kubeConfig)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"\t\t\treturn nil"},{"line_number":64,"context_line":"\t\t},"}],"source_content_type":"text/x-go","patch_set":9,"id":"bf51134e_dee1ee00","line":61,"range":{"start_line":61,"start_character":0,"end_line":61,"end_character":46},"updated":"2020-06-16 17:34:05.000000000","message":"this function returns can return error, if writer fails write operation, we should check it:\n_, err :\u003d fmt.Fprintln(cmd.OutOrStdout(), kubeConfig)\nreturn err","commit_id":"4aef77123ca3a0b7e4ba001c222e3360c9a72764"}],"cmd/secret/get/get_kubeconfig.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":49,"context_line":"\t\tExample: usageExample,"},{"line_number":50,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":51,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":52,"context_line":"\t\t\t\treturn fmt.Errorf(\"cluster name must be provided\")"},{"line_number":53,"context_line":"\t\t\t}"},{"line_number":54,"context_line":"\t\t\to.Name \u003d args[0]"},{"line_number":55,"context_line":"\t\t\tkubeClient, err :\u003d factory(s)"}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_4f01d869","line":52,"range":{"start_line":52,"start_character":11,"end_line":52,"end_character":54},"updated":"2020-06-29 20:26:53.000000000","message":"this should go to errors.go file","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":47,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":48,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"},{"line_number":49,"context_line":"\t\tExample: usageExample,"},{"line_number":50,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":51,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":52,"context_line":"\t\t\t\treturn fmt.Errorf(\"cluster name must be provided\")"},{"line_number":53,"context_line":"\t\t\t}"},{"line_number":54,"context_line":"\t\t\to.Name \u003d args[0]"},{"line_number":55,"context_line":"\t\t\tkubeClient, err :\u003d factory(s)"},{"line_number":56,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":57,"context_line":"\t\t\t\treturn err"},{"line_number":58,"context_line":"\t\t\t}"},{"line_number":59,"context_line":"\t\t\to.Client \u003d kubeClient"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"\t\t\terr \u003d s.Config.EnsureComplete()"},{"line_number":62,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":63,"context_line":"\t\t\t\treturn err"},{"line_number":64,"context_line":"\t\t\t}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"\t\t\tentryPoint, err :\u003d s.Config.CurrentContextEntryPoint(phase)"},{"line_number":67,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":68,"context_line":"\t\t\t\treturn err"},{"line_number":69,"context_line":"\t\t\t}"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"\t\t\tdocBundle, err :\u003d document.NewBundleByPath(entryPoint)"},{"line_number":72,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":73,"context_line":"\t\t\t\treturn err"},{"line_number":74,"context_line":"\t\t\t}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"\t\t\tdoc, err :\u003d docBundle.GetByNameAndKind(o.Name, \"Cluster\")"},{"line_number":77,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":78,"context_line":"\t\t\t\treturn err"},{"line_number":79,"context_line":"\t\t\t}"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"\t\t\to.Namespace \u003d doc.GetNamespace()"},{"line_number":82,"context_line":"\t\t\tif o.Namespace \u003d\u003d \"\" {"},{"line_number":83,"context_line":"\t\t\t\to.Namespace \u003d \"default\""},{"line_number":84,"context_line":"\t\t\t}"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"\t\t\tkubeConfig, err :\u003d o.Get()"},{"line_number":87,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":88,"context_line":"\t\t\t\treturn err"},{"line_number":89,"context_line":"\t\t\t}"},{"line_number":90,"context_line":"\t\t\t_, err \u003d fmt.Fprintln(cmd.OutOrStdout(), kubeConfig)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"\t\t\treturn err"},{"line_number":93,"context_line":"\t\t},"},{"line_number":94,"context_line":"\t}"},{"line_number":95,"context_line":"\tflags :\u003d cmd.Flags()"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"\tflags.StringVar("}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_0f0b608d","line":94,"range":{"start_line":50,"start_character":0,"end_line":94,"end_character":2},"updated":"2020-06-29 20:26:53.000000000","message":"I think this should be separate funciton in pkg module, like with other commands.","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"de7d0df8f0231c670f36c08d91e4d1f46ab69604","unresolved":false,"context_lines":[{"line_number":62,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":63,"context_line":"\t\t\t\treturn err"},{"line_number":64,"context_line":"\t\t\t}"},{"line_number":65,"context_line":"\t\t\t_, err \u003d fmt.Fprintln(cmd.OutOrStdout(), kubeConfig)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"\t\t\treturn err"},{"line_number":68,"context_line":"\t\t},"}],"source_content_type":"text/x-go","patch_set":24,"id":"bf51134e_0f162756","line":65,"range":{"start_line":65,"start_character":25,"end_line":65,"end_character":43},"updated":"2020-07-09 18:19:08.000000000","message":"due to logging output, this can lead to potential problems. Like kubeconfig mixing together with logs, and if automation tool such as jenkins is used together with this, it would not be able to parse the results. So I suggest that we use for example additional flag like \u0027-o\u0027 to specify file to write it, or if user wants he can specify \u0027-o -\u0027 as stdout.","commit_id":"8a5f05d733bf94873c99122603c878ca5c35aebe"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"430202d59e6617f27f3035b290296301ede80e7a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":63,"context_line":"\t\t\t\treturn err"},{"line_number":64,"context_line":"\t\t\t}"},{"line_number":65,"context_line":"\t\t\t_, err \u003d fmt.Fprintln(cmd.OutOrStdout(), kubeConfig)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"\t\t\treturn err"},{"line_number":68,"context_line":"\t\t},"}],"source_content_type":"text/x-go","patch_set":24,"id":"bf51134e_64af057d","line":65,"range":{"start_line":65,"start_character":25,"end_line":65,"end_character":43},"in_reply_to":"bf51134e_0f162756","updated":"2020-07-09 20:17:40.000000000","message":"sorry about the \u0027-o -\u0027 , i meant -o stdout, or similar solution.","commit_id":"8a5f05d733bf94873c99122603c878ca5c35aebe"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"9aac4e69316b5589d23348df6e05c86ab74cd9fc","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"// NewGetKubeconfigFromSecretCommand creates a new command for getting kubeconfig from secret"},{"line_number":41,"context_line":"func NewGetKubeconfigFromSecretCommand(s *environment.AirshipCTLSettings, factory client.Factory) *cobra.Command {"},{"line_number":42,"context_line":"\tvar phase, output string"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"\topts :\u003d \u0026secret.KubecfgOpts{}"},{"line_number":45,"context_line":"\tcmd :\u003d \u0026cobra.Command{"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_88a95525","line":42,"range":{"start_line":42,"start_character":1,"end_line":42,"end_character":25},"updated":"2020-07-14 17:20:00.000000000","message":"it would be better if it was separate struct, since it can grow substantially.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"// NewGetKubeconfigFromSecretCommand creates a new command for getting kubeconfig from secret"},{"line_number":41,"context_line":"func NewGetKubeconfigFromSecretCommand(s *environment.AirshipCTLSettings, factory client.Factory) *cobra.Command {"},{"line_number":42,"context_line":"\tvar phase, output string"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"\topts :\u003d \u0026secret.KubecfgOpts{}"},{"line_number":45,"context_line":"\tcmd :\u003d \u0026cobra.Command{"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_eac25a33","line":42,"range":{"start_line":42,"start_character":1,"end_line":42,"end_character":25},"in_reply_to":"bf51134e_88a95525","updated":"2020-07-20 16:29:49.000000000","message":"Could you, please, provide more details about growth for this part? In a new PS I declared only one var here and it\u0027s enough for the purpose of the function.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"9aac4e69316b5589d23348df6e05c86ab74cd9fc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":49,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"},{"line_number":50,"context_line":"\t\tExample: usageExample,"},{"line_number":51,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":52,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":53,"context_line":"\t\t\t\treturn ErrNoClusterName{}"},{"line_number":54,"context_line":"\t\t\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_88579526","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":53},"updated":"2020-07-14 17:20:00.000000000","message":"you have a lot of logic in this function. can we put in separate function, and point to it here instead. This will enable better readability and maybe enhance testing.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":48,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":49,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"},{"line_number":50,"context_line":"\t\tExample: usageExample,"},{"line_number":51,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":52,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":53,"context_line":"\t\t\t\treturn ErrNoClusterName{}"},{"line_number":54,"context_line":"\t\t\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_89ddd4de","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":53},"in_reply_to":"bf51134e_88579526","updated":"2020-07-15 02:53:01.000000000","message":"Agree with Kostyantyn, this function should be separate.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":49,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"},{"line_number":50,"context_line":"\t\tExample: usageExample,"},{"line_number":51,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":52,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":53,"context_line":"\t\t\t\treturn ErrNoClusterName{}"},{"line_number":54,"context_line":"\t\t\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_6a964a40","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":53},"in_reply_to":"bf51134e_88579526","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":49,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"},{"line_number":50,"context_line":"\t\tExample: usageExample,"},{"line_number":51,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":52,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":53,"context_line":"\t\t\t\treturn ErrNoClusterName{}"},{"line_number":54,"context_line":"\t\t\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_cabdd6b1","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":53},"in_reply_to":"bf51134e_89ddd4de","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\t\tExample: usageExample,"},{"line_number":51,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":52,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":53,"context_line":"\t\t\t\treturn ErrNoClusterName{}"},{"line_number":54,"context_line":"\t\t\t}"},{"line_number":55,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":56,"context_line":"\t\t\topts.Phase \u003d phase"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_09d264d1","line":53,"updated":"2020-07-15 02:53:01.000000000","message":"This check is meaningless, you already specified exact amount of arguments at line 49, cobra will handle this, ErrNoClusterName will never be thrown since function will be executed only if length of args is equal 1.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\t\tExample: usageExample,"},{"line_number":51,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) error {"},{"line_number":52,"context_line":"\t\t\tif len(args) !\u003d 1 {"},{"line_number":53,"context_line":"\t\t\t\treturn ErrNoClusterName{}"},{"line_number":54,"context_line":"\t\t\t}"},{"line_number":55,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":56,"context_line":"\t\t\topts.Phase \u003d phase"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_2ade1210","line":53,"in_reply_to":"bf51134e_09d264d1","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"9aac4e69316b5589d23348df6e05c86ab74cd9fc","unresolved":false,"context_lines":[{"line_number":66,"context_line":"\t\t\t\treturn err"},{"line_number":67,"context_line":"\t\t\t}"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"\t\t\toutputFile, err :\u003d os.Create(output)"},{"line_number":70,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":71,"context_line":"\t\t\t\treturn err"},{"line_number":72,"context_line":"\t\t\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_68f6815f","line":69,"range":{"start_line":69,"start_character":22,"end_line":69,"end_character":39},"updated":"2020-07-14 17:20:00.000000000","message":"We should not interact with file system directly, use document.Filesystem interface for that, extend it if some it\u0027s not sufficient.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"\t\t\t\treturn err"},{"line_number":67,"context_line":"\t\t\t}"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"\t\t\toutputFile, err :\u003d os.Create(output)"},{"line_number":70,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":71,"context_line":"\t\t\t\treturn err"},{"line_number":72,"context_line":"\t\t\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_58a7dd0c","line":69,"range":{"start_line":69,"start_character":22,"end_line":69,"end_character":39},"in_reply_to":"bf51134e_68f6815f","updated":"2020-07-20 16:29:49.000000000","message":"What\u0027s wrong with creating a file when we need to store info on FS? Why do we need this document related abstraction for kubeconfig?","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"9aac4e69316b5589d23348df6e05c86ab74cd9fc","unresolved":false,"context_lines":[{"line_number":83,"context_line":"\tflags.StringVar("},{"line_number":84,"context_line":"\t\t\u0026phase,"},{"line_number":85,"context_line":"\t\t\"phase\","},{"line_number":86,"context_line":"\t\t\"\","},{"line_number":87,"context_line":"\t\t\"the name of the phase when target cluster deployed\")"},{"line_number":88,"context_line":"\tflags.StringVar("},{"line_number":89,"context_line":"\t\t\u0026output,"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_88e2f59e","line":86,"range":{"start_line":86,"start_character":2,"end_line":86,"end_character":5},"updated":"2020-07-14 17:20:00.000000000","message":"I think there should be reasonable default, control-plane for example, and also a debug message, that default is being used","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"\tflags.StringVar("},{"line_number":84,"context_line":"\t\t\u0026phase,"},{"line_number":85,"context_line":"\t\t\"phase\","},{"line_number":86,"context_line":"\t\t\"\","},{"line_number":87,"context_line":"\t\t\"the name of the phase when target cluster deployed\")"},{"line_number":88,"context_line":"\tflags.StringVar("},{"line_number":89,"context_line":"\t\t\u0026output,"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_98a855da","line":86,"range":{"start_line":86,"start_character":2,"end_line":86,"end_character":5},"in_reply_to":"bf51134e_88e2f59e","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"9aac4e69316b5589d23348df6e05c86ab74cd9fc","unresolved":false,"context_lines":[{"line_number":88,"context_line":"\tflags.StringVar("},{"line_number":89,"context_line":"\t\t\u0026output,"},{"line_number":90,"context_line":"\t\t\"output\","},{"line_number":91,"context_line":"\t\t\"\","},{"line_number":92,"context_line":"\t\t\"the name of the file where to store the output\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"phase\")"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_08b6e58a","line":91,"range":{"start_line":91,"start_character":2,"end_line":91,"end_character":4},"updated":"2020-07-14 17:20:00.000000000","message":"consider using stdout as default.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":88,"context_line":"\tflags.StringVar("},{"line_number":89,"context_line":"\t\t\u0026output,"},{"line_number":90,"context_line":"\t\t\"output\","},{"line_number":91,"context_line":"\t\t\"\","},{"line_number":92,"context_line":"\t\t\"the name of the file where to store the output\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"phase\")"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_09eb8477","line":91,"range":{"start_line":91,"start_character":2,"end_line":91,"end_character":4},"in_reply_to":"bf51134e_08b6e58a","updated":"2020-07-15 02:53:01.000000000","message":"Agree, it could also improve test of command output.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"\tflags.StringVar("},{"line_number":89,"context_line":"\t\t\u0026output,"},{"line_number":90,"context_line":"\t\t\"output\","},{"line_number":91,"context_line":"\t\t\"\","},{"line_number":92,"context_line":"\t\t\"the name of the file where to store the output\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"phase\")"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_f8b51134","line":91,"range":{"start_line":91,"start_character":2,"end_line":91,"end_character":4},"in_reply_to":"bf51134e_09eb8477","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":91,"context_line":"\t\t\"\","},{"line_number":92,"context_line":"\t\t\"the name of the file where to store the output\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"phase\")"},{"line_number":95,"context_line":"\tif err !\u003d nil {"},{"line_number":96,"context_line":"\t\tlog.Fatal(err)"},{"line_number":97,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_c967cc24","line":94,"updated":"2020-07-15 02:53:01.000000000","message":"Making flags \"required\" contrary to the concept of flags and should be avoided, if possible. If flags are really mandatory, better to add them as args. If you still want to use them as required, please add appropriate information to the help output how it was done there [1]. And also, please keep in mind, that there is only one place in airshipctl where flag is marked as required [2], no other commands use \"phase\" or \"output\" as mandatory flags instead of args. \n\n[1] https://github.com/airshipit/airshipctl/blob/master/cmd/config/set_cluster.go#L33-L34\n[2] https://github.com/airshipit/airshipctl/blob/master/cmd/config/set_cluster.go#L108","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":91,"context_line":"\t\t\"\","},{"line_number":92,"context_line":"\t\t\"the name of the file where to store the output\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"phase\")"},{"line_number":95,"context_line":"\tif err !\u003d nil {"},{"line_number":96,"context_line":"\t\tlog.Fatal(err)"},{"line_number":97,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_a191a49d","line":94,"in_reply_to":"bf51134e_c967cc24","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"0f8f4de2c74b2576da8ff221810dd984886e60a4","unresolved":false,"context_lines":[{"line_number":32,"context_line":"`"},{"line_number":33,"context_line":"\tusageExample \u003d `"},{"line_number":34,"context_line":"# Extract cluster kubeconfig"},{"line_number":35,"context_line":"airshipctl secret get kubeconfig target_dummy_cluster controlplane --output filename"},{"line_number":36,"context_line":"`"},{"line_number":37,"context_line":")"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-go","patch_set":32,"id":"bf51134e_dc4ed66c","line":35,"range":{"start_line":35,"start_character":11,"end_line":35,"end_character":17},"updated":"2020-07-23 13:00:58.000000000","message":"I want to introduce a new command to extract kubeconfig from manifests https://review.opendev.org/#/c/736523/ In this case, I can\u0027t specify any cluster because it is stored in the manifests. The meaning of the new command is the same. What type of cluster should I specify in this case?","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9b0e6c52123fd638fc18464da5a530cf7083d6bd","unresolved":false,"context_lines":[{"line_number":32,"context_line":"`"},{"line_number":33,"context_line":"\tusageExample \u003d `"},{"line_number":34,"context_line":"# Extract cluster kubeconfig"},{"line_number":35,"context_line":"airshipctl secret get kubeconfig target_dummy_cluster controlplane --output filename"},{"line_number":36,"context_line":"`"},{"line_number":37,"context_line":")"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-go","patch_set":32,"id":"bf51134e_4d0df28e","line":35,"range":{"start_line":35,"start_character":11,"end_line":35,"end_character":17},"in_reply_to":"bf51134e_dc4ed66c","updated":"2020-07-23 16:06:31.000000000","message":"We don\u0027t need to know cluster type in case kubeconfig extraction from the secret. We just need a cluster name to make the name of the secret which is in form of \"\u003ccluster_name\u003e-kubeconfig\".","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":31248,"name":"Arvinderpal Wander","email":"awander@gmail.com","username":"awander"},"change_message_id":"8bcdfd5c8b066bc1416c27b1a06b674f03718601","unresolved":false,"context_lines":[{"line_number":67,"context_line":"\t\t\t\treturn err"},{"line_number":68,"context_line":"\t\t\t}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"\t\t\treturn printToFile(kubeConfig, outputFile)"},{"line_number":71,"context_line":"\t\t},"},{"line_number":72,"context_line":"\t}"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-go","patch_set":32,"id":"bf51134e_bb8cfd7f","line":70,"updated":"2020-07-21 14:17:40.000000000","message":"How about patching the user\u0027s .kube/config with the config and switching contexts? Or at least giving them the option to do so? \nThis is a very common practice with the most cloud vendors. For example, with gcp you can issue the following: gcloud clusters get-credentials \u003ccluster-name\u003e and it will fetch and update your local .kube/config.","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"72877fe8aa927f2733e5d0e416a67a789d63b34f","unresolved":false,"context_lines":[{"line_number":67,"context_line":"\t\t\t\treturn err"},{"line_number":68,"context_line":"\t\t\t}"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"\t\t\treturn printToFile(kubeConfig, outputFile)"},{"line_number":71,"context_line":"\t\t},"},{"line_number":72,"context_line":"\t}"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-go","patch_set":32,"id":"bf51134e_a3a68c0e","line":70,"in_reply_to":"bf51134e_bb8cfd7f","updated":"2020-07-21 23:29:47.000000000","message":"This sounds useful indeed, however i would argue, that it is out of scope for this patchset.","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":49,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":50,"context_line":"\t\tArgs:    cobra.ExactArgs(2),"},{"line_number":51,"context_line":"\t\tExample: usageExample,"},{"line_number":52,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) (err error) {"},{"line_number":53,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":54,"context_line":"\t\t\topts.Phase \u003d args[1]"},{"line_number":55,"context_line":"\t\t\topts.Client, err \u003d factory(s)"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_ed74766a","line":52,"range":{"start_line":52,"start_character":2,"end_line":52,"end_character":6},"updated":"2020-08-06 00:17:06.000000000","message":"we run into the problem where these complex RunE functions with errors are not being tested. it would be best practice to minimize logic in unnamed functions.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":50,"context_line":"\t\tArgs:    cobra.ExactArgs(2),"},{"line_number":51,"context_line":"\t\tExample: usageExample,"},{"line_number":52,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) (err error) {"},{"line_number":53,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":54,"context_line":"\t\t\topts.Phase \u003d args[1]"},{"line_number":55,"context_line":"\t\t\topts.Client, err \u003d factory(s)"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_965add80","line":52,"range":{"start_line":52,"start_character":2,"end_line":52,"end_character":6},"in_reply_to":"9f560f44_ed74766a","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":52,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) (err error) {"},{"line_number":53,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":54,"context_line":"\t\t\topts.Phase \u003d args[1]"},{"line_number":55,"context_line":"\t\t\topts.Client, err \u003d factory(s)"},{"line_number":56,"context_line":"\t\t\tif err !\u003d nil {"},{"line_number":57,"context_line":"\t\t\t\treturn err"},{"line_number":58,"context_line":"\t\t\t}"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"\t\t\tkubeConfig, err :\u003d secret.GetKubeconfig(s.Config, opts)"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_4dcda22f","line":57,"range":{"start_line":55,"start_character":0,"end_line":57,"end_character":4},"updated":"2020-08-06 00:17:06.000000000","message":"perhaps you can put this factory into the client, and let it be loaded in runtime, so you don\u0027t need to check this error here.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":82,"context_line":"}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"func printToFile(kubeConfig string, filePath string) error {"},{"line_number":85,"context_line":"\tout, err :\u003d os.Create(filePath)"},{"line_number":86,"context_line":"\tif err !\u003d nil {"},{"line_number":87,"context_line":"\t\treturn err"},{"line_number":88,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_cd7412d2","line":85,"range":{"start_line":85,"start_character":0,"end_line":85,"end_character":32},"updated":"2020-08-06 00:17:06.000000000","message":"as i stated before, please use filesystem interface that we have developed, examples on how to use it, can be found here https://github.com/airshipit/airshipctl/blob/master/pkg/k8s/utils/utils.go#L104-L125 \nAnd this looks like something reusable, as stated in original issues, executors may leverage this function.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":82,"context_line":"}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"func printToFile(kubeConfig string, filePath string) error {"},{"line_number":85,"context_line":"\tout, err :\u003d os.Create(filePath)"},{"line_number":86,"context_line":"\tif err !\u003d nil {"},{"line_number":87,"context_line":"\t\treturn err"},{"line_number":88,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_3665d146","line":85,"range":{"start_line":85,"start_character":0,"end_line":85,"end_character":32},"in_reply_to":"9f560f44_cd7412d2","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":36,"context_line":"`"},{"line_number":37,"context_line":")"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"var ("},{"line_number":40,"context_line":"\toutput     io.Writer"},{"line_number":41,"context_line":"\toutputFile string"},{"line_number":42,"context_line":")"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"// NewGetKubeconfigFromSecretCommand creates a new command for getting kubeconfig from secret"},{"line_number":45,"context_line":"func NewGetKubeconfigFromSecretCommand(s *env.AirshipCTLSettings, factory client.Factory) *cobra.Command {"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_096b6284","line":42,"range":{"start_line":39,"start_character":0,"end_line":42,"end_character":1},"updated":"2020-08-27 20:55:07.000000000","message":"I don\u0027t see a reason for either of these to be global. Please just pass them around as arguments","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":36,"context_line":"`"},{"line_number":37,"context_line":")"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"var ("},{"line_number":40,"context_line":"\toutput     io.Writer"},{"line_number":41,"context_line":"\toutputFile string"},{"line_number":42,"context_line":")"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"// NewGetKubeconfigFromSecretCommand creates a new command for getting kubeconfig from secret"},{"line_number":45,"context_line":"func NewGetKubeconfigFromSecretCommand(s *env.AirshipCTLSettings, factory client.Factory) *cobra.Command {"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_5d9b4b65","line":42,"range":{"start_line":39,"start_character":0,"end_line":42,"end_character":1},"in_reply_to":"9f560f44_096b6284","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":42,"context_line":")"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"// NewGetKubeconfigFromSecretCommand creates a new command for getting kubeconfig from secret"},{"line_number":45,"context_line":"func NewGetKubeconfigFromSecretCommand(s *env.AirshipCTLSettings, factory client.Factory) *cobra.Command {"},{"line_number":46,"context_line":"\topts :\u003d \u0026secret.KubecfgOpts{}"},{"line_number":47,"context_line":"\tcmd :\u003d \u0026cobra.Command{"},{"line_number":48,"context_line":"\t\tUse:     \"kubeconfig [TARGET_CLUSTER_NAME] [PHASE_NAME]\","}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_290906dc","line":45,"range":{"start_line":45,"start_character":39,"end_line":45,"end_character":40},"updated":"2020-08-27 20:55:07.000000000","message":"`settings` or `rootSettings`","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":42,"context_line":")"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"// NewGetKubeconfigFromSecretCommand creates a new command for getting kubeconfig from secret"},{"line_number":45,"context_line":"func NewGetKubeconfigFromSecretCommand(s *env.AirshipCTLSettings, factory client.Factory) *cobra.Command {"},{"line_number":46,"context_line":"\topts :\u003d \u0026secret.KubecfgOpts{}"},{"line_number":47,"context_line":"\tcmd :\u003d \u0026cobra.Command{"},{"line_number":48,"context_line":"\t\tUse:     \"kubeconfig [TARGET_CLUSTER_NAME] [PHASE_NAME]\","}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_1a1c3976","line":45,"range":{"start_line":45,"start_character":39,"end_line":45,"end_character":40},"in_reply_to":"9f560f44_290906dc","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":51,"context_line":"\t\tArgs:    cobra.ExactArgs(2),"},{"line_number":52,"context_line":"\t\tExample: usageExample,"},{"line_number":53,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) (err error) {"},{"line_number":54,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":55,"context_line":"\t\t\topts.Phase \u003d args[1]"},{"line_number":56,"context_line":"\t\t\topts.Client, err \u003d factory(s)"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_492f1a3e","line":53,"range":{"start_line":53,"start_character":48,"end_line":53,"end_character":59},"updated":"2020-08-27 20:55:07.000000000","message":"Per our style guide [0]: naming the return value here adds nothing, please declare it in the function body\n\n[0] https://github.com/golang/go/wiki/CodeReviewComments#named-result-parameters","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":51,"context_line":"\t\tArgs:    cobra.ExactArgs(2),"},{"line_number":52,"context_line":"\t\tExample: usageExample,"},{"line_number":53,"context_line":"\t\tRunE: func(cmd *cobra.Command, args []string) (err error) {"},{"line_number":54,"context_line":"\t\t\topts.ClusterName \u003d args[0]"},{"line_number":55,"context_line":"\t\t\topts.Phase \u003d args[1]"},{"line_number":56,"context_line":"\t\t\topts.Client, err \u003d factory(s)"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_3d2bf733","line":53,"range":{"start_line":53,"start_character":48,"end_line":53,"end_character":59},"in_reply_to":"9f560f44_492f1a3e","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":73,"context_line":"\treturn cmd"},{"line_number":74,"context_line":"}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"func printKubeconfigFromSecret(s *env.AirshipCTLSettings, opts *secret.KubecfgOpts) (err error) {"},{"line_number":77,"context_line":"\tkubeConfig, err :\u003d secret.GetKubeconfig(s.Config, opts)"},{"line_number":78,"context_line":"\tif err !\u003d nil {"},{"line_number":79,"context_line":"\t\treturn err"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_49d43a20","line":76,"range":{"start_line":76,"start_character":31,"end_line":76,"end_character":32},"updated":"2020-08-27 20:55:07.000000000","message":"`settings` or `rootSettings`","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":73,"context_line":"\treturn cmd"},{"line_number":74,"context_line":"}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"func printKubeconfigFromSecret(s *env.AirshipCTLSettings, opts *secret.KubecfgOpts) (err error) {"},{"line_number":77,"context_line":"\tkubeConfig, err :\u003d secret.GetKubeconfig(s.Config, opts)"},{"line_number":78,"context_line":"\tif err !\u003d nil {"},{"line_number":79,"context_line":"\t\treturn err"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_29d74625","line":76,"range":{"start_line":76,"start_character":84,"end_line":76,"end_character":95},"updated":"2020-08-27 20:55:07.000000000","message":"ditto","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":73,"context_line":"\treturn cmd"},{"line_number":74,"context_line":"}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"func printKubeconfigFromSecret(s *env.AirshipCTLSettings, opts *secret.KubecfgOpts) (err error) {"},{"line_number":77,"context_line":"\tkubeConfig, err :\u003d secret.GetKubeconfig(s.Config, opts)"},{"line_number":78,"context_line":"\tif err !\u003d nil {"},{"line_number":79,"context_line":"\t\treturn err"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_1d30b39e","line":76,"range":{"start_line":76,"start_character":84,"end_line":76,"end_character":95},"in_reply_to":"9f560f44_29d74625","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":73,"context_line":"\treturn cmd"},{"line_number":74,"context_line":"}"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"func printKubeconfigFromSecret(s *env.AirshipCTLSettings, opts *secret.KubecfgOpts) (err error) {"},{"line_number":77,"context_line":"\tkubeConfig, err :\u003d secret.GetKubeconfig(s.Config, opts)"},{"line_number":78,"context_line":"\tif err !\u003d nil {"},{"line_number":79,"context_line":"\t\treturn err"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_5d2a2b2c","line":76,"range":{"start_line":76,"start_character":31,"end_line":76,"end_character":32},"in_reply_to":"9f560f44_49d43a20","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":82,"context_line":"\treturn printKubeconfig(kubeConfig)"},{"line_number":83,"context_line":"}"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"func printKubeconfig(kubeConfig []byte) (err error) {"},{"line_number":86,"context_line":"\tif len(outputFile) \u003d\u003d 0 {"},{"line_number":87,"context_line":"\t\t_, err \u003d fmt.Fprintln(output, string(kubeConfig))"},{"line_number":88,"context_line":"\t\treturn err"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_69ddbe3f","line":85,"range":{"start_line":85,"start_character":40,"end_line":85,"end_character":51},"updated":"2020-08-27 20:55:07.000000000","message":"ditto","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":82,"context_line":"\treturn printKubeconfig(kubeConfig)"},{"line_number":83,"context_line":"}"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"func printKubeconfig(kubeConfig []byte) (err error) {"},{"line_number":86,"context_line":"\tif len(outputFile) \u003d\u003d 0 {"},{"line_number":87,"context_line":"\t\t_, err \u003d fmt.Fprintln(output, string(kubeConfig))"},{"line_number":88,"context_line":"\t\treturn err"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_9d1b231b","line":85,"range":{"start_line":85,"start_character":40,"end_line":85,"end_character":51},"in_reply_to":"9f560f44_69ddbe3f","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"}],"cmd/secret/get/get_kubeconfig_test.go":[{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":69,"context_line":"\t\t},"},{"line_number":70,"context_line":"\t\t{"},{"line_number":71,"context_line":"\t\t\tName:    \"kubeconfig-from-secret-cmd\","},{"line_number":72,"context_line":"\t\t\tCmdLine: fmt.Sprintf(\"%s --phase %s --output /tmp/targetkubeconfig\", clusterName, phaseName),"},{"line_number":73,"context_line":"\t\t\tCmd:     secret_getter.NewGetKubeconfigFromSecretCommand(fakeRootSettings, testClientFactory),"},{"line_number":74,"context_line":"\t\t},"},{"line_number":75,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_290c8892","line":72,"updated":"2020-07-15 02:53:01.000000000","message":"May be it would be better to print output to stdout as default and compare it with actual value rather than blank output.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":69,"context_line":"\t\t},"},{"line_number":70,"context_line":"\t\t{"},{"line_number":71,"context_line":"\t\t\tName:    \"kubeconfig-from-secret-cmd\","},{"line_number":72,"context_line":"\t\t\tCmdLine: fmt.Sprintf(\"%s --phase %s --output /tmp/targetkubeconfig\", clusterName, phaseName),"},{"line_number":73,"context_line":"\t\t\tCmd:     secret_getter.NewGetKubeconfigFromSecretCommand(fakeRootSettings, testClientFactory),"},{"line_number":74,"context_line":"\t\t},"},{"line_number":75,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_c194988f","line":72,"in_reply_to":"bf51134e_290c8892","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":21,"context_line":"\tcoreV1 \"k8s.io/api/core/v1\""},{"line_number":22,"context_line":"\tmetaV1 \"k8s.io/apimachinery/pkg/apis/meta/v1\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"\tsecret_getter \"opendev.org/airship/airshipctl/cmd/secret/get\""},{"line_number":25,"context_line":"\tenv \"opendev.org/airship/airshipctl/pkg/environment\""},{"line_number":26,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/k8s/client\""},{"line_number":27,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/k8s/client/fake\""}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_3781584f","line":24,"range":{"start_line":24,"start_character":1,"end_line":24,"end_character":14},"updated":"2020-08-27 20:55:07.000000000","message":"is there a reason to rename this? Underscores look very strange in Go, and I think the default name of \"get\" is good enough","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":21,"context_line":"\tcoreV1 \"k8s.io/api/core/v1\""},{"line_number":22,"context_line":"\tmetaV1 \"k8s.io/apimachinery/pkg/apis/meta/v1\""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"\tsecret_getter \"opendev.org/airship/airshipctl/cmd/secret/get\""},{"line_number":25,"context_line":"\tenv \"opendev.org/airship/airshipctl/pkg/environment\""},{"line_number":26,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/k8s/client\""},{"line_number":27,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/k8s/client/fake\""}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_bd70a775","line":24,"range":{"start_line":24,"start_character":1,"end_line":24,"end_character":14},"in_reply_to":"9f560f44_3781584f","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":69,"context_line":"\t\t},"},{"line_number":70,"context_line":"\t\t{"},{"line_number":71,"context_line":"\t\t\tName:    \"kubeconfig-from-secret-cmd-one-arg\","},{"line_number":72,"context_line":"\t\t\tCmdLine: fmt.Sprintf(\"%s\", clusterName),"},{"line_number":73,"context_line":"\t\t\tCmd:     secret_getter.NewGetKubeconfigFromSecretCommand(fakeRootSettings, testClientFactory),"},{"line_number":74,"context_line":"\t\t\tError:   fmt.Errorf(\"accepts 2 arg(s), received 1\"),"},{"line_number":75,"context_line":"\t\t},"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_a990764f","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":42},"updated":"2020-08-27 20:55:07.000000000","message":"no need for Sprintf here - just use `clusterName` directly","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":69,"context_line":"\t\t},"},{"line_number":70,"context_line":"\t\t{"},{"line_number":71,"context_line":"\t\t\tName:    \"kubeconfig-from-secret-cmd-one-arg\","},{"line_number":72,"context_line":"\t\t\tCmdLine: fmt.Sprintf(\"%s\", clusterName),"},{"line_number":73,"context_line":"\t\t\tCmd:     secret_getter.NewGetKubeconfigFromSecretCommand(fakeRootSettings, testClientFactory),"},{"line_number":74,"context_line":"\t\t\tError:   fmt.Errorf(\"accepts 2 arg(s), received 1\"),"},{"line_number":75,"context_line":"\t\t},"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_dd675bb7","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":42},"in_reply_to":"9f560f44_a990764f","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"}],"cmd/secret/get/get_target_kubeconfig.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"7c35dec8f0035cdead6e414bfbcc2903cc6c29a9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"func NewGetSecretTargetKubeconfigCommand(s *environment.AirshipCTLSettings, factory client.Factory) *cobra.Command {"},{"line_number":40,"context_line":"\to :\u003d \u0026secret.TargetKubeconfigOptions{}"},{"line_number":41,"context_line":"\tcmd :\u003d \u0026cobra.Command{"},{"line_number":42,"context_line":"\t\tUse:     \"target-kubeconfig [NAME]\","},{"line_number":43,"context_line":"\t\tShort:   \"Get target cluster kubeconfig from secrets\","},{"line_number":44,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":45,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_1466b7ee","line":42,"range":{"start_line":42,"start_character":12,"end_line":42,"end_character":29},"updated":"2020-06-15 22:16:00.000000000","message":"This should be more generic, like cluster-kubeconfig.","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"a561ee529b111a5bdf6f146232879390622aed66","unresolved":false,"context_lines":[{"line_number":39,"context_line":"func NewGetSecretTargetKubeconfigCommand(s *environment.AirshipCTLSettings, factory client.Factory) *cobra.Command {"},{"line_number":40,"context_line":"\to :\u003d \u0026secret.TargetKubeconfigOptions{}"},{"line_number":41,"context_line":"\tcmd :\u003d \u0026cobra.Command{"},{"line_number":42,"context_line":"\t\tUse:     \"target-kubeconfig [NAME]\","},{"line_number":43,"context_line":"\t\tShort:   \"Get target cluster kubeconfig from secrets\","},{"line_number":44,"context_line":"\t\tLong:    usageLong[1:],"},{"line_number":45,"context_line":"\t\tArgs:    cobra.ExactArgs(1),"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_e740b70a","line":42,"range":{"start_line":42,"start_character":12,"end_line":42,"end_character":29},"in_reply_to":"bf51134e_1466b7ee","updated":"2020-06-16 00:34:45.000000000","message":"Done","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"7c35dec8f0035cdead6e414bfbcc2903cc6c29a9","unresolved":false,"context_lines":[{"line_number":67,"context_line":"func addFlags(o *secret.TargetKubeconfigOptions, cmd *cobra.Command) {"},{"line_number":68,"context_line":"\tflags :\u003d cmd.Flags()"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"\tflags.StringVar("},{"line_number":71,"context_line":"\t\t\u0026o.Namespace,"},{"line_number":72,"context_line":"\t\t\"namespace\","},{"line_number":73,"context_line":"\t\t\"\","},{"line_number":74,"context_line":"\t\t\"the name of the namespace where target cluster deployed\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"namespace\")"},{"line_number":77,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_14ab57d6","line":74,"range":{"start_line":70,"start_character":0,"end_line":74,"end_character":60},"updated":"2020-06-15 22:16:00.000000000","message":"Just something to consider, maybe as a next step, maybe now. Namespace could come from manifests instead, and from command line we supply the phase name (and have default) in which we keep cluster object, then we find that cluster object, and extract namespace from it.","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"a561ee529b111a5bdf6f146232879390622aed66","unresolved":false,"context_lines":[{"line_number":67,"context_line":"func addFlags(o *secret.TargetKubeconfigOptions, cmd *cobra.Command) {"},{"line_number":68,"context_line":"\tflags :\u003d cmd.Flags()"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"\tflags.StringVar("},{"line_number":71,"context_line":"\t\t\u0026o.Namespace,"},{"line_number":72,"context_line":"\t\t\"namespace\","},{"line_number":73,"context_line":"\t\t\"\","},{"line_number":74,"context_line":"\t\t\"the name of the namespace where target cluster deployed\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"namespace\")"},{"line_number":77,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_479b6371","line":74,"range":{"start_line":70,"start_character":0,"end_line":74,"end_character":60},"in_reply_to":"bf51134e_14ab57d6","updated":"2020-06-16 00:34:45.000000000","message":"If you mean to provide phase name for this new command to retrieve kubeconfig from secret then I think this is not logically connected and it\u0027s better to provide namespace. Furthermore, anyway it\u0027s an additional parameter like namespace. Besides that extraction of the namespace from the manifest based on phase name looks like extra complexity added for this particular CLI. One more thing here is that the manifest can be written without namespace in it. This will lead to extra logic to provide default namespace if there is no field in the manifest. Sure, it\u0027s not a big deal to implement but is it worth it? What do we achieve by that? If we have a strong explanation for that then it can be implemented in a separate PS.","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"b6e897f78376a6c12aa9137ee045ea4c8f3e81d2","unresolved":false,"context_lines":[{"line_number":67,"context_line":"func addFlags(o *secret.TargetKubeconfigOptions, cmd *cobra.Command) {"},{"line_number":68,"context_line":"\tflags :\u003d cmd.Flags()"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"\tflags.StringVar("},{"line_number":71,"context_line":"\t\t\u0026o.Namespace,"},{"line_number":72,"context_line":"\t\t\"namespace\","},{"line_number":73,"context_line":"\t\t\"\","},{"line_number":74,"context_line":"\t\t\"the name of the namespace where target cluster deployed\")"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"\terr :\u003d cmd.MarkFlagRequired(\"namespace\")"},{"line_number":77,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_1ed9a682","line":74,"range":{"start_line":70,"start_character":0,"end_line":74,"end_character":60},"in_reply_to":"bf51134e_479b6371","updated":"2020-06-16 17:34:05.000000000","message":"I can envision that we are going to use this by some other higher level tool like jenkins, zuul or any other CD tool, in such case, what should be a source of truth for the namespace here? I do agree that this can be a first step in the overall implementation of the feature. But it will not cover what we want, so i would suggest leaving \"TODO\" comments about this in code, namespace, as well as actually name should should be possible to be derived from document set. And yes, i agree that it adds complexity, that is why we are building this code, so that deployment complexity hidden in it, rather than put on Deployment Engineer\u0027s shoulders. I can imagine that there will be 30 clusters managed by single airshipctl instance, keeping track of cluster names and namespaces would be a mess, that is why we have a context associated with each document set, which in turn holds all this information, and this information is the source of truth.\n\nAlso, please note, that this way of getting the secret will be needed as well as logic of getting it from manifests. So I am not saying, that this is the wrong way, I am saying, that we need both ways.","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"}],"cmd/secret/get/get_test.go":[{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":36,"context_line":"\t\t\tCmd:     get.NewGetCommand(fakeRootSettings),"},{"line_number":37,"context_line":"\t\t},"},{"line_number":38,"context_line":"\t}"},{"line_number":39,"context_line":"\tfor _, testcase :\u003d range tests {"},{"line_number":40,"context_line":"\t\ttestutil.RunTest(t, testcase)"},{"line_number":41,"context_line":"\t}"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_697840c3","line":39,"updated":"2020-07-15 02:53:01.000000000","message":"Why use range if there is only one test defined?","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"9f80052f18f87e34803c0b6def1b8aad9b39c21b","unresolved":false,"context_lines":[{"line_number":36,"context_line":"\t\t\tCmd:     get.NewGetCommand(fakeRootSettings),"},{"line_number":37,"context_line":"\t\t},"},{"line_number":38,"context_line":"\t}"},{"line_number":39,"context_line":"\tfor _, testcase :\u003d range tests {"},{"line_number":40,"context_line":"\t\ttestutil.RunTest(t, testcase)"},{"line_number":41,"context_line":"\t}"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_61a78c0d","line":39,"in_reply_to":"bf51134e_697840c3","updated":"2020-07-20 16:29:49.000000000","message":"Done","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"}],"cmd/secret/get/testdata/TestNewGetKubeconfigFromSecretCommandGoldenOutput/kubeconfig-from-secret-cmd-with-help.golden":[{"author":{"_account_id":22477,"name":"Matt McEuen","email":"matt.mceuen@att.com","username":"mattmceuen"},"change_message_id":"566b1e94ddd87e19d40fef3330cc669c891ee379","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Extract cluster kubeconfig from ephemeral cluster secret"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Usage:"},{"line_number":4,"context_line":"  kubeconfig [TARGET_CLUSTER_NAME] [PHASE_NAME] [flags]"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"Examples:"},{"line_number":7,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":32,"id":"9f560f44_46789cf7","line":4,"range":{"start_line":4,"start_character":14,"end_line":4,"end_character":33},"updated":"2020-07-24 20:24:15.000000000","message":"Do we need to specify the cluster name on the commandline, or could we find it in the rendered document set (since we have the phase name)?","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"54717f6cdfdd033664e1e0702f0a4c151e9760e8","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Extract cluster kubeconfig from ephemeral cluster secret"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"Usage:"},{"line_number":4,"context_line":"  kubeconfig [TARGET_CLUSTER_NAME] [PHASE_NAME] [flags]"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"Examples:"},{"line_number":7,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":32,"id":"9f560f44_8b7aa685","line":4,"range":{"start_line":4,"start_character":14,"end_line":4,"end_character":33},"in_reply_to":"9f560f44_46789cf7","updated":"2020-07-27 17:08:03.000000000","message":"Phase name can be the same for many clusters, so, yes, we need to provide cluster name and phase.","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":22477,"name":"Matt McEuen","email":"matt.mceuen@att.com","username":"mattmceuen"},"change_message_id":"566b1e94ddd87e19d40fef3330cc669c891ee379","unresolved":false,"context_lines":[{"line_number":6,"context_line":"Examples:"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"# Extract cluster kubeconfig"},{"line_number":9,"context_line":"airshipctl secret get kubeconfig target_dummy_cluster controlplane --output filename"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Flags:"}],"source_content_type":"application/octet-stream","patch_set":32,"id":"9f560f44_865bd485","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":32},"updated":"2020-07-24 20:24:15.000000000","message":"Since this is a phase-specific operation already, do you think it would make sense to frame it up as something like\nairshipctl phase kubeconfig controlplane\n?\n\nThe \"secret\" subcommand is going to take on a life of its own, so just wanted to see where the best home for `kubeconfig` is.","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"54717f6cdfdd033664e1e0702f0a4c151e9760e8","unresolved":false,"context_lines":[{"line_number":6,"context_line":"Examples:"},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"# Extract cluster kubeconfig"},{"line_number":9,"context_line":"airshipctl secret get kubeconfig target_dummy_cluster controlplane --output filename"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Flags:"}],"source_content_type":"application/octet-stream","patch_set":32,"id":"9f560f44_06704d72","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":32},"in_reply_to":"9f560f44_865bd485","updated":"2020-07-27 17:08:03.000000000","message":"I just thought we can create other commands under \u0027secret\u0027 to extract other things later. kubeconfig is just one of them. Yes, it\u0027s phase-specific but it\u0027s not changing the phase or doesn\u0027t provide information about the phase itself like render command does. So, it looks like a general-purpose command.","commit_id":"3386cf190e988865a00f60820164660d517eea9c"}],"pkg/document/bundle.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\tSelectByFieldValue(string, func(interface{}) bool) (Bundle, error)"},{"line_number":51,"context_line":"\tGetByGvk(string, string, string) ([]Document, error)"},{"line_number":52,"context_line":"\tGetByName(string) (Document, error)"},{"line_number":53,"context_line":"\tGetByNameAndKind(string, string) (Document, error)"},{"line_number":54,"context_line":"\tGetByAnnotation(annotationSelector string) ([]Document, error)"},{"line_number":55,"context_line":"\tGetByLabel(labelSelector string) ([]Document, error)"},{"line_number":56,"context_line":"\tGetAllDocuments() ([]Document, error)"}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_4f0f1887","line":53,"range":{"start_line":53,"start_character":0,"end_line":53,"end_character":51},"updated":"2020-06-29 20:26:53.000000000","message":"I don\u0027t think we need this method. just use SelectOne(selector)","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"}],"pkg/document/selectors.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":153,"context_line":"}"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"// NewNameKindSelector returns selector to get kind by name"},{"line_number":156,"context_line":"func NewNameKindSelector(name, kind string) Selector {"},{"line_number":157,"context_line":"\treturn NewSelector().ByKind(kind).ByName(name)"},{"line_number":158,"context_line":"}"},{"line_number":159,"context_line":""}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_8f3bf035","line":156,"range":{"start_line":156,"start_character":5,"end_line":156,"end_character":24},"updated":"2020-06-29 20:26:53.000000000","message":"Do we really need this selector?\nI think it would look much cleaner if we this would be\nNewClusterSelector(name string){\nreturn NewSelector().ByKind(ClusterKind).ByName(name)}.","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"}],"pkg/secret/errors.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"72877fe8aa927f2733e5d0e416a67a789d63b34f","unresolved":false,"context_lines":[{"line_number":35,"context_line":"}"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"func (e ErrNoSecret) Error() string {"},{"line_number":38,"context_line":"\treturn fmt.Sprintf(\"Can\u0027t access secret %s in kubernetes: %s\", e.SecretName, e.InternalErr)"},{"line_number":39,"context_line":"}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"func (e ErrEmptySecretData) Error() string {"}],"source_content_type":"text/x-go","patch_set":32,"id":"bf51134e_c3caa09f","line":38,"range":{"start_line":38,"start_character":59,"end_line":38,"end_character":61},"updated":"2020-07-21 23:29:47.000000000","message":"should we consider using %w instead of %s to format errors?","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"80cacfeff60e159fe8e21f2945ba9f853fec816e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"}"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"func (e ErrNoSecret) Error() string {"},{"line_number":38,"context_line":"\treturn fmt.Sprintf(\"Can\u0027t access secret %s in kubernetes: %s\", e.SecretName, e.InternalErr)"},{"line_number":39,"context_line":"}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"func (e ErrEmptySecretData) Error() string {"}],"source_content_type":"text/x-go","patch_set":32,"id":"9f560f44_ba3f0db4","line":38,"range":{"start_line":38,"start_character":59,"end_line":38,"end_character":61},"in_reply_to":"bf51134e_c3caa09f","updated":"2020-07-27 18:49:30.000000000","message":"discard this","commit_id":"3386cf190e988865a00f60820164660d517eea9c"}],"pkg/secret/kubeconfig.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"b6e897f78376a6c12aa9137ee045ea4c8f3e81d2","unresolved":false,"context_lines":[{"line_number":31,"context_line":"}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"// Get function extracts kubeconfig from secret data structure"},{"line_number":34,"context_line":"func (o *KubeconfigOptions) Get() (string, error) {"},{"line_number":35,"context_line":"\tsecretName :\u003d fmt.Sprintf(\"%s-kubeconfig\", o.Name)"},{"line_number":36,"context_line":"\tkubeCore :\u003d o.Client.ClientSet().CoreV1()"},{"line_number":37,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(o.Namespace).Get(secretName, metav1.GetOptions{})"},{"line_number":38,"context_line":"\tif err !\u003d nil {"},{"line_number":39,"context_line":"\t\tlog.Printf(\"error accessing secret in kubernetes: %s\", err)"},{"line_number":40,"context_line":"\t}"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"\tif secret.Data \u003d\u003d nil {"},{"line_number":43,"context_line":"\t\treturn \"\", fmt.Errorf(\"error retrieving data from secret\")"},{"line_number":44,"context_line":"\t}"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"\tval, exist :\u003d secret.Data[\"value\"]"},{"line_number":47,"context_line":"\tif !exist {"},{"line_number":48,"context_line":"\t\treturn \"\", fmt.Errorf(\"error retrieving value from data in secret: %s\", val)"},{"line_number":49,"context_line":"\t}"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"\treturn string(val), nil"},{"line_number":52,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":9,"id":"bf51134e_5e6afe7f","line":52,"range":{"start_line":34,"start_character":0,"end_line":52,"end_character":1},"updated":"2020-06-16 17:34:05.000000000","message":"please add unit-tests for this","commit_id":"4aef77123ca3a0b7e4ba001c222e3360c9a72764"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":35,"context_line":"\tkubeCore :\u003d o.Client.ClientSet().CoreV1()"},{"line_number":36,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(o.Namespace).Get(secretName, metav1.GetOptions{})"},{"line_number":37,"context_line":"\tif err !\u003d nil {"},{"line_number":38,"context_line":"\t\treturn \"\", fmt.Errorf(\"error accessing secret in kubernetes: %s\", err)"},{"line_number":39,"context_line":"\t}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"\tif secret.Data \u003d\u003d nil {"}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_cfa5e8a0","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":72},"updated":"2020-06-29 20:26:53.000000000","message":"implement this error in errors.go file","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":39,"context_line":"\t}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"\tif secret.Data \u003d\u003d nil {"},{"line_number":42,"context_line":"\t\treturn \"\", fmt.Errorf(\"error retrieving data from secret\")"},{"line_number":43,"context_line":"\t}"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"\tval, exist :\u003d secret.Data[\"value\"]"}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_0fbd20b6","line":42,"range":{"start_line":42,"start_character":0,"end_line":42,"end_character":60},"updated":"2020-06-29 20:26:53.000000000","message":"same as above","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"c6978052ca5f52211d45cb049296ece5b92b0a19","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"\tval, exist :\u003d secret.Data[\"value\"]"},{"line_number":46,"context_line":"\tif !exist {"},{"line_number":47,"context_line":"\t\treturn \"\", fmt.Errorf(\"error retrieving value from data in secret: %s\", val)"},{"line_number":48,"context_line":"\t}"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"\treturn string(val), nil"}],"source_content_type":"text/x-go","patch_set":20,"id":"bf51134e_4fb398e9","line":47,"range":{"start_line":47,"start_character":0,"end_line":47,"end_character":78},"updated":"2020-06-29 20:26:53.000000000","message":"same as above","commit_id":"43eb4d4785594bf61bf13984ed606e3f0d4ffd81"},{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":69,"context_line":"\t\treturn \"\", err"},{"line_number":70,"context_line":"\t}"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"\tselector :\u003d document.NewSelector().ByKind(\"Cluster\").ByName(opts.ClusterName)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"\tdoc, err :\u003d docBundle.SelectOne(selector)"},{"line_number":75,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_ac1a666b","line":72,"updated":"2020-07-15 02:53:01.000000000","message":"Please use defined constant instead of using \"Cluster\" in place.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":16768,"name":"Ruslan Aliev","email":"raliev@mirantis.com","username":"raliev"},"change_message_id":"b485570561f05ce19cba9724bdd3b4e9b6e7cb88","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"\tnamespace :\u003d doc.GetNamespace()"},{"line_number":80,"context_line":"\tif namespace \u003d\u003d \"\" {"},{"line_number":81,"context_line":"\t\tnamespace \u003d \"default\""},{"line_number":82,"context_line":"\t}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"\tkubeConfig, err :\u003d opts.getKubeconfigFromSecret(namespace)"}],"source_content_type":"text/x-go","patch_set":30,"id":"bf51134e_2c55b6fa","line":81,"updated":"2020-07-15 02:53:01.000000000","message":"It would be better to add debug message that namespace was not found and default one is used. Also constant variable is preferred.","commit_id":"f107acff65a372ada109edef69b6f5726099fefe"},{"author":{"_account_id":31248,"name":"Arvinderpal Wander","email":"awander@gmail.com","username":"awander"},"change_message_id":"8bcdfd5c8b066bc1416c27b1a06b674f03718601","unresolved":false,"context_lines":[{"line_number":33,"context_line":"}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"// getKubeconfigFromSecret extracts kubeconfig from secret data structure"},{"line_number":36,"context_line":"func (o *KubecfgOpts) getKubeconfigFromSecret(namespace string) (string, error) {"},{"line_number":37,"context_line":"\tsecretName :\u003d fmt.Sprintf(\"%s-kubeconfig\", o.ClusterName)"},{"line_number":38,"context_line":"\tkubeCore :\u003d o.Client.ClientSet().CoreV1()"},{"line_number":39,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(namespace).Get(secretName, metav1.GetOptions{})"}],"source_content_type":"text/x-go","patch_set":32,"id":"bf51134e_7b454515","line":36,"updated":"2020-07-21 14:17:40.000000000","message":"Just an FYI, cluster-api has an e2e framework that has a lot of similar funcs. For example, here is the func to fetch the kubeconfig for the workload cluster: https://github.com/kubernetes-sigs/cluster-api/blob/master/test/framework/cluster_proxy.go#L178\n\nSomething to keep in mind going forward. Perhaps we can leverage aspects of it.","commit_id":"3386cf190e988865a00f60820164660d517eea9c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\t\treturn \"\", ErrNoSecretDataVal{SecretName: secretName}"},{"line_number":51,"context_line":"\t}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"\treturn string(val), nil"},{"line_number":54,"context_line":"}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"// GetKubeconfig gets document and extract data"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_ed6d9632","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":14},"updated":"2020-08-06 00:17:06.000000000","message":"why are we converting this to string. Bytes are be totally fine. Specially if you want to write it somewhere. Majority of write funcs happily accept bytes. and anyone can easily convert it to string.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":50,"context_line":"\t\treturn \"\", ErrNoSecretDataVal{SecretName: secretName}"},{"line_number":51,"context_line":"\t}"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"\treturn string(val), nil"},{"line_number":54,"context_line":"}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"// GetKubeconfig gets document and extract data"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_daa5a6a0","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":14},"in_reply_to":"9f560f44_ed6d9632","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"// GetKubeconfig gets document and extract data"},{"line_number":57,"context_line":"func GetKubeconfig(cfg *config.Config, opts *KubecfgOpts) (string, error) {"},{"line_number":58,"context_line":"\tconst ("},{"line_number":59,"context_line":"\t\tclusterKind \u003d \"Cluster\""},{"line_number":60,"context_line":"\t\tdefaultNs   \u003d \"default\""},{"line_number":61,"context_line":"\t)"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_4d348293","line":58,"range":{"start_line":58,"start_character":1,"end_line":58,"end_character":6},"updated":"2020-08-06 00:17:06.000000000","message":"why are you using constants inside the functions here?","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"// GetKubeconfig gets document and extract data"},{"line_number":57,"context_line":"func GetKubeconfig(cfg *config.Config, opts *KubecfgOpts) (string, error) {"},{"line_number":58,"context_line":"\tconst ("},{"line_number":59,"context_line":"\t\tclusterKind \u003d \"Cluster\""},{"line_number":60,"context_line":"\t\tdefaultNs   \u003d \"default\""},{"line_number":61,"context_line":"\t)"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_ffa97c23","line":58,"range":{"start_line":58,"start_character":1,"end_line":58,"end_character":6},"in_reply_to":"9f560f44_4d348293","updated":"2020-08-11 23:32:34.000000000","message":"Now it\u0027s from document package.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":56,"context_line":"// GetKubeconfig gets document and extract data"},{"line_number":57,"context_line":"func GetKubeconfig(cfg *config.Config, opts *KubecfgOpts) (string, error) {"},{"line_number":58,"context_line":"\tconst ("},{"line_number":59,"context_line":"\t\tclusterKind \u003d \"Cluster\""},{"line_number":60,"context_line":"\t\tdefaultNs   \u003d \"default\""},{"line_number":61,"context_line":"\t)"},{"line_number":62,"context_line":"\terr :\u003d cfg.EnsureComplete()"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_6d2fc63e","line":59,"range":{"start_line":59,"start_character":0,"end_line":59,"end_character":25},"updated":"2020-08-06 00:17:06.000000000","message":"This should be sourced from document package","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":56,"context_line":"// GetKubeconfig gets document and extract data"},{"line_number":57,"context_line":"func GetKubeconfig(cfg *config.Config, opts *KubecfgOpts) (string, error) {"},{"line_number":58,"context_line":"\tconst ("},{"line_number":59,"context_line":"\t\tclusterKind \u003d \"Cluster\""},{"line_number":60,"context_line":"\t\tdefaultNs   \u003d \"default\""},{"line_number":61,"context_line":"\t)"},{"line_number":62,"context_line":"\terr :\u003d cfg.EnsureComplete()"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_dfa4784d","line":59,"range":{"start_line":59,"start_character":0,"end_line":59,"end_character":25},"in_reply_to":"9f560f44_6d2fc63e","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":57,"context_line":"func GetKubeconfig(cfg *config.Config, opts *KubecfgOpts) (string, error) {"},{"line_number":58,"context_line":"\tconst ("},{"line_number":59,"context_line":"\t\tclusterKind \u003d \"Cluster\""},{"line_number":60,"context_line":"\t\tdefaultNs   \u003d \"default\""},{"line_number":61,"context_line":"\t)"},{"line_number":62,"context_line":"\terr :\u003d cfg.EnsureComplete()"},{"line_number":63,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_6db986ca","line":60,"range":{"start_line":60,"start_character":2,"end_line":60,"end_character":11},"updated":"2020-08-06 00:17:06.000000000","message":"why are you using default namespace constant in here, if that is constant default that should be used other modules, it should be exported at the top of the file.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":57,"context_line":"func GetKubeconfig(cfg *config.Config, opts *KubecfgOpts) (string, error) {"},{"line_number":58,"context_line":"\tconst ("},{"line_number":59,"context_line":"\t\tclusterKind \u003d \"Cluster\""},{"line_number":60,"context_line":"\t\tdefaultNs   \u003d \"default\""},{"line_number":61,"context_line":"\t)"},{"line_number":62,"context_line":"\terr :\u003d cfg.EnsureComplete()"},{"line_number":63,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_3f65b41e","line":60,"range":{"start_line":60,"start_character":2,"end_line":60,"end_character":11},"in_reply_to":"9f560f44_6db986ca","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":68,"context_line":"\tif err !\u003d nil {"},{"line_number":69,"context_line":"\t\treturn \"\", err"},{"line_number":70,"context_line":"\t}"},{"line_number":71,"context_line":"\tlog.Debugf(\"Using entryPoint %s\", entryPoint)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"\tdocBundle, err :\u003d document.NewBundleByPath(entryPoint)"},{"line_number":74,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_0dc44a5e","line":71,"range":{"start_line":71,"start_character":0,"end_line":71,"end_character":46},"updated":"2020-08-06 00:17:06.000000000","message":"since this is debug message, please make it more informative, atleast. If i see in logs using entrypoint, that would give me very little information.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":68,"context_line":"\tif err !\u003d nil {"},{"line_number":69,"context_line":"\t\treturn \"\", err"},{"line_number":70,"context_line":"\t}"},{"line_number":71,"context_line":"\tlog.Debugf(\"Using entryPoint %s\", entryPoint)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"\tdocBundle, err :\u003d document.NewBundleByPath(entryPoint)"},{"line_number":74,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_1f68b0f2","line":71,"range":{"start_line":71,"start_character":0,"end_line":71,"end_character":46},"in_reply_to":"9f560f44_0dc44a5e","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":75,"context_line":"\t\treturn \"\", err"},{"line_number":76,"context_line":"\t}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"\tselector :\u003d document.NewSelector().ByKind(clusterKind).ByName(opts.ClusterName)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"\tdoc, err :\u003d docBundle.SelectOne(selector)"},{"line_number":81,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_0dc0ca29","line":78,"range":{"start_line":78,"start_character":36,"end_line":78,"end_character":42},"updated":"2020-08-06 00:17:06.000000000","message":"clusterctl CRDs have static version and kind as well, you should use GVK instead of kind only.","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":75,"context_line":"\t\treturn \"\", err"},{"line_number":76,"context_line":"\t}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"\tselector :\u003d document.NewSelector().ByKind(clusterKind).ByName(opts.ClusterName)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"\tdoc, err :\u003d docBundle.SelectOne(selector)"},{"line_number":81,"context_line":"\tif err !\u003d nil {"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_7f6bacef","line":78,"range":{"start_line":78,"start_character":36,"end_line":78,"end_character":42},"in_reply_to":"9f560f44_0dc0ca29","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"ec5a130d1bd6277cc044db6820a0cee8085c6c82","unresolved":false,"context_lines":[{"line_number":88,"context_line":"\t\tlog.Debug(\"Using default namespace\")"},{"line_number":89,"context_line":"\t}"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"\tkubeConfig, err :\u003d opts.getKubeconfigFromSecret(namespace)"},{"line_number":92,"context_line":"\tif err !\u003d nil {"},{"line_number":93,"context_line":"\t\treturn \"\", err"},{"line_number":94,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_2dee6eec","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":59},"updated":"2020-08-06 00:17:06.000000000","message":"this should be simplified to return opts.getKubeconfigFromSecret","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"ead1e51a5e00064d86e9bec2409f50591c5708b5","unresolved":false,"context_lines":[{"line_number":88,"context_line":"\t\tlog.Debug(\"Using default namespace\")"},{"line_number":89,"context_line":"\t}"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"\tkubeConfig, err :\u003d opts.getKubeconfigFromSecret(namespace)"},{"line_number":92,"context_line":"\tif err !\u003d nil {"},{"line_number":93,"context_line":"\t\treturn \"\", err"},{"line_number":94,"context_line":"\t}"}],"source_content_type":"text/x-go","patch_set":38,"id":"9f560f44_5f6ea8ff","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":59},"in_reply_to":"9f560f44_2dee6eec","updated":"2020-08-11 23:32:34.000000000","message":"Done","commit_id":"b14d29ca383f98807e4ec5fdfca8d7924663ec07"},{"author":{"_account_id":28869,"name":"Ian Howell","email":"ian.howell0@gmail.com","username":"ian"},"change_message_id":"d092a17e23361f6979b349d064dab60fddfe5ba3","unresolved":false,"context_lines":[{"line_number":25,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/log\""},{"line_number":26,"context_line":")"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"// KubecfgOpts holds all configurable options for kubeconfig extraction"},{"line_number":29,"context_line":"type KubecfgOpts struct {"},{"line_number":30,"context_line":"\tClusterName string"},{"line_number":31,"context_line":"\tPhase       string"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_f78ec077","line":28,"range":{"start_line":28,"start_character":3,"end_line":28,"end_character":10},"updated":"2020-08-27 20:55:07.000000000","message":"nit: we\u0027ve been calling this \"Kubeconfig\" everywhere else. It\u0027d be nice to stick to that","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"fc97649ea722d8805565b929b184283d2e682837","unresolved":false,"context_lines":[{"line_number":25,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/log\""},{"line_number":26,"context_line":")"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"// KubecfgOpts holds all configurable options for kubeconfig extraction"},{"line_number":29,"context_line":"type KubecfgOpts struct {"},{"line_number":30,"context_line":"\tClusterName string"},{"line_number":31,"context_line":"\tPhase       string"}],"source_content_type":"text/x-go","patch_set":42,"id":"9f560f44_9df203e3","line":28,"range":{"start_line":28,"start_character":3,"end_line":28,"end_character":10},"in_reply_to":"9f560f44_f78ec077","updated":"2020-08-28 01:18:34.000000000","message":"Done","commit_id":"b7c2930c5b7debbf5d81c0fd79bd8e99697f5645"}],"pkg/secret/target_kubeconfig.go":[{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"7c35dec8f0035cdead6e414bfbcc2903cc6c29a9","unresolved":false,"context_lines":[{"line_number":23,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/log\""},{"line_number":24,"context_line":")"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"// TargetKubeconfigOptions holds all configurable options for cluster configuration"},{"line_number":27,"context_line":"type TargetKubeconfigOptions struct {"},{"line_number":28,"context_line":"\tName      string"},{"line_number":29,"context_line":"\tNamespace string"},{"line_number":30,"context_line":"}"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"// GetTargetKubeconfig extracts Target cluster Kubeconfig from secret"},{"line_number":33,"context_line":"func GetTargetKubeconfig(targetName string, ns string, kubeClient client.Interface) string {"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_3124adc6","line":30,"range":{"start_line":26,"start_character":0,"end_line":30,"end_character":1},"updated":"2020-06-15 22:16:00.000000000","message":"this struct is not used in this package.","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"a561ee529b111a5bdf6f146232879390622aed66","unresolved":false,"context_lines":[{"line_number":23,"context_line":"\t\"opendev.org/airship/airshipctl/pkg/log\""},{"line_number":24,"context_line":")"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"// TargetKubeconfigOptions holds all configurable options for cluster configuration"},{"line_number":27,"context_line":"type TargetKubeconfigOptions struct {"},{"line_number":28,"context_line":"\tName      string"},{"line_number":29,"context_line":"\tNamespace string"},{"line_number":30,"context_line":"}"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"// GetTargetKubeconfig extracts Target cluster Kubeconfig from secret"},{"line_number":33,"context_line":"func GetTargetKubeconfig(targetName string, ns string, kubeClient client.Interface) string {"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_27c58f8f","line":30,"range":{"start_line":26,"start_character":0,"end_line":30,"end_character":1},"in_reply_to":"bf51134e_3124adc6","updated":"2020-06-16 00:34:45.000000000","message":"Done","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"7c35dec8f0035cdead6e414bfbcc2903cc6c29a9","unresolved":false,"context_lines":[{"line_number":30,"context_line":"}"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"// GetTargetKubeconfig extracts Target cluster Kubeconfig from secret"},{"line_number":33,"context_line":"func GetTargetKubeconfig(targetName string, ns string, kubeClient client.Interface) string {"},{"line_number":34,"context_line":"\ttargetKubecfg :\u003d fmt.Sprintf(\"%s-kubeconfig\", targetName)"},{"line_number":35,"context_line":"\tkubeCore :\u003d kubeClient.ClientSet().CoreV1()"},{"line_number":36,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(ns).Get(targetKubecfg, metav1.GetOptions{})"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_54194f77","line":33,"range":{"start_line":33,"start_character":5,"end_line":33,"end_character":24},"updated":"2020-06-15 22:16:00.000000000","message":"Does it matter if we are getting Target or Ephemeral or any other cluster kubeconfig? It feels like it should be more generic, like GetKubeconfig(). I would also suggest that we make it a method of a struct. for example\n\ntype KubeconfigOptions struct {\nname string\nnamespace string\nclient client.Interface\n}\nand then do\nkubeconfig :\u003d KubeconfigOptions.Get()","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"a561ee529b111a5bdf6f146232879390622aed66","unresolved":false,"context_lines":[{"line_number":30,"context_line":"}"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"// GetTargetKubeconfig extracts Target cluster Kubeconfig from secret"},{"line_number":33,"context_line":"func GetTargetKubeconfig(targetName string, ns string, kubeClient client.Interface) string {"},{"line_number":34,"context_line":"\ttargetKubecfg :\u003d fmt.Sprintf(\"%s-kubeconfig\", targetName)"},{"line_number":35,"context_line":"\tkubeCore :\u003d kubeClient.ClientSet().CoreV1()"},{"line_number":36,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(ns).Get(targetKubecfg, metav1.GetOptions{})"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_67bf87fb","line":33,"range":{"start_line":33,"start_character":5,"end_line":33,"end_character":24},"in_reply_to":"bf51134e_54194f77","updated":"2020-06-16 00:34:45.000000000","message":"Done","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"7c35dec8f0035cdead6e414bfbcc2903cc6c29a9","unresolved":false,"context_lines":[{"line_number":35,"context_line":"\tkubeCore :\u003d kubeClient.ClientSet().CoreV1()"},{"line_number":36,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(ns).Get(targetKubecfg, metav1.GetOptions{})"},{"line_number":37,"context_line":"\tif err !\u003d nil {"},{"line_number":38,"context_line":"\t\tlog.Fatalf(\"error accessing secret in kubernetes: %s\", err)"},{"line_number":39,"context_line":"\t}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"\treturn string(secret.Data[\"value\"])"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_517de1af","line":38,"range":{"start_line":38,"start_character":2,"end_line":38,"end_character":61},"updated":"2020-06-15 22:16:00.000000000","message":"I think it\u0027s best to return Error here, rather than stopping execution.","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"a561ee529b111a5bdf6f146232879390622aed66","unresolved":false,"context_lines":[{"line_number":35,"context_line":"\tkubeCore :\u003d kubeClient.ClientSet().CoreV1()"},{"line_number":36,"context_line":"\tsecret, err :\u003d kubeCore.Secrets(ns).Get(targetKubecfg, metav1.GetOptions{})"},{"line_number":37,"context_line":"\tif err !\u003d nil {"},{"line_number":38,"context_line":"\t\tlog.Fatalf(\"error accessing secret in kubernetes: %s\", err)"},{"line_number":39,"context_line":"\t}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"\treturn string(secret.Data[\"value\"])"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_47bc0305","line":38,"range":{"start_line":38,"start_character":2,"end_line":38,"end_character":61},"in_reply_to":"bf51134e_517de1af","updated":"2020-06-16 00:34:45.000000000","message":"Done","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":21991,"name":"Kostyantyn Kalynovskyi","email":"kkalinovskiy@gmail.com","username":"kkalynovskyi"},"change_message_id":"7c35dec8f0035cdead6e414bfbcc2903cc6c29a9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"\t\tlog.Fatalf(\"error accessing secret in kubernetes: %s\", err)"},{"line_number":39,"context_line":"\t}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"\treturn string(secret.Data[\"value\"])"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_911e596e","line":41,"range":{"start_line":41,"start_character":26,"end_line":41,"end_character":35},"updated":"2020-06-15 22:16:00.000000000","message":"I think we should check if \"value\" if secret actually has \"value\" key, because it will panic if it doesn\u0027t exist","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"},{"author":{"_account_id":23781,"name":"Stanislav Egorov","email":"realsystem@gmail.com","username":"StasEgorov"},"change_message_id":"a561ee529b111a5bdf6f146232879390622aed66","unresolved":false,"context_lines":[{"line_number":38,"context_line":"\t\tlog.Fatalf(\"error accessing secret in kubernetes: %s\", err)"},{"line_number":39,"context_line":"\t}"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"\treturn string(secret.Data[\"value\"])"},{"line_number":42,"context_line":"}"}],"source_content_type":"text/x-go","patch_set":6,"id":"bf51134e_a736bfb3","line":41,"range":{"start_line":41,"start_character":26,"end_line":41,"end_character":35},"in_reply_to":"bf51134e_911e596e","updated":"2020-06-16 00:34:45.000000000","message":"Done","commit_id":"c62ecd2c9eabea17746828ed970575f422c5fd8c"}]}
