diff options
author | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-09-26 02:54:02 +0000 |
---|---|---|
committer | Igor D.C <igor.duarte.cardoso@intel.com> | 2020-09-28 23:29:09 +0000 |
commit | 5a8a4cc2fa457c334ea8254762725d70371cf56a (patch) | |
tree | 1b8e4925155274c27f245d7a09bf2a766f388db5 /src/orchestrator/pkg/appcontext | |
parent | 3ce5034769be46569c404c38ba05ed27164cbd0f (diff) |
Request CSR approvals via /subresource level
Make use of the new /subresource level (under a resource) to
request rsync to process approvals (a K8s subresource) for CSRs.
Generic usage of instructions (order, dependency) for consistency.
This also introduces a 'subresources' package in 'appcontext' with
the first member being the approval subresource. Since subresources
aren't necessarily created with yaml, this package will allow
developers to specify what should be the "interface" in appcontext
for each type of subresource when the different services need to
exchange this data (e.g. DCM and rsync).
Issue-ID: MULTICLOUD-1143
Change-Id: I8c85b4ee8c5654036a1c7ebb39d111ba4518b468
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
Diffstat (limited to 'src/orchestrator/pkg/appcontext')
-rw-r--r-- | src/orchestrator/pkg/appcontext/subresources/approval.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/orchestrator/pkg/appcontext/subresources/approval.go b/src/orchestrator/pkg/appcontext/subresources/approval.go new file mode 100644 index 00000000..9f3a1e1b --- /dev/null +++ b/src/orchestrator/pkg/appcontext/subresources/approval.go @@ -0,0 +1,27 @@ +/* + * Copyright 2020 Intel Corporation, 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 subresources + +// The ApprovalSubresource type defines the 4 necessary parameters +// that the "approval" subresource of a CertificateSigningRequest in K8s +// requires, in a forma tto be exchanged over AppContext +type ApprovalSubresource struct { + LastUpdateTime string `json:"lastUpdateTime,omitempty"` + Message string `json:"message,omitempty"` + Reason string `json:"reason,omitempty"` + Type string `json:"type,omitempty"` +} |