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

feat(provider/k8s): Prepare these new fileds or files for the statefu… #1853

Merged
merged 4 commits into from
Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class KubernetesClientApiConverter {
deployDescription.namespace = statefulSet?.metadata?.namespace
deployDescription.targetSize = statefulSet?.spec?.replicas
deployDescription.securityGroups = []
deployDescription.replicaSetAnnotations = statefulSet?.metadata?.annotations
deployDescription.controllerAnnotations = statefulSet?.metadata?.annotations
deployDescription.podAnnotations = statefulSet?.spec?.template?.metadata?.annotations
deployDescription.volumeClaims = statefulSet?.spec?.getVolumeClaimTemplates()
deployDescription.volumeSources = statefulSet?.spec?.template?.spec?.volumes?.collect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class KubernetesUtil {
static String DEPRECATED_SERVER_GROUP_KIND = "ReplicationController"
static String SERVER_GROUP_KIND = "ReplicaSet"
static String DEPLOYMENT_KIND = "Deployment"
static String CONTROLLERS_STATEFULSET_KIND = "StatefulSet"
static String CONTROLLERS_DAEMONSET_KIND = "DaemonSet"
static String JOB_LABEL = "job"
@Value("kubernetes.defaultRegistry:gcr.io")
static String DEFAULT_REGISTRY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ import groovy.transform.Canonical
class KubernetesAtomicOperationDescription implements DeployDescription, CredentialsNameable {
String account
KubernetesNamedAccountCredentials credentials
String kind
String apiVersion
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class DeployKubernetesAtomicOperationDescription extends KubernetesAtomicOperati
Capacity capacity
KubernetesScalingPolicy scalingPolicy
Map<String, String> replicaSetAnnotations
Map<String, String> controllerAnnotations
Map<String, String> podAnnotations
Map<String, String> volumeAnnotations
Map<String, String> nodeSelector
KubernetesSecurityContext securityContext
KubernetesDeployment deployment
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.netflix.spinnaker.clouddriver.kubernetes.deploy.exception

/**
* Created by chlung on 8/29/17.
*/
class KubernetesClientOperationException {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2017 Cisco, 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.kubernetes.model

import io.fabric8.kubernetes.api.model.HasMetadata
import io.fabric8.kubernetes.api.model.ObjectMeta
import io.kubernetes.client.models.V1ObjectMeta

class KubernetesControllerConverter implements HasMetadata {
String kind
String apiVersion
ObjectMeta metadata

KubernetesControllerConverter(String kind, String apiVersion, V1ObjectMeta metadata) {
this.kind = kind
this.apiVersion = apiVersion

this.metadata = new ObjectMeta()
this.metadata.name = metadata.name
this.metadata.namespace = metadata.namespace
setMetadata(this.metadata)
}

@Override
ObjectMeta getMetadata() {
return this.metadata
}

@Override
void setMetadata(ObjectMeta metadata) {
this.metadata = metadata
}

@Override
String getKind() {
return this.kind
}

@Override
String getApiVersion() {
return this.apiVersion
}
}