-
Notifications
You must be signed in to change notification settings - Fork 704
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
feat(build): add halyard-integration module to exercise the just-built docker image #2144
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6bddd03
fix(core): move @Bean methods from GoogleProfileReader so separate co…
dbyron-sf e8892eb
fix(config): remove unused ProviderService variable from EcsAccountVa…
dbyron-sf d9abbc4
fix(config): Use @Lazy with ValidatorCollection.validators
dbyron-sf 549d14c
fix(config): add @Lazy to DeploymentService.storageService
dbyron-sf 54c6b23
fix(dpeloy): add @Lazy annotation to GoogleIgorService.googleDistribu…
dbyron-sf 5e6908f
fix(deploy): add @Lazy annotation to GoogleRedisBootstrapService.goog…
dbyron-sf ec38841
fix(deploy): add @Lazy annotation to GoogleDeckService.googleDistribu…
dbyron-sf dca51b1
fix(deploy): add @Lazy annotation to GoogleEchoService.googleDistribu…
dbyron-sf 26e7847
fix(deploy): add @Lazy annotation to GoogleConsulServerService.google…
dbyron-sf a153ca5
fix(deploy): add @Lazy annotation to GoogleFront50Service.googleDistr…
dbyron-sf 9d8dac7
fix(deploy): add @Lazy annotation to GoogleClouddriverService.googleD…
dbyron-sf 0da373e
fix(deploy): add @Lazy annotation to GoogleOrcaBootstrapService.googl…
dbyron-sf 76ff87c
fix(deploy): add @Lazy annotation to GoogleOrcaService.googleDistribu…
dbyron-sf 1e84373
fix(deploy): add @Lazy annotation to GoogleRoscoService.googleDistrib…
dbyron-sf a4c5748
fix(deploy): add @Lazy annotation to GoogleFiatService.googleDistribu…
dbyron-sf 4331b4d
fix(deploy): add @Lazy annotation to GoogleClouddriverBootstrapServic…
dbyron-sf 8ef9191
fix(deploy): add @Lazy annotation to GoogleRedisService.googleDistrib…
dbyron-sf 88a55bf
fix(deploy): add @Lazy annotation to GoogleGateService.googleDistribu…
dbyron-sf a663006
fix(deploy): add @Lazy annotation to GoogleKayentaService.googleDistr…
dbyron-sf 7b74dbe
fix(deploy): add @Lazy annotation to GoogleVaultServerService.googleD…
dbyron-sf d9d4c57
fix(deploy): add @Lazy annotation to KubernetesV2ServiceDelegate.moni…
dbyron-sf 94c4eb6
fix(deploy): remove unused SpinnakerMonitoringDaemonService.service p…
dbyron-sf e14c99b
feat(docker): add HEALTHCHECK
dbyron-sf a264a4f
feat(build): add halyard-integration module to exercise the just-buil…
dbyron-sf 6f36051
feat(gha): run integration test in pr builds
dbyron-sf 42daf3e
feat(gha): run integration test in branch builds
dbyron-sf f05bb4e
refactor(core): remove unused GoogleProfileReader.createGoogleStorage…
dbyron-sf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...c/main/java/com/netflix/spinnaker/halyard/core/registry/v1/GoogleProfileReaderConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright 2017 Google, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* | ||
*/ | ||
|
||
package com.netflix.spinnaker.halyard.core.registry.v1; | ||
|
||
import com.google.api.client.http.HttpRequestInitializer; | ||
import com.google.api.client.json.JsonFactory; | ||
import com.google.api.client.json.jackson2.JacksonFactory; | ||
import com.google.api.services.storage.Storage; | ||
import com.google.api.services.storage.StorageScopes; | ||
import com.netflix.spinnaker.halyard.core.provider.v1.google.GoogleCredentials; | ||
import java.util.Collections; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@ConditionalOnProperty("spinnaker.config.input.gcs.enabled") | ||
@Slf4j | ||
public class GoogleProfileReaderConfig { | ||
@Bean | ||
public Storage applicationDefaultGoogleStorage() { | ||
return createGoogleStorage(true); | ||
} | ||
|
||
@Bean | ||
public Storage unauthenticatedGoogleStorage() { | ||
return createGoogleStorage(false); | ||
} | ||
|
||
private Storage createGoogleStorage(boolean useApplicationDefaultCreds) { | ||
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); | ||
String applicationName = "Spinnaker/Halyard"; | ||
HttpRequestInitializer requestInitializer = null; | ||
|
||
if (useApplicationDefaultCreds) { | ||
try { | ||
com.google.auth.oauth2.GoogleCredentials credentials = | ||
com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(); | ||
if (credentials.createScopedRequired()) { | ||
credentials = | ||
credentials.createScoped( | ||
Collections.singleton(StorageScopes.DEVSTORAGE_FULL_CONTROL)); | ||
} | ||
requestInitializer = GoogleCredentials.setHttpTimeout(credentials); | ||
log.info("Loaded application default credential for reading BOMs & profiles."); | ||
} catch (Exception e) { | ||
log.debug( | ||
"No application default credential could be loaded for reading BOMs & profiles. Continuing unauthenticated: {}", | ||
e.getMessage()); | ||
} | ||
} | ||
if (requestInitializer == null) { | ||
requestInitializer = GoogleCredentials.retryRequestInitializer(); | ||
} | ||
|
||
return new Storage.Builder( | ||
GoogleCredentials.buildHttpTransport(), jsonFactory, requestInitializer) | ||
.setApplicationName(applicationName) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the class but left the private method call - can we delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks! f05bb4e