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

Add support for platform api 0.2 #267

Merged
merged 1 commit into from
Jan 15, 2020
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
38 changes: 9 additions & 29 deletions pkg/apis/build/v1alpha1/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ import (
corev1alpha1 "github.com/pivotal/kpack/pkg/apis/core/v1alpha1"
)

func (bi *BuildBuilderSpec) getBuilderSecretVolume() corev1.Volume {
if len(bi.ImagePullSecrets) > 0 {
return corev1.Volume{
Name: builderPullSecretsDirName,
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: bi.ImagePullSecrets[0].Name,
},
},
}
} else {
return corev1.Volume{
Name: builderPullSecretsDirName,
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
}
}
}

func (*Build) GetGroupVersionKind() schema.GroupVersionKind {
return SchemeGroupVersion.WithKind("Build")
}
Expand All @@ -36,6 +16,14 @@ func (b *Build) Tag() string {
return b.Spec.Tags[0]
}

func (b *Build) ServiceAccount() string {
return b.Spec.ServiceAccount
}

func (b *Build) BuilderSpec() BuildBuilderSpec {
return b.Spec.Builder
}

func (b *Build) IsRunning() bool {
if b == nil {
return false
Expand Down Expand Up @@ -100,15 +88,7 @@ func (b *Build) Finished() bool {
return !b.Status.GetCondition(corev1alpha1.ConditionSucceeded).IsUnknown()
}

func (b *Build) SourceEnvVars() []corev1.EnvVar {
return b.Spec.Source.Source().BuildEnvVars()
}

func (b *Build) ImagePullSecretsVolume() corev1.Volume {
return b.Spec.Source.Source().ImagePullSecretsVolume()
}

func (b *Build) Rebasable(builderStack string) bool {
func (b *Build) rebasable(builderStack string) bool {
return b.Spec.LastBuild != nil &&
b.Annotations[BuildReasonAnnotation] == BuildReasonStack && b.Spec.LastBuild.StackId == builderStack
}
Loading