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 010 #1332

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ make unit
make e2e
```

* The IMAGE_REGISTRY environment variable must point at a registry with local write access - e.g.

```bash
export IMAGE_REGISTRY="gcr.io/<some-project>"
```

* The KPACK_TEST_NAMESPACE_LABELS environment variable allows you to define additional labels for the test namespace, e.g.

```bash
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ unit-ci:
$(GOCMD) test ./pkg/... -coverprofile=coverage.txt -covermode=atomic

e2e:
$(GOCMD) test --timeout=30m -v ./test/...
$(GOCMD) test --timeout=30m -failfast -v ./test/...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to add this... but I like it


.PHONY: unit unit-ci e2e
228 changes: 223 additions & 5 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5887,6 +5887,13 @@
},
"x-kubernetes-list-type": ""
},
"order-extensions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.BuilderOrderEntry"
}
},
"stack": {
"default": {},
"$ref": "#/definitions/io.k8s.api.core.v1.ObjectReference"
Expand Down Expand Up @@ -5943,6 +5950,13 @@
"$ref": "#/definitions/kpack.core.v1alpha1.OrderEntry"
}
},
"order-extensions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.core.v1alpha1.OrderEntry"
}
},
"os": {
"type": "string"
},
Expand Down Expand Up @@ -6116,6 +6130,13 @@
},
"x-kubernetes-list-type": ""
},
"order-extensions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.BuilderOrderEntry"
}
},
"serviceAccountRef": {
"default": {},
"$ref": "#/definitions/io.k8s.api.core.v1.ObjectReference"
Expand Down Expand Up @@ -6193,13 +6214,11 @@
"kpack.build.v1alpha2.ClusterBuildpackSpec": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"serviceAccountRef": {
"$ref": "#/definitions/io.k8s.api.core.v1.ObjectReference"
},
"source": {
"default": {},
"x-kubernetes-list-type": "",
"$ref": "#/definitions/kpack.core.v1alpha1.ImageSource"
}
}
},
Expand Down Expand Up @@ -6231,6 +6250,102 @@
}
}
},
"kpack.build.v1alpha2.ClusterExtension": {
"type": "object",
"required": [
"spec",
"status"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.ClusterExtensionSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.ClusterExtensionStatus"
}
}
},
"kpack.build.v1alpha2.ClusterExtensionList": {
"type": "object",
"required": [
"metadata",
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.ClusterExtension"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
}
}
},
"kpack.build.v1alpha2.ClusterExtensionSpec": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"serviceAccountRef": {
"$ref": "#/definitions/io.k8s.api.core.v1.ObjectReference"
}
}
},
"kpack.build.v1alpha2.ClusterExtensionStatus": {
"type": "object",
"properties": {
"conditions": {
"description": "Conditions the latest available observations of a resource's current state.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.core.v1alpha1.Condition"
},
"x-kubernetes-patch-merge-key": "type",
"x-kubernetes-patch-strategy": "merge"
},
"extensions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.core.v1alpha1.BuildpackStatus"
},
"x-kubernetes-list-type": ""
},
"observedGeneration": {
"description": "ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.",
"type": "integer",
"format": "int64"
}
}
},
"kpack.build.v1alpha2.ClusterStack": {
"type": "object",
"required": [
Expand Down Expand Up @@ -6498,6 +6613,102 @@
}
}
},
"kpack.build.v1alpha2.Extension": {
"type": "object",
"required": [
"spec",
"status"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
},
"spec": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.ExtensionSpec"
},
"status": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.ExtensionStatus"
}
}
},
"kpack.build.v1alpha2.ExtensionList": {
"type": "object",
"required": [
"metadata",
"items"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"items": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.Extension"
}
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"default": {},
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
}
}
},
"kpack.build.v1alpha2.ExtensionSpec": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"serviceAccountName": {
"type": "string"
}
}
},
"kpack.build.v1alpha2.ExtensionStatus": {
"type": "object",
"properties": {
"conditions": {
"description": "Conditions the latest available observations of a resource's current state.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.core.v1alpha1.Condition"
},
"x-kubernetes-patch-merge-key": "type",
"x-kubernetes-patch-strategy": "merge"
},
"extensions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.core.v1alpha1.BuildpackStatus"
},
"x-kubernetes-list-type": ""
},
"observedGeneration": {
"description": "ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.",
"type": "integer",
"format": "int64"
}
}
},
"kpack.build.v1alpha2.Image": {
"type": "object",
"required": [
Expand Down Expand Up @@ -6790,6 +7001,13 @@
},
"x-kubernetes-list-type": ""
},
"order-extensions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/kpack.build.v1alpha2.BuilderOrderEntry"
}
},
"serviceAccount": {
"type": "string"
},
Expand Down
22 changes: 14 additions & 8 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ import (
"context"
"flag"
"fmt"
"github.com/pivotal/kpack/pkg/buildchange"
"log"
"net/http"
"os"
"time"

"github.com/pivotal/kpack/pkg/secret"

"github.com/pivotal/kpack/pkg/cosign"
"github.com/Masterminds/semver/v3"
"github.com/sigstore/cosign/v2/cmd/cosign/cli/sign"
ociremote "github.com/sigstore/cosign/v2/pkg/oci/remote"

"github.com/Masterminds/semver/v3"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -41,11 +36,13 @@ import (
_ "github.com/pivotal/kpack/internal/logrus/fatal"
buildapi "github.com/pivotal/kpack/pkg/apis/build/v1alpha2"
"github.com/pivotal/kpack/pkg/blob"
"github.com/pivotal/kpack/pkg/buildchange"
"github.com/pivotal/kpack/pkg/buildpod"
"github.com/pivotal/kpack/pkg/client/clientset/versioned"
"github.com/pivotal/kpack/pkg/client/informers/externalversions"
"github.com/pivotal/kpack/pkg/cnb"
"github.com/pivotal/kpack/pkg/config"
"github.com/pivotal/kpack/pkg/cosign"
"github.com/pivotal/kpack/pkg/dockercreds/k8sdockercreds"
"github.com/pivotal/kpack/pkg/duckbuilder"
"github.com/pivotal/kpack/pkg/flaghelpers"
Expand All @@ -56,12 +53,15 @@ import (
"github.com/pivotal/kpack/pkg/reconciler/buildpack"
"github.com/pivotal/kpack/pkg/reconciler/clusterbuilder"
"github.com/pivotal/kpack/pkg/reconciler/clusterbuildpack"
"github.com/pivotal/kpack/pkg/reconciler/clusterextension"
"github.com/pivotal/kpack/pkg/reconciler/clusterstack"
"github.com/pivotal/kpack/pkg/reconciler/clusterstore"
"github.com/pivotal/kpack/pkg/reconciler/extension"
"github.com/pivotal/kpack/pkg/reconciler/image"
"github.com/pivotal/kpack/pkg/reconciler/lifecycle"
"github.com/pivotal/kpack/pkg/reconciler/sourceresolver"
"github.com/pivotal/kpack/pkg/registry"
"github.com/pivotal/kpack/pkg/secret"
)

const (
Expand Down Expand Up @@ -122,8 +122,10 @@ func main() {
sourceResolverInformer := informerFactory.Kpack().V1alpha2().SourceResolvers()
builderInformer := informerFactory.Kpack().V1alpha2().Builders()
buildpackInformer := informerFactory.Kpack().V1alpha2().Buildpacks()
extensionInformer := informerFactory.Kpack().V1alpha2().Extensions()
clusterBuilderInformer := informerFactory.Kpack().V1alpha2().ClusterBuilders()
clusterBuildpackInformer := informerFactory.Kpack().V1alpha2().ClusterBuildpacks()
clusterExtensionInformer := informerFactory.Kpack().V1alpha2().ClusterExtensions()
clusterStoreInformer := informerFactory.Kpack().V1alpha2().ClusterStores()
clusterStackInformer := informerFactory.Kpack().V1alpha2().ClusterStacks()

Expand Down Expand Up @@ -212,10 +214,12 @@ func main() {
buildController := build.NewController(ctx, options, k8sClient, buildInformer, podInformer, metadataRetriever, buildpodGenerator, podProgressLogger, keychainFactory, *injectedSidecarSupport)
imageController := image.NewController(ctx, options, k8sClient, imageInformer, buildInformer, duckBuilderInformer, sourceResolverInformer, pvcInformer, *enablePriorityClasses)
sourceResolverController := sourceresolver.NewController(ctx, options, sourceResolverInformer, gitResolver, blobResolver, registryResolver)
builderController, builderResync := builder.NewController(ctx, options, builderInformer, builderCreator, keychainFactory, clusterStoreInformer, buildpackInformer, clusterBuildpackInformer, clusterStackInformer, secretFetcher)
builderController, builderResync := builder.NewController(ctx, options, builderInformer, builderCreator, keychainFactory, clusterStoreInformer, buildpackInformer, clusterBuildpackInformer, clusterStackInformer, extensionInformer, clusterExtensionInformer, secretFetcher)
buildpackController := buildpack.NewController(ctx, options, keychainFactory, buildpackInformer, remoteStoreReader)
clusterBuilderController, clusterBuilderResync := clusterbuilder.NewController(ctx, options, clusterBuilderInformer, builderCreator, keychainFactory, clusterStoreInformer, clusterBuildpackInformer, clusterStackInformer, secretFetcher)
extensionController := extension.NewController(ctx, options, keychainFactory, extensionInformer, remoteStoreReader)
clusterBuilderController, clusterBuilderResync := clusterbuilder.NewController(ctx, options, clusterBuilderInformer, builderCreator, keychainFactory, clusterStoreInformer, clusterBuildpackInformer, clusterStackInformer, clusterExtensionInformer, secretFetcher)
clusterBuildpackController := clusterbuildpack.NewController(ctx, options, keychainFactory, clusterBuildpackInformer, remoteStoreReader)
clusterExtensionController := clusterextension.NewController(ctx, options, keychainFactory, clusterExtensionInformer, remoteStoreReader)
clusterStoreController := clusterstore.NewController(ctx, options, keychainFactory, clusterStoreInformer, remoteStoreReader)
clusterStackController := clusterstack.NewController(ctx, options, keychainFactory, clusterStackInformer, remoteStackReader)
lifecycleController := lifecycle.NewController(ctx, options, k8sClient, config.LifecycleConfigName, lifecycleConfigmapInformer, lifecycleProvider)
Expand Down Expand Up @@ -250,8 +254,10 @@ func main() {
run(buildController, routinesPerController),
run(builderController, routinesPerController),
run(buildpackController, routinesPerController),
run(extensionController, routinesPerController),
run(clusterBuilderController, routinesPerController),
run(clusterBuildpackController, routinesPerController),
run(clusterExtensionController, routinesPerController),
run(clusterStoreController, routinesPerController),
run(lifecycleController, routinesPerController),
run(sourceResolverController, 2*routinesPerController),
Expand Down
2 changes: 1 addition & 1 deletion cmd/rebase/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func rebase(tags []string, logger *log.Logger) error {

rebaser := lifecycle.Rebaser{
Logger: cmd.DefaultLogger,
PlatformAPI: api.MustParse("0.9"),
PlatformAPI: api.MustParse("0.10"),
}
report, err := rebaser.Rebase(appImage, newBaseImage, appImage.Name(), tags[1:])
if err != nil {
Expand Down
Loading