github.com/zppinho/prow@v0.0.0-20240510014325-1738badeb017/cmd/initupload/main.go (about) 1 /* 2 Copyright 2018 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // initupload parses the logs from the clonerefs 18 // container and determines if that container was 19 // successful or not. Using that information, this 20 // container uploads started.json and if necessary 21 // finished.json as well. 22 package main 23 24 import ( 25 "github.com/sirupsen/logrus" 26 27 "sigs.k8s.io/prow/pkg/initupload" 28 "sigs.k8s.io/prow/pkg/logrusutil" 29 "sigs.k8s.io/prow/pkg/pod-utils/options" 30 ) 31 32 func main() { 33 logrusutil.ComponentInit() 34 35 o := initupload.NewOptions() 36 if err := options.Load(o); err != nil { 37 logrus.Fatalf("Could not resolve options: %v", err) 38 } 39 40 if err := o.Validate(); err != nil { 41 logrus.Fatalf("Invalid options: %v", err) 42 } 43 44 if err := o.Run(); err != nil { 45 logrus.WithError(err).Fatal("Failed to initialize job") 46 } 47 }