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

Use MICRO_REGISTRY_ADDRESS env var for etcd address #1546

Merged
merged 14 commits into from
Jan 29, 2021

Conversation

ybr-nx
Copy link
Contributor

@ybr-nx ybr-nx commented Jan 28, 2021

Description

MICRO_REGISTRY_ADDRESS used only in ocis-pkg/registry/registry and not here. It tried to connect to 127.0.0.1 instead.

@update-docs
Copy link

update-docs bot commented Jan 28, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@IljaN IljaN assigned IljaN and unassigned IljaN Jan 28, 2021
@IljaN IljaN self-requested a review January 28, 2021 19:18
Copy link
Member

@IljaN IljaN left a comment

Choose a reason for hiding this comment

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

LGTM + Tested 👍

Copy link
Contributor

@wkloucek wkloucek left a comment

Choose a reason for hiding this comment

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

Couldn't this be replaced by following?

func newGrpcClient() mclient.Client {
	r := *registry.GetRegistry()

	c := grpc.NewClient(
		mclient.RequestTimeout(10*time.Second),
		mclient.Registry(r),
	)
	return c
}

@ybr-nx
Copy link
Contributor Author

ybr-nx commented Jan 29, 2021

Yes, it seems cleaner. I'll test it right away

@wkloucek
Copy link
Contributor

Used test steps:
run etcd on non localhost / 127.0.0.1 interface. Eg. use your wifi or ethernet ip address:

docker run \
  -p 192.168.0.29:2379:2379 \
  -p 192.168.0.29:2380:2380 \
  --name etcd-v3.2.8 \
  --volume=/tmp/etcd-data.tmp:/etcd-data \
  gcr.io/etcd-development/etcd:v3.2.8 \
  /usr/local/bin/etcd \
  --name s1 \
  --data-dir /etcd-data \
  --listen-client-urls http://0.0.0.0:2379 \
  --advertise-client-urls http://0.0.0.0:2379 \
  --listen-peer-urls http://0.0.0.0:2380 \
  --initial-advertise-peer-urls http://0.0.0.0:2380 \
  --initial-cluster s1=http://0.0.0.0:2380 \
  --initial-cluster-token tkn

run oCIS:

export MICRO_REGISTRY=etcd
export MICRO_REGISTRY_ADDRESS=192.168.0.29
go run ./cmd/ocis

Try to log in on the web UI. Fails before this fix and works after this fix.

@wkloucek
Copy link
Contributor

@ybr-nx Could you please add a change log in the folder changelog

My proposal:

Bugfix: Fix etcd address configuration

The etcd server address in `MICRO_REGISTRY_ADDRESS` was not picked up when etcd was set as service discovery registry `MICRO_REGISTRY=etcd`. Therefore etcd was only working if available on localhost / 127.0.0.1.

https://github.com/owncloud/ocis/pull/1546

@ybr-nx ybr-nx requested a review from wkloucek January 29, 2021 10:59
Copy link
Contributor

@wkloucek wkloucek left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution!

@wkloucek
Copy link
Contributor

@ybr-nx sorry that I need to come back to you again. Can you rebase your current branch or merge our master branch back to your branch? We had some big changes our master branch which caused that this PR can not be merged in the current state.

@sonarcloud
Copy link

sonarcloud bot commented Jan 29, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@wkloucek wkloucek merged commit eb72c5d into owncloud:master Jan 29, 2021
ownclouders pushed a commit that referenced this pull request Jan 29, 2021
Merge: fb8a744 cfb6bf3
Author: Willy Kloucek <34452982+wkloucek@users.noreply.github.com>
Date:   Fri Jan 29 19:03:12 2021 +0100

    Merge pull request #1546 from ybr-nx/master

    Use MICRO_REGISTRY_ADDRESS env var for etcd address
@micbar micbar mentioned this pull request Feb 17, 2021
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants