Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Unable to retrieve a non pushed service #4992

Closed
jeffmaury opened this issue Aug 12, 2021 · 7 comments · Fixed by #5025
Closed

Unable to retrieve a non pushed service #4992

jeffmaury opened this issue Aug 12, 2021 · 7 comments · Fixed by #5025
Assignees
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person kind/bug Categorizes issue or PR as related to a bug.

Comments

@jeffmaury
Copy link
Member

/kind bug

What versions of software are you using?

Operating System: Win10Pro

Output of odo version: 2.2.4

How did you run odo exactly?

odo create
odo push
odo service create
odo service list
odo service list -o json

Actual behavior

The first odo service list reports the service as non pushed, the second one does not list it

Expected behavior

The non pushed service should be reported in the JSON output

Any logs, error output, etc?


C:\work\src\tmp\springboot-ex>odo service list                                                                                                           
NAME                                                                                                            MANAGED BY ODO     STATE          AGE    
Kafka/my-cluster                                                                                                Yes (sbcomp1)      Not pushed            
KafkaTopic/consumer-offsets---84e7a678d08f4bd226872e5cdd4eb527fadc1c6a                                          No                                22m59s 
KafkaTopic/strimzi-store-topic---effb8e3e057afce1ecf67c3f5d8e4e3ff177fc55                                       No                                23m0s  
KafkaTopic/strimzi-topic-operator-kstreams-topic-store-changelog---b75e702040b99be8a9263134de3507fc0cc4017b     No                                22m59s 

[
	{
		"apiVersion": "kafka.strimzi.io/v1beta2",
		"kind": "KafkaTopic",
		"metadata": {
			"creationTimestamp": "2021-08-12T16:28:53Z",
			"generation": 1,
			"labels": {
				"strimzi.io/cluster": "my-cluster"
			},
			"managedFields": [
				{
					"apiVersion": "kafka.strimzi.io/v1beta2",
					"fieldsType": "FieldsV1",
					"fieldsV1": {
						"f:metadata": {
							"f:labels": {
								".": {},
								"f:strimzi.io/cluster": {}
							}
						},
						"f:spec": {
							".": {},
							"f:config": {
								".": {},
								"f:cleanup.policy": {},
								"f:compression.type": {},
								"f:segment.bytes": {}
							},
							"f:partitions": {},
							"f:replicas": {},
							"f:topicName": {}
						},
						"f:status": {
							".": {},
							"f:conditions": {},
							"f:observedGeneration": {},
							"f:topicName": {}
						}
					},
					"manager": "okhttp",
					"operation": "Update",
					"time": "2021-08-12T16:28:54Z"
				}
			],
			"name": "consumer-offsets---84e7a678d08f4bd226872e5cdd4eb527fadc1c6a",
			"namespace": "demo",
			"resourceVersion": "40685",
			"selfLink": "/apis/kafka.strimzi.io/v1beta2/namespaces/demo/kafkatopics/consumer-offsets---84e7a678d08f4bd226872e5cdd4eb527fadc1c6a",
			"uid": "67af7e70-9b0f-4f64-b52b-644be98ed60a"
		},
		"spec": {
			"config": {
				"cleanup.policy": "compact",
				"compression.type": "producer",
				"segment.bytes": "104857600"
			},
			"partitions": 50,
			"replicas": 3,
			"topicName": "__consumer_offsets"
		},
		"status": {
			"conditions": [
				{
					"lastTransitionTime": "2021-08-12T16:28:54.638183Z",
					"status": "True",
					"type": "Ready"
				}
			],
			"observedGeneration": 1,
			"topicName": "__consumer_offsets"
		}
	},
	{
		"apiVersion": "kafka.strimzi.io/v1beta2",
		"kind": "KafkaTopic",
		"metadata": {
			"creationTimestamp": "2021-08-12T16:28:52Z",
			"generation": 1,
			"labels": {
				"strimzi.io/cluster": "my-cluster"
			},
			"managedFields": [
				{
					"apiVersion": "kafka.strimzi.io/v1beta2",
					"fieldsType": "FieldsV1",
					"fieldsV1": {
						"f:metadata": {
							"f:labels": {
								".": {},
								"f:strimzi.io/cluster": {}
							}
						},
						"f:spec": {
							".": {},
							"f:config": {
								".": {},
								"f:min.insync.replicas": {}
							},
							"f:partitions": {},
							"f:replicas": {},
							"f:topicName": {}
						},
						"f:status": {
							".": {},
							"f:conditions": {},
							"f:observedGeneration": {},
							"f:topicName": {}
						}
					},
					"manager": "okhttp",
					"operation": "Update",
					"time": "2021-08-12T16:28:54Z"
				}
			],
			"name": "strimzi-store-topic---effb8e3e057afce1ecf67c3f5d8e4e3ff177fc55",
			"namespace": "demo",
			"resourceVersion": "40683",
			"selfLink": "/apis/kafka.strimzi.io/v1beta2/namespaces/demo/kafkatopics/strimzi-store-topic---effb8e3e057afce1ecf67c3f5d8e4e3ff177fc55",
			"uid": "eb9d44c0-70b6-45c9-b36a-2907d8d6f571"
		},
		"spec": {
			"config": {
				"min.insync.replicas": "2"
			},
			"partitions": 1,
			"replicas": 3,
			"topicName": "__strimzi_store_topic"
		},
		"status": {
			"conditions": [
				{
					"lastTransitionTime": "2021-08-12T16:28:54.351656Z",
					"status": "True",
					"type": "Ready"
				}
			],
			"observedGeneration": 1,
			"topicName": "__strimzi_store_topic"
		}
	},
	{
		"apiVersion": "kafka.strimzi.io/v1beta2",
		"kind": "KafkaTopic",
		"metadata": {
			"creationTimestamp": "2021-08-12T16:28:53Z",
			"generation": 1,
			"labels": {
				"strimzi.io/cluster": "my-cluster"
			},
			"managedFields": [
				{
					"apiVersion": "kafka.strimzi.io/v1beta2",
					"fieldsType": "FieldsV1",
					"fieldsV1": {
						"f:metadata": {
							"f:labels": {
								".": {},
								"f:strimzi.io/cluster": {}
							}
						},
						"f:spec": {
							".": {},
							"f:config": {
								".": {},
								"f:cleanup.policy": {},
								"f:message.timestamp.type": {},
								"f:min.compaction.lag.ms": {},
								"f:segment.bytes": {}
							},
							"f:partitions": {},
							"f:replicas": {},
							"f:topicName": {}
						},
						"f:status": {
							".": {},
							"f:conditions": {},
							"f:observedGeneration": {},
							"f:topicName": {}
						}
					},
					"manager": "okhttp",
					"operation": "Update",
					"time": "2021-08-12T16:28:54Z"
				}
			],
			"name": "strimzi-topic-operator-kstreams-topic-store-changelog---b75e702040b99be8a9263134de3507fc0cc4017b",
			"namespace": "demo",
			"resourceVersion": "40684",
			"selfLink": "/apis/kafka.strimzi.io/v1beta2/namespaces/demo/kafkatopics/strimzi-topic-operator-kstreams-topic-store-changelog---b75e702040b99be8a9263134de3507fc0cc4017b",
			"uid": "b7557429-b689-459a-8901-ba6c7adf0035"
		},
		"spec": {
			"config": {
				"cleanup.policy": "compact",
				"message.timestamp.type": "CreateTime",
				"min.compaction.lag.ms": "0",
				"segment.bytes": "67108864"
			},
			"partitions": 1,
			"replicas": 1,
			"topicName": "__strimzi-topic-operator-kstreams-topic-store-changelog"
		},
		"status": {
			"conditions": [
				{
					"lastTransitionTime": "2021-08-12T16:28:54.616899Z",
					"status": "True",
					"type": "Ready"
				}
			],
			"observedGeneration": 1,
			"topicName": "__strimzi-topic-operator-kstreams-topic-store-changelog"
		}
	}
]
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 12, 2021
@valaparthvi
Copy link
Contributor

@feloy The odo service list -o json code that prints the JSON format only shows deployed services, from the comments that you put here https://github.com/openshift/odo/blob/main/pkg/odo/cli/service/list_operator.go#L41, it seems like the behaviour is intended. Can you confirm and if so, can you explain why it is this way?

@feloy
Copy link
Contributor

feloy commented Aug 18, 2021

@feloy The odo service list -o json code that prints the JSON format only shows deployed services, from the comments that you put here https://github.com/openshift/odo/blob/main/pkg/odo/cli/service/list_operator.go#L41, it seems like the behaviour is intended. Can you confirm and if so, can you explain why it is this way?

@valaparthvi With the necessary hindsight, I'm now sure the JSON output should have the same content as the text output. You can consider I was wrong when writing this comment

@jeffmaury
Copy link
Member Author

@feloy The odo service list -o json code that prints the JSON format only shows deployed services, from the comments that you put here https://github.com/openshift/odo/blob/main/pkg/odo/cli/service/list_operator.go#L41, it seems like the behaviour is intended. Can you confirm and if so, can you explain why it is this way?

@valaparthvi With the necessary hindsight, I'm now sure the JSON output should have the same content as the text output. You can consider I was wrong when writing this comment

Seems to be defeated by my issue, are you talking about master/main or latest release ?

@feloy
Copy link
Contributor

feloy commented Aug 18, 2021

@feloy The odo service list -o json code that prints the JSON format only shows deployed services, from the comments that you put here https://github.com/openshift/odo/blob/main/pkg/odo/cli/service/list_operator.go#L41, it seems like the behaviour is intended. Can you confirm and if so, can you explain why it is this way?

@valaparthvi With the necessary hindsight, I'm now sure the JSON output should have the same content as the text output. You can consider I was wrong when writing this comment

Seems to be defeated by my issue, are you talking about master/main or latest release ?

I realize now that I was wrong when I added the non-deployed services to the text output without adding them to the json output (on this PR #4761). I had the chance to learn more about the JSON output since then, and understands now I should have added it to the JSON output also.

The issue appears in main and from the release 2.2.3.

I don't think it is a concern to add the non-deployed services to the JSON output.

@jeffmaury
Copy link
Member Author

As a general rule, having content from text and structured output different will break the tooling (my team is working on 😄 )

@valaparthvi
Copy link
Contributor

@valaparthvi With the necessary hindsight, I'm now sure the JSON output should have the same content as the text output.

Thank you for confirming that, Philippe.

@valaparthvi
Copy link
Contributor

valaparthvi commented Aug 19, 2021

Scope of this issue:

    • Add an integration test: service should be listed in the JSON output.
    • Move the JSON code block to the end of the file and modify it to list both clusterList and devfileList of services.

@valaparthvi valaparthvi removed their assignment Aug 19, 2021
@dharmit dharmit added the estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person label Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants