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(STONEINTG-1006): adding field status.lasPromotedImage to component #84

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
make test
- name: Run Gosec Security Scanner
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/securego/gosec/v2/cmd/gosec@v2.19.0
make gosec
if [[ $? != 0 ]]
then
Expand Down
2 changes: 1 addition & 1 deletion .tekton/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
value: '{{revision}}'
- name: infra-deployment-update-script
value: |
sed -i -e 's|\(https://github.com/redhat-appstudio/application-api/.*?ref=\)\(.*\)|\1{{ revision }}|' components/application-api/kustomization.yaml
sed -i -e 's|\(https://github.com/konflux-ci/application-api/.*?ref=\)\(.*\)|\1{{ revision }}|' components/application-api/kustomization.yaml
pipelineSpec:
params:
- description: Source Repository URL
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ kustomize: ## Download kustomize locally if necessary.

ENVTEST = $(shell pwd)/bin/setup-envtest
envtest: ## Download envtest-setup locally if necessary.
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@395cfc7486e652d19fe1b544a436f9852ba26e4f)

install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
Expand Down
22 changes: 11 additions & 11 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,85 +5,85 @@ plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: application-api
repo: github.com/redhat-appstudio/application-api
repo: github.com/konflux-ci/application-api
resources:
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: Application
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: Component
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: ComponentDetectionQuery
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: SnapshotEnvironmentBinding
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: Snapshot
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: PromotionRun
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: Environment
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
domain: redhat.com
group: appstudio
kind: DeploymentTargetClass
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: DeploymentTargetClaim
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: redhat.com
group: appstudio
kind: DeploymentTarget
path: github.com/redhat-appstudio/application-api/api/v1alpha1
path: github.com/konflux-ci/application-api/api/v1alpha1
version: v1alpha1
version: "3"
4 changes: 4 additions & 0 deletions api/v1alpha1/component_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ type ComponentStatus struct {
// Example: 41fbdb124775323f58fd5ce93c70bb7d79c20650.
LastBuiltCommit string `json:"lastBuiltCommit,omitempty"`

// The last digest image component was promoted with.
// Example: quay.io/someorg/somerepository@sha256:5ca85b7f7b9da18a9c4101e81ee1d9bac35ac2b0b0221908ff7389204660a262.
LastPromotedImage string `json:"lastPromotedImage,omitempty"`

// The list of names of Components whose builds nudge this resource (their spec.build-nudges-ref[] references this component)
BuildNudgedBy []string `json:"build-nudged-by,omitempty"`
}
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 83 additions & 65 deletions config/crd/bases/appstudio.redhat.com_applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: applications.appstudio.redhat.com
spec:
group: appstudio.redhat.com
Expand Down Expand Up @@ -37,71 +36,89 @@ spec:
Hybrid Application Service Kube API </a>
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'
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'
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:
type: object
spec:
description: ApplicationSpec defines the desired state of Application
properties:
appModelRepository:
description: AppModelRepository refers to the git repository that
will store the application model (a devfile) Can be the same as
GitOps repository. A repository will be generated if this field
is left blank. Optional.
description: |-
AppModelRepository refers to the git repository that will store the application model (a devfile)
Can be the same as GitOps repository.
A repository will be generated if this field is left blank.
Optional.
properties:
branch:
description: 'Branch corresponds to the branch in the repository
that should be used Example: devel. Optional.'
description: |-
Branch corresponds to the branch in the repository that should be used
Example: devel.
Optional.
type: string
context:
description: 'Context corresponds to the context within the repository
that should be used Example: folderA/folderB/gitops. Optional.'
description: |-
Context corresponds to the context within the repository that should be used
Example: folderA/folderB/gitops.
Optional.
type: string
url:
description: 'URL refers to the repository URL that should be
used. If not specified, a GitOps repository under the $GITHUB_ORG
(defaults to redhat-appstudio-appdata) organization on GitHub
will be generated by HAS. Example: https://github.com/devfile-test/myrepo.
Required.'
description: |-
URL refers to the repository URL that should be used. If not specified, a GitOps repository under the
$GITHUB_ORG (defaults to redhat-appstudio-appdata) organization on GitHub will be generated by HAS.
Example: https://github.com/devfile-test/myrepo.
Required.
type: string
required:
- url
type: object
description:
description: Description refers to a brief description of the application.
description: |-
Description refers to a brief description of the application.
Optional.
type: string
displayName:
description: DisplayName refers to the name that an application will
be deployed with in App Studio. Required.
description: |-
DisplayName refers to the name that an application will be deployed with in App Studio.
Required.
type: string
gitOpsRepository:
description: GitOpsRepository refers to the git repository that will
store the gitops resources. Can be the same as App Model Repository.
A repository will be generated if this field is left blank. Optional.
description: |-
GitOpsRepository refers to the git repository that will store the gitops resources.
Can be the same as App Model Repository.
A repository will be generated if this field is left blank.
Optional.
properties:
branch:
description: 'Branch corresponds to the branch in the repository
that should be used Example: devel. Optional.'
description: |-
Branch corresponds to the branch in the repository that should be used
Example: devel.
Optional.
type: string
context:
description: 'Context corresponds to the context within the repository
that should be used Example: folderA/folderB/gitops. Optional.'
description: |-
Context corresponds to the context within the repository that should be used
Example: folderA/folderB/gitops.
Optional.
type: string
url:
description: 'URL refers to the repository URL that should be
used. If not specified, a GitOps repository under the $GITHUB_ORG
(defaults to redhat-appstudio-appdata) organization on GitHub
will be generated by HAS. Example: https://github.com/devfile-test/myrepo.
Required.'
description: |-
URL refers to the repository URL that should be used. If not specified, a GitOps repository under the
$GITHUB_ORG (defaults to redhat-appstudio-appdata) organization on GitHub will be generated by HAS.
Example: https://github.com/devfile-test/myrepo.
Required.
type: string
required:
- url
Expand All @@ -116,42 +133,42 @@ spec:
description: Conditions is an array of the Application's status conditions
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
type FooStatus struct{ // Represents the observations of a foo's
current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
state of this API Resource.\n---\nThis struct is intended for
direct use as an array at the field path .status.conditions. For
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
observations of a foo's current state.\n\t // Known .status.conditions.type
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
\ // other fields\n\t}"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
Expand All @@ -165,11 +182,12 @@ spec:
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
---
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
useful (see .node.status.conditions), the ability to deconflict is important.
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
Expand Down
Loading
Loading