Skip to content

Commit

Permalink
Merge pull request #321 from sanchezl/degrade-on-no-host-etcd-endpoints
Browse files Browse the repository at this point in the history
Degrade on no host etcd endpoints
  • Loading branch information
openshift-merge-robot committed Feb 27, 2020
2 parents 9eda24a + ae641d6 commit d82183b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/operator/configobservation/etcdobserver/observe_etcd.go
Expand Up @@ -42,8 +42,9 @@ func ObserveStorageURLs(genericListers configobserver.Listers, recorder events.R
var etcdURLs sort.StringSlice
etcdEndpoints, err := listers.EndpointsLister.Endpoints(EtcdEndpointNamespace).Get(EtcdEndpointName)
if errors.IsNotFound(err) {
recorder.Warningf("ObserveStorageFailed", "Required endpoints/%s in the %s namespace not found, falling back to default etcd service", EtcdEndpointName, EtcdEndpointNamespace)
return observedConfig, errs
recorder.Warningf("ObserveStorageFailed", "Required endpoints/%s in the %s namespace not found.", EtcdEndpointName, EtcdEndpointNamespace)
errs = append(errs, fmt.Errorf("endpoints/%s in the %s namespace: not found", EtcdEndpointName, EtcdEndpointNamespace))
return previouslyObservedConfig, errs
}
if err != nil {
recorder.Warningf("ObserveStorageFailed", "Error getting endpoints/%s in the %s namespace: %v", EtcdEndpointName, EtcdEndpointNamespace, err)
Expand Down
Expand Up @@ -28,7 +28,8 @@ func TestObserveStorageURLs(t *testing.T) {
{
name: "NoEtcdHosts",
currentConfig: observedConfig(withStorageURL("https://previous.url:2379")),
expected: observedConfig(),
expected: observedConfig(withStorageURL("https://previous.url:2379")),
expectErrors: true,
},
{
name: "ValidIPv4",
Expand Down

0 comments on commit d82183b

Please sign in to comment.