Skip to content

Commit

Permalink
fix(core): Add NoopAtomicOperationConverter. (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler committed Mar 31, 2017
1 parent c078e72 commit a5f4659
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import com.netflix.spinnaker.clouddriver.model.NoopSubnetProvider
import com.netflix.spinnaker.clouddriver.model.ReservationReportProvider
import com.netflix.spinnaker.clouddriver.model.SecurityGroupProvider
import com.netflix.spinnaker.clouddriver.model.SubnetProvider
import com.netflix.spinnaker.clouddriver.orchestration.AtomicOperationConverter
import com.netflix.spinnaker.clouddriver.search.ApplicationSearchProvider
import com.netflix.spinnaker.clouddriver.search.NoopSearchProvider
import com.netflix.spinnaker.clouddriver.search.ProjectSearchProvider
Expand Down Expand Up @@ -225,4 +226,10 @@ class CloudDriverConfig {
new CleanupPendingOnDemandCachesAgent(jedisSource, applicationContext)
])
}

@Bean
@ConditionalOnMissingBean(AtomicOperationConverter)
AtomicOperationConverter atomicOperationConverter() {
new NoopAtomicOperationConverter()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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.clouddriver.core

import com.netflix.spinnaker.clouddriver.orchestration.AtomicOperation
import com.netflix.spinnaker.clouddriver.orchestration.AtomicOperationConverter
import groovy.util.logging.Slf4j
import org.springframework.stereotype.Component

@Slf4j
@Component("noProvidersConfigured")
class NoopAtomicOperationConverter implements AtomicOperationConverter {

NoopAtomicOperationConverter() {
log.warn("No AtomicOperationConverters found. This likely means you have no cloud providers configured.")
}

@Override
AtomicOperation convertOperation(Map input) {
return null
}

@Override
Object convertDescription(Map input) {
return null
}
}

0 comments on commit a5f4659

Please sign in to comment.